CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[cfMesh] The proper way to run cfMesh in parallel

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Carlo_P
  • 1 Post By kandelabr
  • 1 Post By NYTRYN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2018, 14:02
Default The proper way to run cfMesh in parallel
  #1
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
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!
kandelabr is offline   Reply With Quote

Old   August 5, 2019, 07:14
Default
  #2
Senior Member
 
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8
Carlo_P is on a distinguished road
Hey,
I had also the same problem.
I solved it runnig


preparePar
mpirun -n numberprocessor cartesianMesh -parallel


This worked for me.


Cheers,
Carlo
pardoa likes this.
Carlo_P is offline   Reply With Quote

Old   August 5, 2019, 07:19
Default
  #3
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
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.
lourencosm likes this.
__________________
www.damogranlabs.com
kandelabr is offline   Reply With Quote

Old   June 20, 2023, 05:06
Default
  #4
New Member
 
NYTRYN's Avatar
 
NYTRYN
Join Date: Nov 2022
Location: Germany
Posts: 1
Rep Power: 0
NYTRYN is on a distinguished road
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....
lourencosm likes this.

Last edited by NYTRYN; June 20, 2023 at 10:10.
NYTRYN is offline   Reply With Quote

Reply

Tags
cfmesh, cygwin, of4win, parallel


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel run: bool ipstream::init attempt to run parallel on 1 processor SarahLee OpenFOAM Running, Solving & CFD 2 January 11, 2017 04:24
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 12:58
Can not run OpenFOAM in parallel in clusters, help! ripperjack OpenFOAM Running, Solving & CFD 5 May 6, 2014 16:25
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel JR22 OpenFOAM Running, Solving & CFD 2 April 19, 2013 17:49
Script to Run Parallel Jobs in Rocks Cluster asaha OpenFOAM Running, Solving & CFD 12 July 4, 2012 23:51


All times are GMT -4. The time now is 05:43.