GeoHECRAS leverages parallel computing to accelerate 2D unsteady flow simulations. It automatically manages CPU affinity (which cores are used during computation) to optimize performance without manual configuration.
This article describes how GeoHECRAS manages parallel processing and CPU affinity to improve performance.
What is Parallelization?
Parallelization is the process of dividing complex tasks, like a 2D flow simulation, into smaller tasks that run at the same time across multiple CPU cores. This enables simulations to complete much faster than running everything on a single core.
In GeoHECRAS, parallelization allows the software to assign computational work to multiple CPU threads, significantly improving the efficiency and speed of model execution.
CPU Cores vs. Logical Processors
CPU cores are the physical processing units within a computer’s processor. Logical processors are virtual execution paths created by technologies like Intel’s Hyper-Threading (HT) or AMD’s Simultaneous Multithreading (SMT), which permit one physical core to handle multiple tasks.
While hyper-threading can improve performance in some applications, it may actually reduce performance for CPU-intensive tasks, such as running large hydraulic simulations. This happens due to resource sharing and extra overhead when managing multiple threads on the same physical core.
To avoid these issues, our software automatically detects and manages hyper-threading, ensuring simulations run primarily on physical cores for best performance.
What is CPU Affinity?
CPU affinity determines which specific CPU cores a process is allowed to use during computation. If CPU affinity is not configured properly, the operating system may assign simulation threads to slower or less efficient cores (such as E-cores or logical threads), resulting in reduced performance.
The following are the advantages of CPU Affinity:
- Performance Optimization
Reduces context switching, improves cache usage, and lowers memory latency.
- Stability and Predictability
Assigning critical processes to dedicated cores ensures more consistent performance.
- Resource Management
Allow better control of CPU resources, especially in virtualized environments where managing the performance of multiple virtual machines is essential.
GeoHECRAS automatically manages CPU affinity in the background. It detects the system’s processor configuration and intelligently selects the optimal number of solver cores, ensuring that simulations run on the faster performance cores while avoiding slower or less efficient cores. This means users do not need to configure anything manually.
Performance Cores vs. Efficiency Cores
Modern CPUs often use a hybrid design with two types of cores, i.e., Performance cores (P-cores) and Efficiency cores (E-cores).
- Performance cores (P-cores): High clock speed, more memory, best for computationally intensive tasks.
- Efficiency cores (E-cores): Lower power usage, designed for background or lighter tasks.
Operating systems like Windows 11 automatically balance workloads between P-cores and E-cores. Our software takes this into account by prioritizing P-cores for 2D simulations, ensuring faster and more efficient runs.
Setting the 2D Unsteady Flow Solver Cores
Although GeoHECRAS manages CPU affinity automatically, users can manually adjust the number of cores used for 2D computations. This can be done using the Solver Cores dropdown combo box from the 2D Flow Options panel within the Unsteady Flow Computational Options dialog box. By default, the software selects All Available Cores for computation. Refer to this article in our knowledge base to learn more about the Unsteady Flow Computational Options command.
When a simulation runs, the analysis window displays which cores are selected and how many cores are assigned for each 2D computation. As shown in the image below, the number of solver cores is limited to 4 cores per 2D computation.
Performance Considerations
Selecting “All Available” solver cores does not always produce the fastest simulations. Performance depends on model size and the overhead of distributing tasks.
- Small models: Using 2–4 cores is usually optimal. Assigning too many cores can reduce performance.
- Medium models: Performance improves as more solver cores are used.
- Large models: Benefit the most from higher core counts.
Therefore, users should optimize model runs by running a variety of scenarios with different solver cores selected.
Example Test: On a system with 8 logical processors:
- Small models ran fastest with 2–4 cores.
- Assigning more cores slowed performance due to overhead.
- Only larger models showed consistent speed gains with higher core counts.
