This article provides details on running Lumerical simulations with command line using the Windows command prompt.
From the command line, you can run simulations through the Lumerical design environment, by running the engine directly, or through an MPI.
Running the design environment
[[snippet||52493047561619]]
[[snippet||52492316567187]]
Examples
Running a script while 'hiding' the CAD window and saving the log file on a different location.
"C:\Program Files\Lumerical\[[verpath]]\bin\interconnect.exe" -hide -run scriptfile.lsf -logall -o "C:\temp\logfiles\"Running a script with a simulation file while 'hiding' the CAD window and disabling safe mode.
"C:\Program Files\Lumerical\[[verpath]]\bin\fdtd-solutions" -nw -trust-script -run scriptfile.lsf simulationfile.fspOpening a simulation file.
"C:\Program Files\Lumerical\[[verpath]]\bin\mode-solutions.exe" simulationfile.lms
"C:\Program Files\Lumerical\[[verpath]]\bin\device.exe" simulationfile.ldevRunning the engine
[[snippet||52492560991251]]
Examples
Run a simulation using 12 threads (cores).
"C:\Program Files\Lumerical\[[verpath]]\bin\fdtd-engine.exe" -t 12 "C:\temp\example.fsp"Running with 4 threads (cores) and saving the log files into a specific path.
"C:\Program Files\Lumerical\v261\[[verpath]]\varfdtd-engine.exe" -t 4 "C:\temp\example.lms" -o "C:\temp\logfiles\"Running on the local computer with the -resume flag when check point is enabled in FDTD.
"C:\Program Files\Lumerical\v261\[[verpath]]\varfdtd-engine.exe" -t 4 -resume "\path\simulationfileRunning with an MPI
The message passing interface (MPI) is used to run simulations at the same time on different machines or processes, or to launch a simulation on a remote machine. Lumerical supports both concurrent computing, where several simulations are run at the same time, and distributed computing, where several machines are used to run a single simulation to use all available memory.
The general syntax for running using MPI is as follows:
mpiexec [mpi_options] solver [solver_options]Where mpiexec is the path to your MPI executable, and solver is the solver executable, each with their corresponding options.
For certain solvers in each MPI, you must use specific executables as seen below, instead of the general ones above.
For further information on setting up the MPI for distributed computing or concurrent computing, please visit their corresponding Knowledge Base article pages.
MPI Options
Some select commonly used options for each MPI are shown below.
For further information, please see the official documentation for each MPI, or run the executable with the -help flag. The examples below use the default installation locations.
Microsoft MPI
"C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -helpIntel MPI
"C:\Program Files\Lumerical\v261\intel_mpi\bin\mpiexec.exe" -help| Option Flag | Description |
|---|---|
-n <#> |
Only for the FDTD solver, varFDTD solver, and EME solver. Specifies the number of MPI processes. |
-hosts n <hostlist> |
Only for the FDTD solver, varFDTD solver, and EME solver. Sends jobs to multiple remote computers using the hostlist, which is a list of host names or IPs, with corresponding number of processes for the Microsoft MPI. Example Microsoft MPI -hosts n host1 n1 host2 n2… Intel MPI -hosts host1,host2… |
-machinefile <file> |
Sends jobs to multiple remote computers while assigning the number of processes for each host. See the documentation for each MPI for their machine file formats. |
-affinity |
Only for Microsoft MPI. Locks processes to specific cores. |
Solver executables
Use the following executables for each solver for the MPI. On Windows, it may be necessary to include the .exe suffix for the executables.
Note: Running with multiple MPI processes is only supported for the FDTD, EME, and varFDTD solvers.
| Product | Solver | MPI | Command |
|---|---|---|---|
| Ansys Lumerical FDTD™ | FDTD | Microsoft MPI | fdtd-engine-msmpi |
| Intel MPI | fdtd-engine-impi |
||
| Ansys Lumerical MODE™ | FDE | All | fd-engine |
| Ansys Lumerical MODE™ | EME | Microsoft MPI | eme-engine-msmpi |
| Intel MPI | eme-engine-impi |
||
| Ansys Lumerical MODE™ | varFDTD | Microsoft MPI | varfdtd-engine-msmpi |
| Intel MPI | varfdtd-engine-impi |
||
| Ansys Lumerical Multiphysics™ | CHARGE | All | device-engine |
| Ansys Lumerical Multiphysics™ | HEAT | All | thermal-engine |
| Ansys Lumerical Multiphysics™ | DGTD | All | dgtd-engine |
| Ansys Lumerical Multiphysics™ | FEEM | All | feem-engine |
| Ansys Lumerical Multiphysics™ | MQW | All | mqw-engine |
Simple Multi-purpose Daemon (SMPD)
The SMPD service is part of the MPI (Message Passing Interface) Library process management system utility used for running simulations. SMPD is an application that runs in the background of each computer. Your local machine will send a request to the SMPD on the remote computer, asking it to start the simulation on that remote computer.
Microsoft MPI
- The Microsoft MPI version of SMPD does not start automatically when the computer starts. This is why Microsoft MPI is not recommended for remote job launching.
-
Log into each computer used to run the simulation and run SMPD in debug mode.
Open a command prompt and execute:
"C:\Program Files\Microsoft MPI\Bin\smpd.exe" -debug
Intel MPI
- This version of SMPD also starts automatically when the computer starts.
- Register your user credentials from the local machine/localhost with Intel MPI.
Examples
Microsoft MPI
- 32 mpi processes with the -resume argument with checkpointing in FDTD.
"C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -n 32 "C:\Program Files\Lumerical\v261\bin\fdtd-engine-msmpi.exe" -t 1 -resume "\path\simulationfile.fsp"- 12 mpi processes
"C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -n 12 "C:\Program Files\Lumerical\v261\bin\fdtd-engine-msmpi.exe" -t 1 "C:\temp\simulation.fsp"- 8 mpi processes with job priority = 1
"C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -n 8 -priority 1 "C:\Program Files\Lumerical\v261\bin\fdtd-engine-msmpi.exe" "C:\temp\example.fsp"Intel MPI
- 4 mpi processes on the "localhost"
"C:\Program Files (x86)\IntelSWToolsMPI\mpi\2018.4.274\intel64\bin\mpiexec.exe" -n 4 "C:\Program Files\Lumerical\v261\bin\fdtd-engine-impi.exe" -t 1 "C:\temp\simulationfile.fsp"- distributed across 2 computers with 8 mpi processes each
"C:\Program Files (x86)\IntelSWToolsMPI\mpi\2018.4.274\intel64\bin\mpiexec.exe" -n 16 -hosts 2 node1 node2 "C:\Program Files\Lumerical\v261\bin\fdtd-engine-impi.exe" -t 1 "C:\temp\simulation.fsp"CPi - MPI test program
- This test application allows users to ensure that MPI is properly configured, without the additional complication of running any Lumerical solver.
- For example, this avoids any potential problems with product licensing, since both MPI and CPI are not licensed features.
Example
Run CPi using 4 processes on the local computer with the Microsoft MPI:
"C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -n 4 "C:\Program Files\Lumerical\[[verpath]]\mpitest\cpi-msmpi.exe"The output of the CPI test should look something like this:
Process 2 on localhost
Process 1 on localhost
Process 3 on localhost
Process 0 on localhost
pi is approximately 3.1416009869231249, Error is 0.0000083333333318
wall clock time = 0.000049Stopping your simulation (Quit and Save)
To stop your simulation job, similar to Quit and save in the CAD, you can use the keyboard keys CTRL+C.
Pipe standard output to a text file
The standard output does not appear in the Command Prompt window. To see the report, you can simply pipe the output to a text file using the piping command ">".
For example, to output the engine version number or memory usage report to a file, use the following syntax.
"C:\Program Files\Lumerical\v261\bin\fdtd-engine.exe" -v > "C:\temp\engine_version.txt"
"C:\Program Files\Lumerical\v261\bin\fdtd-engine.exe" -mr "C:\temp\example.fsp" > "C:\temp\mem_reg.txt"See also