1

I use openfoam Version 1606+ When I run pisoFoam, in htop (to show CPU Usage) I can see that pisoFoam only uses one core (of course usage 99%). What do I have to modify if I want to use all cores of my CPU?

Best regards

Herpes Free Engineer
  • 2,425
  • 2
  • 27
  • 34
unimetal
  • 41
  • 6

2 Answers2

3

To run pisoFoam parallel, roughly the following steps need to be taken:

  • Decompose the grid and fields via the command decomposePar (assuming you set system/decomposeParDict file appropriately).
  • Execute pisoFoam in parallel mode via this example command: mpirun -np X pisoFoam -parallel >& logFile(SampiyonCanakkaleDardanel), i.e. X is the integer number of processors being used. Say you have 4 cores in your workstation, then X = 4.

Please note that you do not need to modify anything within pisoFoam to perform a parallel task.

Herpes Free Engineer
  • 2,425
  • 2
  • 27
  • 34
1

This is the typical workflow (after you generate your mesh):

  • checkMesh > log.checkMesh.1 2>&1
  • decomposePar > log.decomposePar 2>&1
  • renumberMesh > log.renumberMesh 2>&1
  • checkMesh > log.checkMesh.2 2>&1
  • mpiexec -n 5 pisoFoam -parallel > log.pisoFoam 2>&1
  • reconstructPar

Notes:

  • Tested on v2.4.
  • I used 5 as the number of cores in this example. Replace by the number you want. You may want to test using hyperthreading; it may or may not be useful.
  • Don't forget the -parallel flag.
  • renumberMesh is useful in cases of large meshes.
  • Try to use functionObjects as much as you can, as saving time directories can consume a lot of disk space.
  • See the OpenFOAM tutorials for examples of all that is mentioned above (e.g. pitzDaily, channel395, damBreak, motorBike etc. etc.)
aerodude
  • 13
  • 1
  • 4