Skip to content

Handling of results

kheiken edited this page Jan 24, 2012 · 1 revision

Handling of results

Overview

The process of one simulation can be broken down to the following steps:

  1. User creates a job
  2. Server creates configuration files
  3. Client requests a new job
  4. Client downloads configuration files and models from the server
  5. Client runs the simulation
  6. Client uploads the results via FTP
  7. Client tells the server that the upload is complete
  8. Server finishes up the results

In depth analysis

1. User creates a job

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.

2. Server creates configuration files

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.

3. Client requests a new job

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.

4. Transfer of files to the client

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.

5. Client runs the simulation

The client runs the specified simulator (see org.scattport.client.apps.Sscatt:run()).

6. Simulation is complete

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.

7. Client notifies server that the simulation is complete

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

8. Server does the afterwork

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.