CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [cfMesh] The proper way to run cfMesh in parallel (https://www.cfd-online.com/Forums/openfoam-community-contributions/203442-proper-way-run-cfmesh-parallel.html)

kandelabr June 27, 2018 13:02

The proper way to run cfMesh in parallel
 
I can't find an example/tutorial where cfMesh is used and run in parallel.
If I am not mistaken, cfMesh should be run as simply as

Code:

preparePar
cartesianMesh

where preparePar takes number of processors from system/decomposeParDict.

My problem is that on the TCFD's OF4Win package that's a cygwin version simply ignores everything and only runs on a single core.

Do I have something misconfigured or am I missing something?

Thanks!

Carlo_P August 5, 2019 06:14

Hey,
I had also the same problem.
I solved it runnig


preparePar
mpirun -n numberprocessor cartesianMesh -parallel


This worked for me.


Cheers,
Carlo

kandelabr August 5, 2019 06:19

Thank you for reply. When I switched to Ubuntu on WSL, it seems to work fine.
I simply do

preparePar
cartesianMesh

And it runs with the right number of processors, as defined in decomposePar.

NYTRYN June 20, 2023 04:06

Although this thread is old, I think it requires some correction and clarification!

In cfMesh - as shipped with OpenFOAM v1712 and newer (www.openfoam.com) -, AFAIK, it makes sense to differentiate between the different available approaches, i.e. tetMesh, pMesh and cartesianMesh because to my knowledge they have different parallelsiation capabilities. With the latter (hex-dominant) generally being the most robust, fast and efficient in my experience, I am going to only refer to this one here:
  • cfMesh parallelises by default across all available CPU using shared memory. A capacity check using lscpu can show you directly what is available on your machine. You can however limit the number of used CPU by setting the environment variable OMP_NUM_THREADS to the number of CPU you like which can be useful for various reasons. On multi-core CPU you can get an indication of the number of cores being used by monitoring the process in top (CPU usage will exceed 100 %) or a graphical system performance monitor.
  • If you further need to parallelise across different nodes or PC, you can decompose the case using preparePar (cfMesh utility) and use MPI for parallelsation. Locally, cfMesh then again applies automatic parallelisation on top of the MPI thingie. Hence you can create huge meshes on "distributed" memory/CPU. Great opportunity, e.g., if your single PC runs out of memory (you'll notice when the job is being killed during mesh generation without mentioning any useful FOAM WARNING/FATAL ERROR).

I hope I did not forget anything important or mess something up. The above descriptions work fine for me....


All times are GMT -4. The time now is 20:39.