Back to TotalFit Methods

Protocol for a parallel run (multiple-core mode)

First you need to have compiled a deamon from TotalFit project. Then you create a few folders for parallel runs. It is not necessary to have same number of run folders/deamons as the cores. To simulate multi-core operation you may run 4 deamons on one core, even if it will not be any better than one deamon or a local run. Deamon is started by using the command: /Applications/MCR_7/v79/ courtesy_timeout The first word is the shell script name made by MATLAB Compiler (the script must be on a system path), the second is path to MCR (MATLAB Run-Time libraries on the current computer) and the last is a deamon_courtesy_timeout, the time for the deamon to exit if it runs calculations or is idle for too long.

Second step (after the TotalFit dataset is created and ready to run fitting) is to load the names of the folders in it: set_folder_names(names-cell-array)

Third is to test whether your deamons are operational: totalfit_session.ping_idle_deamons(). The method will create a status query file wait the time ping_deamons_wait_time (a property of the TotalFit session set separately) and see who responded.

Then you can start fit('simplex', 'multiple-core'). It sends data to folders for multiple Monte-Carlo runs.

After the run is finished the main module sends a signal to all deamons to stop calculations via stop_fitting_runs(). If you are not going to need deamons any more you can quit them all using order_deamons_quit() method - it will send exit signal to all the run folders but does NOT verify if the deamons actually quit. This is user's business to make sure they exited: see appearance of the exit signals in run folders.

You may also directly quit the deamon using its terminal window: type 'jobs', see the job number and then type 'kill %number'.

As a courtesy measure the deamons will terminate themselves after a specified timeout (deamon_courtesy_timeout) in hours given to them as a command line parameter upon startup.

The main module will check if the deamon's version is correct to prevent situation when a new version of TotalFit submits data to an outdated deamon. This is a weak protection measure: it requires that any time when TotalFit class is changed it also has its version number manually incremented.



For a specific usage see TotalFit.m