Home → Troubleshooting → @RISK for Excel: Simulation → Multiple CPU — Blocks of Errors in Simulated Outputs
Applies to: @RISK, all releases
When I disable Multiple CPU, my simulation runs just fine. But when I enable Multiple CPU, the Simulation data window shows blocks of error values in my outputs. For example, I might have numbers for iterations 1–100 and 201–300, but "Error" for iterations 101–200 and 301–400.
There are a few inherent limitations to running multiple CPUs. These come about because a "worker" CPU doesn't have access to the data developed by any other CPU; only the "master" does. During simulation, each worker has a private copy of your workbook. The master tells each worker which iterations to run; the worker runs those iterations and passes the values of @RISK inputs and outputs back to the master. At the end of the simulation, the workers' private copies of the worksheet are destroyed.
If this is your issue, the simplest solution is to go into Simulation Settings and select Multiple CPU: Disabled. If that makes the simulation take too long to run, you're going to have to make some changes in your workbook:
If your simulation uses any data from other iterations, or any statistic functions, that information will not be available during simulation, and the iterations done by the worker CPUs will show errors. If the problem is statistic functions that reference @RISK distributions, an easy fix is using the "Theo" functions, which reference the theoretical distributions rather than simulation results: change RiskMean to RiskTheoMean, RiskPtoX to RiskTheoPtoX, and so on. But that's not possible with statistics of @RISK outputs; in that case you must change the logic of your workbook.
If you have a macro that stores values in a workbook, and other macro code or worksheet formulas use that stored information in a later iteration, it will not be available to the other CPUs. After the end of the simulation, anything that your macro code wrote to the workbook during iterations run by the master CPU will be in the workbook, but nothing your macro code wrote to the workbook on the worker CPUs will be preserved. If you change your macro to write to an external file, you have to account for contention between multiple copies of the macro trying to write to the same file at the same time. This can be done, but the programming is not trivial.
The RISK object model (XDK) is not available on the worker CPUs. If you need to run @RISK automation code (XDK) during a simulation, your only option is to select Multiple CPU: Disabled.
Last edited: 2017-02-07