yy u
yy u

Reputation: 11

how to use openmp in openfoam?

openfoam v2212 can use openmp Improved compilation support for openmp

The use of openmp can now also be globally enabled/disabled by a corresponding entry in the WM_COMPILE_CONTROL variable:

WM_COMPILE_CONTROL="+openmp" # with openmp enabled
WM_COMPILE_CONTROL="~openmp" # with openmp disabled

If both are specified, the ~openmp disabling has priority. For a single use, corresponding wmake options can be used instead:

wmake -openmp # with openmp enabled
wmake -no-openmp # with openmp disabled 

but when i run pisofoam,it's only 1 procs(i use export OMP_NUM_THREADS=4

do i need to modify the source code?

i use WM_COMPILE_CONTROL="+openmp

Upvotes: 1

Views: 52

Answers (1)

Joachim
Joachim

Reputation: 876

There are no traces of OpenMP parallelization in the OpenFOAM source code (grep for pragma omp or omp parallel finds a single test file). Enabling compilation with OpenMP is not a magic switch. You will need to modify the code in order to use OpenMP in OpenFOAM.

The latest version of OpenFOAM is v2412 and even this version has no traces of OpenMP code.

Upvotes: 1

Related Questions