|
[Sponsors] |
[cfMesh] cfmesh and OMP_NUM_THREADS weirdness |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 3, 2015, 07:01 |
cfmesh and OMP_NUM_THREADS weirdness
|
#1 |
Senior Member
Charles
Join Date: Apr 2009
Posts: 185
Rep Power: 18 |
I've been using cfmesh to build a mesh for the Drag Prediction Workshop model. It's a reasonably large model, around 27 million cells, and I thought that it would make a handy SMP benchmarking test case, given how nicely it runs in parallel with OpenMP. The workstation I use for this is a dual socket Xeon, with 6 cores per socket, and hyper-theading turned on, therefore the default number of threads is 24. And it creates the mesh very satisfactorily indeed.
However, to get a feel for the parallel scaling, I tried it with a smaller number of threads, by setting the environment variable OMP_NUM_THREADS. Now this is where it starts to get a bit strange. 24 threads, OK. 23 threads OK. 22 threads OK. 21 threads OK. Anything smaller than 21, it get stuck on the "Refining boundary boxes to the given size" phase, and then segfaults. Has anybody else seen anything like this? |
|
September 3, 2015, 18:00 |
|
#2 |
Senior Member
|
What operating system are you running on? How much memory have you got, and what percentage of memory is used for meshing?
I have noticed that changing the value of OMP_NUM_THREADS often can cause strange behaviour and crashes from time to time. So far, I could not figure the pattern when that happens. Can you please try to compile cfMesh in debug mode and let me know if you notice any problems that occur when you start changing the value of OMP_NUM_THREADS? Regards, Franjo
__________________
Principal Developer of cfMesh and CF-MESH+ www.cfmesh.com Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram |
|
September 4, 2015, 06:30 |
|
#3 |
Senior Member
Charles
Join Date: Apr 2009
Posts: 185
Rep Power: 18 |
Hi Franjo, the O/S is Fedora 19, the system has 128 GB of DDR 1333/ECC. Cfmesh is compiled with an OpenFOAM-2.4.0 environment. When it meshes successfully (with 24 threads), the memory usage seems to stay quite low, around 12 GB or so. When I set the number of threads lower (say 12), it dies quite quickly, while on the " Refining boundary boxes to the given size" step. But it spikes to a higher memory usage, top reports VIRT around 13 GB and RES around 8 GB. I will try to compile it in debug mode and report what I find.
On a different topic, I would like to take the mesh into SU2, which means converting to either CGNS or SU2 format. Any advice on the best way to do that? Charles |
|
September 4, 2015, 07:30 |
|
#4 |
Senior Member
|
Thanks, please let me know if your notice anything strange.
Regarding the SU2, the code uses only a few standard cell types. You can meet those requirements with tetMesh. cartesianMesh is also an option when you use decomposePolyhedraIntoTetsAndPyrs setting in meshDict. Once you are sure that your meshes can be converted, writing a converter itself shall not be a problem. Feel free to contact me if you need assistance with it. Regards, Franjo
__________________
Principal Developer of cfMesh and CF-MESH+ www.cfmesh.com Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram |
|
December 16, 2015, 05:21 |
How to set OMP_NUM_THREADS?
|
#5 |
New Member
Join Date: Nov 2015
Location: GER
Posts: 10
Rep Power: 11 |
Hello to all,
allthough this thread seems not to be active I hope someone answers. I would like to know how to set the OMP_NUM_THREADS environment variable. It should be a fix value of processors so it can not cause any problems to other running calculations. I read a article of IBM (https://www-01.ibm.com/support/knowl...1/ruomprun.htm) which explains lot of options to OMP, but don't know if it is possible with cfMesh. Can you help? ThanX! |
|
December 17, 2015, 04:14 |
|
#6 | |
Senior Member
|
Hi,
Quote:
You can set OMP_NUM_THREADS as follows: bash shell: export OMP_NUM_THREADS=<num threads>, <num threads in nested loops> csh shell: setenv OMP_NUM_THREADS <num threads>, <num threads in nested loops> However, some algorithms in cfMesh use more threads than specified above, and it last only for a short period of time. It does not do harm to running jobs unless the system runs out of memory. Regards, Franjo
__________________
Principal Developer of cfMesh and CF-MESH+ www.cfmesh.com Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram |
||
January 11, 2016, 03:30 |
|
#7 | |
New Member
Join Date: Nov 2015
Location: GER
Posts: 10
Rep Power: 11 |
Quote:
somehow it doesn't work anyway. The computer I use has 20 cores and I want it to use f.e. 8 of them for the whole calculation. So I type in my bash script: export OMP_NUM_THREADS=8,8 runApplication ...Mesh ... and execute it. If I look at the system monitor it seems to still use all processors. Viewed with "top" command in terminal it is executed just with one. Regards, cfdFreshman |
||
January 12, 2016, 08:32 |
|
#8 | |
Senior Member
|
Hi,
Quote:
Regards, Franjo
__________________
Principal Developer of cfMesh and CF-MESH+ www.cfmesh.com Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram |
||
Tags |
cfmesh, omp_num_threads, segfault |
|
|