Limit the number of threads used for simulation

A thread is a single flow of operations within a program. Programs use multiple threads concurrently to speed up the time to solution.

It is strongly advised not to set these variables as the solver automatically determines the most efficient number of threads to use, based on the CPU usage.

In Windows

To limit the number of threads, set one of the following as an Environmental Variable.

VariableAction
MF_OMP_NUM_THREADSSets the number of threads an analysis will use. This variable overwrites any string settings in the User Interface.

For example:

MF_OMP_NUM_THREADS=2

Runs the analysis with two threads.

OMP_THREAD_LIMITLimits the absolute maximum number of threads available to an analysis.

For example:

OMP_THREAD_LIMIT=4

Up to four threads will be used.

MS_DISABLE_SOLVER_PARALLELIZATIONDisables parallelization regardless of UI settings or other Environmental Variables.
Note: An Environmental Variable will stay in force until manually removed. Failure to remove these variables will impact on future performance.

In Linux

Add the variable in front of the runstudy command.

For example:

declare -x MF_OMP_NUM_THREADS=4; runstudy <studyName.sdy>

Four threads will be used to run the analysis.