GENIE:GENIEToolboxExamples

Andrew Price, University of Southampton, ([mailto:a.r.price@soton.ac.uk a.r.price@soton.ac.uk])

Parametric study
To evaluate and manage a number of concurrent GENIE simulations it is straight-forward to script a simple study. A Matlab script can be written that performs a set of job submissions, polls the job handles and retrieves the output upon completion.

By default, compute jobs managed by the GENIE Toolbox are configured in uniquely named directories. This is fine for single jobs or if the output is archived in the database with accomanying metadata. The data can be identified easily in these circumstances. If a user simply wishes to evaluate an ensemble of runs and process the data on the local system, it is useful to be able to label the directories of each run directory with a meaningful identifier.

LocalRunDirUniq
The field LocalRunDirUniq can be added to the runtime data structure to define a specific directory in which a compute job is managed. If an ensemble of runs is to be executed and processed locally this is a useful field to specify.

Scripted ensemble study
A simple script to perform an ensemble of model runs would need to perform the following actions

 Load the model configuration [configuration, runtime.EXPID] = genie_eb_go_gs_config; Specify the model runtime runtime.RuntimeArchive = '/path/to/genie_eb_go_gs_archive.tar.gz'; runtime.LocalRunDir   = '/path/to/output'; Load the resource description metadata resource = createResource('NGSOxford'); Define the parameter range over which the model will be evaluated NJobs = 21; SclFWF = linspace(0.0, 2.0, NJobs); Submit the compute jobs that make up the ensemble for index=1:NJobs

% Specify a unique numbered directory for the model run runtime.LocalRunDirUniq = ['/path/to/output/', num2str(index,'%02d')];

% Update the SclFWF parameter metadata.genie_godstein.Parameter.SclFWF=SclFWF(index);

% Submit the compute job [handle, retrieve] = gc_jobsubmit(configuration, runtime, resource);

% Record the handle and retrieve information JobDetail{index}.handle  = handle; JobDetail{index}.retrieve = retrieve;

end Poll the job handles until all simulations are complete</li> % Vector recording run statuses running=ones(1,NJobs);

while sum(running)

% Loop through the jobs for index=1:NJobs

% Poll the compute job status = gc_jobstatus(JobDetail{index}.handle);

% If complete, record the change in status if status >= 3 running(index) = 0; end

end

% Wait a short time before polling again pause(30)

end Retrieve the output for each job</li> for index=1:NJobs

% Retrieve the output [success, resultsFiles] = gc_jobretrieve(JobDetail{index}.retrieve);

end </ol>

The simulation output should now reside in labelled directories within the folder specified in the runtime.LocalRunDir</tt> field in the script.