9.5. CPUs Used by @RISK 4.x–6.x

What is the maximum number of CPUs (cores or processors) that @RISK and RISKOptimizer will use? Can I limit the number used by @RISK, thus leaving some CPUs (cores) available for other programs? Is there any other reason to limit the number of CPUs used?

@RISK recognizes as a "CPU" anything that Windows recognizes as a CPU. To find the number of CPUs in your computer, press Ctrl-Shift-Esc to open Task Manager, then select the Performance tab. Real CPUs should make a major improvement in speed of large simulations, but hyperthreaded CPUs will give only modest speed improvement.

@RISK uses a heuristic to guess how long a simulation will take. If @RISK judges that the overhead of starting multiple copies of Excel would outweigh the time saved through parallel processing, it will use only one core even if you have enabled Multiple CPU. For much more about this, please see Multiple CPU — Only One CPU Runs.

With larger simulations,

@RISK Industrial can use all CPUs that exist in your computer. You can enable or disable multiple CPUs on the first tab of the Simulation Settings dialog.

@RISK Standard and @RISK Professional 5.5 and later can use up to two CPUs if present. You can enable or disable multiple CPUs on the first tab of the Simulation Settings dialog. (@RISK Standard and @RISK Professional 5.0 and earlier run all simulations with one CPU.)

Simulations and optimizations with RISKOptimizer use only one CPU. (There is significant overhead to communicating between the master CPU and the workers. In the great majority of optimizations that we have seen, this overhead would eliminate all or nearly all the savings from multiple CPUs.)

Simulations with Project use only one CPU.

Optimum number of CPUs

Up to around four, more CPUs is almost always better. Beyond that, at some point you can actually have too many CPUs. You can reach a point where CPUs are starved for RAM and have to use virtual memory, which means relatively slow disk operations instead of fast operations in real memory. Or if you have a lot of CPUs in a simulation, the overhead can swamp the savings and a simulation can actually take longer. To some extent, determining the optimum number is a matter of experimentation, because it depends on the size of your model, the Memory Used by @RISK Simulations, and the available RAM in your computer.

You can get an idea of an appropriate number of CPUs for this model and the amount of RAM in your computer. Follow the process in Memory Used by @RISK Simulations to determine how much memory your simulation needs. Take the amount of RAM in your computer, subtract what's used by Windows and other programs, and divide by the amount of RAM used in a single-CPU simulation. You don't want to use more CPUs than that, though it might still be more efficient to use fewer.

Limiting the number of CPUs used

You can do this via a System Registry key or by defining a special name in Excel. If you do both, in @RISK 6.2 or 6.3, @RISK will use the workbook name and ignore the Registry key.

Either way, if your Simulation Settings have Multiple CPU set to Disabled, @RISK will use just one CPU.

Registry setting (all releases 4.x–6.x)

If you want to have @RISK Industrial use multiple CPUs, but not all the CPUs in your computer, you can do this by editing the System Registry:

With Excel not running, click Start » Run and enter the command REGEDIT. Click OK.

Navigate to the key HKEY_LOCAL_MACHINE\Software\Palisade, or HKEY_LOCAL_MACHINE\Software\WOW6432Node\Palisade in 64-bit Windows.

In the right-hand panel, right-click and select New » DWORD Value and type the name NumCPUs — note the "s" at the end.

When you enable Multiple CPU in Simulation Settings, @RISK will not use more than the number of CPUs specified in the System Registry. (If you actually have fewer CPUs in your computer, @RISK will just use the ones it finds.)

Workbook setting (@RISK 6.2 and 6.3)

If you can't edit the System Registry or prefer not to, create a name _AtRisk_SimSetting_MaxCoresand set it to the desired maximum.

Notes:

To create the name in Excel 2007 and later, click Formulas » Name Manager » New; in Excel 2003, Insert » Name » Define.

The name begins with an underscore.

The "Refers to" value must be preceded by an = sign, as shown in the illustration.

If you actually have fewer CPUs in your computer, @RISK will just use the ones it finds.

If you set a limit with NumCPUs in the System Registry (above), @RISK will honor a lower number specified in AtRisk_SimSetting_MaxCores, but will ignore a higher number.

If you have several workbooks open, and more than one of them defines this name, @RISK will use the lowest number.

Additional keywords: Number of cores, multiple cores, how many cores, how many CPUs