CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Run multiple cases simultaneously in parallel? (https://www.cfd-online.com/Forums/openfoam-pre-processing/226088-run-multiple-cases-simultaneously-parallel.html)

joshmccraney April 16, 2020 22:14

Run multiple cases simultaneously in parallel?
 
Hi FOAMers!

I have 16 cores available, and would like to run 4 different cases simultaneously, each on 4 cores. Is this possible? Is it as simple as simply running
Code:

mpirun -np 4 interFoam -parallel
or do I need to tell the system which 4 to use so that it's using all 16?

mzzmrt April 17, 2020 05:31

I guess you can. Just open four terminals run each case simultaneously.



Of course you have to partition the grids first for parallel processing.

joshmccraney April 17, 2020 18:50

Quote:

Originally Posted by mzzmrt (Post 766089)
I guess you can. Just open four terminals run each case simultaneously.



Of course you have to partition the grids first for parallel processing.

So the computer is just smart enough to know not to reuse old cores?

mzzmrt April 18, 2020 04:26

I made a test and understood that my guess is wrong!

mzzmrt April 19, 2020 18:13

Well, just found the solution. An additional command "cpu-set" is needed:


mpirun -np 2 --cpu-set 0-3 pisoFoam -parallel (for assigning fist four cores)

mpirun -np 2 --cpu-set 4-7 pisoFoam -parallel (for assigning second four cores)
so on...

lebc April 20, 2020 12:13

You can also use the "--bind-to socket" or "--bind-to core" option, it works fine!


All times are GMT -4. The time now is 08:22.