In order to use runOpal.py you have to provide two
files, a template file foo.tmpl, and a data file foo.data.
The template file will be stored in the directory tmpl.
In the data file, symbols and values will be defined, which will be
replaced in the template file by the runOPAL.py script. A symbol in the data file maybe looks like CHARGE, the corresponding
symbol in the template file will look like _CHARGE_.
Recognized Environment Variables by runOPAL.py
The following environment variables recognized by the runOPAL.py:
Make sure the OPAL_EXE_PATH is set correctly. This is automatically done when using modules on Merlin, otherwise
you need to set it accordingly.
From the TEMPLATES directory the foo.tmpl file is taken and the values are replaced.
The field maps from the FIELDMAPS directory and the distributions from the DISTRIBUTIONS directory are linked to the directory where the simulation is executed.
SGE_QUEUE is the queue used for the simulation. Different queues may have different numbers of nodes and CPU's available as well as different run-time limitations.
SGE_RAM contains the number of GB of RAM that each CPU will allocate (if not specified, default is 4). If there is not enough memory available on one node, the node will not be fully loaded. Instead the number of CPU's will be distributed on as many nodes as needed to fulfil the RAM requirement. Merlin has nodes with 64 and 128 GB of RAM. Each node has 16 CPU's.
This is a snippet of a data and tmpl file (foo.data)
Q -1 # the chargeNPART 100000 # the number of simulation particlesCORES 2 # how many cores are used by OPAL
Caution, in the data file, no blank lines are allowed. If you specify negative values, do not put a space between the
The corresponding part of the template (foo.tmpl) file would look like:
You can run the runOPAL.py script without arguments, if the two files (foo.tmpl and foo.data) are present, a directory foo will be
created and all files for the simulation are either copied or linked to that directory. The simulation is then started from this directory
where also all results are stored. The general syntax of runOPAL.py is
--help shows all available parameters with a short description
--test exercises everything except for the submission of the job.
--restart-pos specifies the position (in meter) defining the restart of the simulation. If no data has been dumped at that position runOpal will use the nearest position stored in the restart file as restart position.
--restart-step specifies the restart step of the simulation.
--block runs opal local not using the batch system and waits until the job is done.
--keep if same simulation has been run before, keep old data and abort.
--nobatch uses plain mpirun on the local machine.
--optPilot will submit a optPilot job on Merlin (check additional parameters that can be set in the *foo.data file)
ATTR refers to a name in the data file
SCANVALUEstart:end:step, scans a parameter space, e.g., TFWHM=0.85:0.90:0.01.