Running simulations in the background on Linux

When running simulations on a Linux machine, it may be helpful to run the simulation in the background, or even allow the simulation to continue running after the terminal window is closed.

The examples shown assume the following:

  • FDTD Solutions is installed in the default location
  • The simulation files are located in the current working directory of the terminal window
  • The simulation is run with the MPICH2nem version of the simulation engine.

1. Background the simulation without closing the terminal/session:

/opt/lumerical/<version>/mpich2/nemesis/bin/mpiexec -n 4 /opt/lumerical/<version>/bin/fdtd-engine-mpich2nem ./example.fsp &
  • The terminal window can be minimized.

2. Background the simulation and allow it to run with the terminal/session closed:

nohup /opt/lumerical/<version>/mpich2/nemesis/bin/mpiexec -n 4 /opt/lumerical/<version>/bin/fdtd-engine-mpich2nem ./example.fsp &> output.txt </dev/null &

3. Run multiple simulations in sequence and allow it to run even with the terminal/session closed:

(using the provided fdtd-run-local script, saving the output to a txt file)

cd /<location of simulation files>
nohup sh /opt/lumerical/fdtd/bin/fdtd-run-local.sh -n 4 *.fsp &> output.txt </dev/null &

For additional information on the simulation command line syntax, see the Knowledge Base.

2 Likes