multiple instances of SnappyHexMesh
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.
|
Use a script, have a look at any runScript within any of the OF tutorials.
|
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 |
Nope, I would say something much easier like:
Code:
#!/bin/sh |
that is kind of what I am doing. only two instances can run. if more are open it starts killing the previous processes.
|
If you use a script like the one I posted every instance will start after the previous one has ended.
|
i see...
do you k now if the solvers,rather than the meshers, for multiple cases can run simultaneously? |
Don't know, sorry…
|
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 |
Quote:
|
Hi Mihai,
Let me quote from wikipedia ;) Quote:
Code:
#!/bin/sh 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 |
|
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 :D) for each snappyHexMesh:
Bruno |
All times are GMT -4. The time now is 08:49. |