SIMIT As-Fast-As-Possible (AFAP) Multi-Core CPU Utilization and Parallel Batch Simulation

SIMIT As-Fast-As-Possible (AFAP) Multi-Core CPU Utilization and Parallel Batch Simulation

In SIMIT Simulation Framework, low CPU utilization (e.g., 6% on a quad-core workstation) during As Fast As Possible (AFAP) simulation occurs because the SIMIT calculation engine assigns each simulation diagram and time slice to a single execution thread. On a multi-core processor, an uncoupled simulation executes so rapidly on a single core that total system utilization remains low while the operating system throttles thread transitions to maintain desktop responsiveness. To fully utilize multi-core host hardware and evaluate large scenario matrices, engineers execute parallel SIMIT instances simultaneously via the command line or SIMIT Remote Control .NET API, allocating separate simulation projects to independent CPU cores.

Table of Contents

SIMIT Calculation Engine Threading Architecture

The SIMIT calculation kernel executes simulation components cyclically across defined time slices (typically 8 slices: 1 to 8). Each time slice executes synchronously in its own dedicated worker thread. However, within an individual time slice, interconnected components on a single diagram must be computed sequentially to resolve algebraic loops and input-output dependencies.

When running in AFAP mode without hardware couplings, the solver computes each time slice as fast as the single thread allows, then immediately cycles. Because standard modern CPUs feature 4, 8, or 16 logical cores, a single-threaded simulation can never consume more than $\frac{100}{\text{Cores}}\%$ of total CPU capacity (e.g., 25% on a quad-core, or 12.5% on an 8-core CPU).

Why Single AFAP Simulations Do Not Saturate Multi-Core CPUs

The table below details factors influencing CPU reporting during AFAP execution:

Metric / SubsystemMeasured ValueArchitectural ReasonSIMIT Internal Load Meter0%SIMIT load measures the fraction of the allocated real-time time slice used. In AFAP mode, real-time targets are disabled, so internal load reads 0%.Task Manager Total CPU6% – 25%Represents aggregate load across all cores; only one core is executing the simulation thread while others remain idle.Thread Concurrency1 Core ActiveSimulation diagrams with direct signal dependencies cannot be parallelized across cores without introducing data race corruption.OS Thread YieldingSleep / YieldSIMIT includes micro-yields to prevent Windows UI lockups and starvation of background services.

Executing Parallel Simulation Batches via Command Line and API

To fully exploit multi-core CPU architectures for design-of-experiment (DOE) parameter sweeps or multi-scenario verification:

Method 1: Headless Command-Line Multi-Instance Launch

Engineers can launch multiple independent SIMIT simulation instances concurrently using PowerShell or batch scripts:

# Launch 4 concurrent SIMIT simulation instances across separate CPU cores
$simitExe = "C:\Program Files (x86)\Siemens\Automation\SIMIT\SIMIT SF\bin\Simit.exe"
for ($i = 1; $i -le 4; $i++) {
    $project = "C:\Simulations\BatchProject_$i.simit"
    Start-Process -FilePath $simitExe -ArgumentList "-open `"$project`" -start -afap -headless"
}

Method 2: SIMIT Remote Control Interface (.NET API)

Using the SIMIT Remote Control API (COM / .NET), custom C# or Python scripts can programmatically open project clones, assign unique parameter tables, trigger AFAP execution, and extract results to SQL or CSV upon completion.

Verification

To verify effective multi-core parallel simulation execution:

  1. Launch multiple simulation instances using the batch script.
  2. Open Windows Task Manager -> navigate to the Performance tab -> click CPU.
  3. Right-click the CPU graph -> select Change graph to -> Logical processors.
  4. Confirm that all CPU cores (Core 0, Core 1, Core 2, Core 3) exhibit high, balanced utilization (85% to 100%).
  5. Verify that each independent SIMIT instance outputs completed scenario datasets without memory collisions.

Limitations and Operational Precautions

Operational boundaries when executing parallel simulations:

  • Coupling Conflicts: Multiple SIMIT instances cannot connect to the same S7-PLCSIM or Virtual Controller instance simultaneously; parallelization requires independent virtual controllers or standalone models.
  • RAM Allocation: Each active SIMIT instance allocates memory for its own model database and graphic cache. Ensure host workstation RAM is sized appropriately (minimum 4 GB per concurrent instance).
  • Disk I/O Bottlenecks: Writing high-speed historical trend data from multiple AFAP instances simultaneously can saturate SATA hard drives; utilize NVMe SSD storage for parallel logging.

Engineer FAQ

Why does Task Manager show only 6% CPU usage when SIMIT is running AFAP?

A single simulation diagram executes in a single worker thread on one CPU core. On an 8-core or quad-core hyperthreaded CPU, one saturated thread represents only 6% to 12% of total multi-core capacity.

Can SIMIT automatically distribute a single diagram across multiple CPU cores?

No. A single simulation diagram contains sequential signal flow loops that cannot be split across threads without risking non-deterministic calculation race conditions.

Can I run multiple SIMIT projects at the same time on the same PC?

Yes. Multiple SIMIT processes can run concurrently on a single workstation, provided the system has sufficient RAM and licensing.

Why does the SIMIT internal load display 0% during AFAP?

SIMIT internal load measures the percentage of the real-time budget consumed. In AFAP mode, real-time targets are disabled, so internal load is reported as 0%.

Technical References

Related Articles

Related Tags

  • SIMIT
  • AFAP
  • Multi-Core-CPU
  • Parallel-Simulation
  • Remote-Control-API
  • Virtual-Commissioning
8 respuestas