Skip to content

RunIdyno.py

roughhawkbit edited this page Apr 26, 2013 · 6 revisions

2(A): Running iDynoMiCS using RunIdyno.py

Within the provided iDynoMiCS directory (also known as a folder) you can find a further directory named scripts_to_start_idynomics. This directory contains the file RunIdyno.py, a python script that will launch a simulation from command line. It is the recommended method of launching iDynoMiCS because it is Operating System independent, but does require python to be installed. Two alternate scripts are provided should this be a problem: a “.bat” batch script for Windows and a shell script “.sh” for Linux or Mac. However these are less flexible and general, and the paths to the iDynoMiCS classes have to be edited to match the paths to your installation. Therefore we recommend getting python (if you don't already have it) and running RunIdyno.py.

Open a command prompt / Terminal window (Windows: from the Start menu choose ‘Run’ and type ‘cmd’), and then navigate using the cd command to the directory containing the RunIdyno.py file, as shown below.

Then call the RunIdyno.py file followed by the path to where the protocol is located. Example protocol files are provided in the iDynoMiCS\protocol\examples directory.

You can supply several protocol files on the command line if you want to execute several simulations in the sequence given.

The simulation should start, printing output into the command window until the simulation finishes. The single_species_single_substrate_2D.xml protocol file within the examples simulates 3 days of growth and with the default timestep runs for 72 iterations (one per hour), should take around 10 minutes or less to compute on a modern computer. The simulation may be stopped at any time by closing the command line window or pressing Ctrl+C twice.

Simulation results for protocols located in the iDynoMiCS\protocol directory are by default stored in iDynoMiCS\results, and this directory will recreate the directory structure of the protocol directory.

iDynoPY

Replicate Simulations using RunIdyno.py

You can also run replicate simulations using RunIdyno.py. For that simply call the script as before, but include the option --multiples= followed by the number of replicates desired. Each replicate run is started with a different random number by reading in the random.state file as described at the beginning of this section.

To those who wish to develop iDynoMiCS, and so may have different versions of the source code saved on their system, we recommend that RunIdyno.py be customised to point to a specific source directory. On line 10, replace set_to_source_directory to the location of the desired directory; this can be overridden by calling the command line option --src= followed by an alternate source directory.

Setting memory allocation using RunIdyno.py

This section may be useful if you encounter error messages such as java.lang.OutOfMemoryError

By default, RunIdyno.py sets the memory allocated to an iDynoMiCS simulation to be between 300Mb and 1000Mb. Those running a large number of small simulations (less than 1000 agents in each, say) may want to reduce this; those running a large simulation (more than 100000 agents, say) on powerful hardware may want to increase it. The command line options are --Xmin= and --Xmax= followed by an integer (number of megabytes).


Clone this wiki locally