Multiple CPU Simulations

Multiple CPU Simulations is a general term for any simulation that is configured to utilize multiple CPU cores in parallel. This option can be enabled, and configured, through the General Settings tab of the Simulation Settings window, under the Simulation Runtime option group (Figure 1, below).

By default, the use of multiple cores is disabled in @RISK 8.

When a simulation is configured to use multiple CPU's, @RISK will launch an instance of Excel, with @RISK loaded, in the background for each core enabled in General Settings.

The Multiple CPU Simulations option (Figure 1, below) has three settings:

  • Disabled - Multiple CPUs will never be utilized. This is the default setting.
  • Automatic - @RISK will detect when Multiple CPUs would benefit a simulation and enable the option as needed; @RISK makes this determination by calculating the time required for each iteration of the model, and then deciding if multiple cores would have an impact on the total runtime. General activity on the machine running @RISK can have an effect on this determination.
  • Enabled - Multiple CPUs will always be used.

Figure 1 - Multiple CPU Settings

When the option is set to 'Automatic' or 'Enabled', the additional option '# CPUs' will appear to select the number of cores @RISK will be allowed to utilize. This can be set to a value less than the total number of cores available on the machine to protect overall system performance.

Additional consideration should be given to running simulations with Multiple CPUs enabled. While it would appear, logically, that utilizing multiple cores to run simulations in parallel would always save time. However, the size and complexity of a model can often result in long startup and shutdown times at the beginning and end of a multiple CPU simulation, resulting in a runtime that is longer overall.

During Simulations

When a simulation run is executed with Multiple CPUs enabled, the Simulation Progress window will open with the CPU monitor enabled; see Simulation Progress Window for more information.

Multiple CPU Simulation Limitations

During a multiple CPU simulation, the “master” copy of Excel breaks the simulation into many pieces that are sent off to one or more background “worker” copies of Excel. All the copies of Excel are then simultaneously calculating a portion of the iterations of the simulation, which are sent back to and integrated together by the master Excel.

Because of this design, there are limitations to the types of models that will work properly using multiple CPUs:

  • Any model where an iterations looks a previous iteration’s result in order to calculate itself may fail. (The previous iteration may or may not be available on the copy of Excel in question.)
  • Any model that looks at the current simulation statistics to determine the results of the next iteration may fail. (Those simulation statistics will not be available on the worker copies of Excel.)
  • Any model using a before simulation macro that must be run before any iterations can be performed will usually not work properly. (The before simulation macro is only run on one copy.)
  • Any model using a macro that uses a shared resource (file, database, etc.) may fail. (The code will be making simultaneous call to the same resource, leading to a contention problem.)
  • Models that use @RISK XDK calls each iteration will fail. (The XDK is only available on the master copy of Excel.)

In addition, some users may experience difficulties when running multiple CPUs simulations because Excel has been configured in such a way to prevent background copies of Excel from being used.