Theory
A parallel run splits the mesh into subdomains (decomposePar, scotch method) and runs one solver process per subdomain under MPI; neighbouring subdomains exchange their boundary values every iteration (OpenFOAM user guide, 2026). With too few cells per subdomain the exchange dominates and more cores no longer help.
Auto, equation (1): the physical cores minus one (when there are more than two), and no more than one core per 15,000 cells; very small meshes run serially. Hyper-threads are not counted: two threads of one core share its arithmetic units. The count is chosen from the mesh after meshing and written to logs/cores.txt; a continued run keeps the decomposition it was started with.
Meshing is serial with auto. A typed number above 1 also meshes in parallel when this machine's environment check found parallel the mesher to work and the case has no perforated walls or packings; perforated walls and packings always mesh serially (createPatch and topoSet are serial). The solver is parallel whenever .
Equations
| where | meaning | unit |
|---|---|---|
| Cores chosen on auto | - | |
| Cells of the finished mesh | - | |
| Physical cores of the computer (Windows API, not hyper-threads) | - |
Default and rule
- Default
- 0 (auto)Computed by the programMeasured
- Rule
0 = auto.
- Source
Measured on a 4-core / 8-thread laptop, seconds per iteration: 184k cells, 1 core 0.909, 2 cores 0.572, 3 cores 0.516, 4 cores 0.481, 7 processes (one per hyper-thread but one) 0.457; 46k cells, 1 core 0.102, 2 cores 0.065, 3 cores 0.057. Auto therefore picks 3 here: 1.8 times faster than serial with the computer still usable; 7 processes gained only 4 % over 4 cores. Parallel results agree with serial ones (a perforated-plate case gave the same result on 2 cores as serially).
Valid range 0 = auto, or a whole number ≥ 1
Values
0 (auto) or a whole number ≥ 1. More cores than physical cores gains almost nothing.
Parallel meshing
Parallel the mesher crashed on thin, elongated shapes in the verification cases; auto always meshes serially.