-
Notifications
You must be signed in to change notification settings - Fork 0
Handling of results
The process of one simulation can be broken down to the following steps:
- User creates a job
- Server creates configuration files
- Client requests a new job
- Client downloads configuration files and models from the server
- Client runs the simulation
- Client uploads the results via FTP
- Client tells the server that the upload is complete
- Server finishes up the results
Inside the web interface a user can create a project which contains several experiments. When the user feels confident that he set one experiment up he can click the button "Start job". This will cause the server to create the configuration files. As soon as the job was starting by clicking the corresponding button, the experiment can not be changed anymore.
All values that the user has entered into the forms are now being parsed and written to a configuration file. This configuration file is stored on the server.
The code can be found at application/libraries/programs/Scatt.php.
When the client was set up, the user specified an interval in which to look for new jobs. This request is made using a standard HTTP request to the server.
If the server has jobs waiting to be run, the server will respond with some information regarding the job:
- ID of the project
- ID of the experiment
- ID of the job
Based on this information the client can download all required files from the server.
The client downloads the files from the server. (org.scattport.client.apps.Sscatt:setup())
This is done by creating a URI from the informations gathered in step 3:
http://{url-from-clientconfig}/uploads/{project-id}/{experiment-id}/{file}
Every simulator that exists inside the client application requires an array called inputFiles, which contains all files that are needed to complete the simulation. (See org.scattport.client.apps.Sscatt.)
For every file that is listed there, a request is made to download it to the temporary directory used for the simulation.
The client runs the specified simulator (see org.scattport.client.apps.Sscatt:run()).
When the simulation is complete, the client transmits the results to the server. (See org.scattport.client.apps.Sscatt:submitResults().)
In the first phase, the client uploads the resulting files to the ftp server that was specified when setting up the client. The path will be generated as follows:
incoming/{job-id}/
All files specified in the array outputFiles (See org.scattport.client.apps.Sscatt) will be uploaded to this directory.
After the upload is complete, the client sends an HTTP request to the server with the following info:
- The job id
- wether files were uploaded or not
If there were files uploaded in step 7, the method application/controllers/xmlrpc.php:_job_done() will now move the uploaded files from {ftproot}/{incoming}/{job-id} to uploads/{project-id}/{experiment-id}/.
After this step is complete, the results can be seen in the result browser.