|
[Sponsors] |
[snappyHexMesh] multiple instances of SnappyHexMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 3, 2012, 15:33 |
multiple instances of SnappyHexMesh
|
#1 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
I'm firing up four cases one after another and want to let them run on the same machine. Seems SHM only allows two instances to run at the same time and kills the other processes.
__________________
Mihai Pruna's Bio |
|
April 3, 2012, 15:44 |
|
#2 |
Senior Member
|
Use a script, have a look at any runScript within any of the OF tutorials.
|
|
April 3, 2012, 21:27 |
|
#3 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
you mean like this one...or is there something simpler?
#!/bin/sh #------------------------------------------------------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. # # OpenFOAM is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # # Script # Allrun # # Description # #------------------------------------------------------------------------------ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # logReport <logfile> # Extracts useful info from log file. logReport() { caseName=`dirname $1 | sed s/"\(.*\)\.\/"/""/g` app=`echo $1 | sed s/"\(.*\)\."/""/g` appAndCase="Application $app - case $caseName" fatalError=`grep "FOAM FATAL" $1` UxSS=`grep -E "Ux[:| ]*solution singularity" $1` UySS=`grep -E "Uy[:| ]*solution singularity" $1` UzSS=`grep -E "Uz[:| ]*solution singularity" $1` completed=`grep -E "^[\t ]*[eE]nd" $1` if [ "$fatalError" ] then echo "$appAndCase: ** FOAM FATAL ERROR **" elif [ "$UxSS" -a "$UySS" -a "$UzSS" ] then echo "$appAndCase: ** Solution singularity **" elif [ "$completed" ] then completionTime=`tail -10 $log | grep Execution | cut -d= -f2 | sed 's/^[ \t]*//'` if [ "$completionTime" ] then completionTime="in $completionTime" fi echo "$appAndCase: completed $completionTime" else echo "$appAndCase: unconfirmed completion" fi } # Recursively run all tutorials foamRunTutorials cases # Analyse all log files rm testLoopReport > /dev/null 2>&1 & touch testLoopReport for appDir in * do ( [ -d $appDir ] && cd $appDir || exit for log in `find . -name "log.*" | xargs ls -rt` do logReport $log >> ../testLoopReport done echo "" >> ../testLoopReport ) done find . -name "log.*" -exec cat {} \; >> logs # ----------------------------------------------------------------- end-of-file
__________________
Mihai Pruna's Bio |
|
April 4, 2012, 06:06 |
|
#4 |
Senior Member
|
Nope, I would say something much easier like:
Code:
#!/bin/sh cd path_to_first_case snappyHexMesh cd path_to_second_case snappyHexMesh cd path_to_third_case snappyHexMesh |
|
April 4, 2012, 10:21 |
|
#5 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
that is kind of what I am doing. only two instances can run. if more are open it starts killing the previous processes.
__________________
Mihai Pruna's Bio |
|
April 4, 2012, 10:27 |
|
#6 |
Senior Member
|
If you use a script like the one I posted every instance will start after the previous one has ended.
|
|
April 4, 2012, 22:41 |
|
#7 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
i see...
do you k now if the solvers,rather than the meshers, for multiple cases can run simultaneously?
__________________
Mihai Pruna's Bio |
|
April 5, 2012, 05:20 |
|
#8 |
Senior Member
|
Don't know, sorry…
|
|
April 5, 2012, 09:21 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to both of you!
@Mihai: if the 4 cases have independent folders and if you have enough RAM available, then the snappyHexMesh processes should not affect each other during serial execution! Knowing the machine specifications you are using and the mesh resolutions you are using as well, it's possible to infer what the actual problem is. For example: a simple cube-like hexahedral mesh generated with blockMesh to have 1 million cells, will need about 1GB of RAM. When running snappyHexMesh on top of this base mesh, with level 1 of additional resolution, you'll need at a maximum of (2^1)^3 times the mesh resolution, namely 8 million cells -> 8GB RAM. If using level 2 -> 4^3 -> 64 million cells! Of course these values are only the maximum resolution, if and only if we used a resolution increase all over the mesh. When using localized resolution increments, the cell count will not increase this much. If you are using mesh resolutions similar in all 4 cases, then after one of them is complete, run checkMesh. It will tell you the cell count and any issues that the mesh might have. Best regards, Bruno
__________________
|
|
April 5, 2012, 11:07 |
|
#10 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
by serial you mean one starting after the previous ended?
__________________
Mihai Pruna's Bio |
|
April 5, 2012, 12:49 |
|
#11 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Mihai,
Let me quote from wikipedia Quote:
Code:
#!/bin/sh cd path_to_first_case snappyHexMesh & cd path_to_second_case snappyHexMesh & cd path_to_third_case snappyHexMesh & For launching snappyHexMesh in a parallel meshing job, you can see the following tutorials on 2.1.x:
Now, as for the last detail: Can two or more simultaneous parallel runs interfere with one another? The answer should be No, but I've seen some rare cases where the communications seemed to have gotten crossed over each other... but this should lead to simultaneous destruction, simply because both cases would get corrupted. This shouldn't happen, but either a bug in the MPI toolbox or some other issue could cause this. But technically - aside from a possible bug and network issues - the only reason for two distinct parallel jobs to interfere with each other would be insufficient RAM for both to run... or a communication timeout, in a situation where one case is getting all of the CPU time, making the other one too late to answer a call... Best regards, Bruno
__________________
|
||
April 6, 2012, 09:57 |
|
#12 |
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 195
Rep Power: 16 |
__________________
Mihai Pruna's Bio |
|
April 6, 2012, 15:59 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Mihai,
OK, here is a test case that needs about 1.5GB of RAM when running 4 separate cases and takes about 280s (on AMD 1055T 64bit x6 cores ) for each snappyHexMesh:
Bruno
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[snappyHexMesh] Creating multiple unconnected solid elements with snappyHexMesh | Goddi | OpenFOAM Meshing & Mesh Conversion | 1 | May 12, 2019 10:12 |
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! | divergence | OpenFOAM Meshing & Mesh Conversion | 0 | January 23, 2019 05:17 |
multiple .stl in snappyHexMesh | jki | OpenFOAM Pre-Processing | 1 | August 2, 2014 14:07 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |