Batch Execution

OMNeT⁠+⁠+ INI files allow you to run a simulation several times with different parameters. You can specify loops or constraint conditions for specific parameters.

Figure 6.3.  Iteration variable in the INI file

Iteration variable in the INI file

Note

Batch running is supported only in the command line environment.

If you create an INI file configuration ([Config] section) with one or more iteration variables, you will be able to run your simulations to explore the parameter space defined by those variables. Practically, the IDE creates the Cartesian product from these variables and assigns a run number to each product. It is possible to execute one, several or all runs of the simulation by specifying the Run number field in the Run Dialog. You can specify a single number (e.g. 3), a combination of several numbers (e.g. 2,3,6,7..11), all run numbers (using *) or boolean expressions using contstants and iteration variables (e.g. $numHosts>5 and $numHosts<10.)

Tip

If you already have specified your executable, chosen the configuration which should be run and selected the command line environment, you may try to hover over the Run Number field. This will give you a description of the possible runs and how they are associated with the iteration variable values (the tooltip is calculated by executing the simulation program with the -x Configuration -G options in command line mode).

Figure 6.4.  Iteration loop expansion in a tooltip

Iteration loop expansion in a tooltip

If you have a multi-core or multi-processor system and have ample memory, you may try to set the Processes to run parallel field to a higher number. This will allow the IDE to start more simulation processes in parallel, resulting in a much lower overall simulation time for the whole batch.

Warning

Be aware that you need enough memory to run all these processes in parallel. We recommend using this feature only if your simulation is CPU-bound. If you do not have enough memory, your operating system may start to use virtual memory, dramatically decreasing the overall performance.