Hosting an Optimization Server
Important: This feature is in experimental phase. At this phase, we reserve the rights to disable any server at any moment without notice. Use it at your own risk.

PREREQUISITES. Before downloading and installing the PIFOP Optimization Server, you will need:
  • A PIFOP account with optimization server hosting enabled.
  • A Linux 64bit based system. We use Ubuntu 16.04 for testing, which is based on Linux 4.4. Any Linux distribution based on Linux version 4.4 or greater should be fine.
  • Some version of AMPL installed and ready to be used. It will work with either demo, academic or paid version.

STEP 1. Download the PIFOP Optimization Server program by clicking here, or use the command line:
> wget https://pifop.com/download/opt-server.zip

STEP 2. Extract it wherever you want. Enter the extracted directory and run the opt-server program.
> unzip opt-server.zip
> cd opt-server
> ./opt-server

STEP 3. The first time you run the server you will be asked to give your server a name and to type the full path of the AMPL directory, that is, the directory in which the ampl program is.
1) Give your server a name: My Server
2) Absolute path to the directory containing ampl: /path/to/ampl-directory

STEP 4. After your server connects with our central server, sign-in with your PIFOP account username and password.

STEP 5. At this point your server should be ready to be used by you through the PIFOP web application. You can confirm that by accessing the Opt-Server management page management page and seeing if your server is listed in there.

STEP 6 (Optional). If you are the only user that will be using the optimization server, this step is not needed. In order to allow other users to use your server, you will need to edit the file config.json inside the opt-server directory. First, add a 'user-groups' section with one or more user group inside it. Second, add a 'users' section containing a list of the usernames in each group. For instance, if you want a user group called 'Undergraduates', and you want to limit the memory and time the processes initiated by users in this group can consume, your file would look like this.
{
    "name" : "My Server",
    "remember-me" : true,
    "ampl-directory" : "/path/to/ampl-directory",
    
    "user-groups" : {
        "Undergraduates" : {
            "max-memory" : 20,
            "max-time"   : 60
        }
    },
    
    "users" : {
        "Undergraduates": [
            "JuliaRoberts",
            "brad-pitt",
            "will_smith@uni.edu"
        ]
    }
}
The following table contains the restrictions and permissions that can be set for an user group.
Restriction/Permission
Value
Description
Default
max-memory
number
Maximum memory (in megabytes) used by jobs submited by users in the user group
0 (i.e. unlimited)
max-time
number
Maximum execution time (in minutes) of jobs submited by users in the user group
0 (i.e. unlimited)
max-jobs
number
Maximum number of simultaneous jobs submited by users in the user group
0 (i.e. unlimited)
monitor-rights
true or false
Enable/Disable monitoring commands for users in the user group
false
admin-rights
true or false
Enable/Disable admin commands for users in the user group
false

When a restriction/permission is ommited in the user group definition, the default value is used. If we were to add a 'Teachers' group to the example above, giving every restriction/permission an explicit value, here is how the user-groups section would look like (note that max-jobs = 0 means unlimited):
"user-groups" : {
    "Undergraduates" : {
        "max-memory"     : 20,
        "max-time"       : 60
    },
    
    "Teachers" : {
        "max-memory"     : 8000,
        "max-time"       : 480,
        "max-jobs"       : 0,
        "monitor-rights" : true,
        "admin-rights"   : false
    }
}
Restart the server to apply the changes.