View Issue Details

IDProjectCategoryView StatusLast Update
0000975OpenFOAMBugpublic2013-08-26 11:52
Reporteruser743Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSGentoo LinuxOS Version3.7.9-gentoo
Summary0000975: Allrun script for turbineSiting example fails to completely populate parallel processing directories
DescriptionRunning the Allrun script results in error messages and incomplete execution.
Steps To Reproduce~/OpenFOAM/turbineSiting $ ./Allrun
Running blockMesh on /home/user/OpenFOAM/turbineSiting
Running decomposePar on /home/user/OpenFOAM/turbineSiting
Running snappyHexMesh in parallel on /home/user/OpenFOAM/turbineSiting using 4 processes
cp: target './processor0/0/' is not a directory
cp: target './processor1/0/' is not a directory
cp: target './processor2/0/' is not a directory
cp: target './processor3/0/' is not a directory
Running topoSet in parallel on /home/user/OpenFOAM/turbineSiting using 4 processes
Running simpleFoam in parallel on /home/user/OpenFOAM/turbineSiting using 4 processes
Running reconstructParMesh on /home/user/OpenFOAM/turbineSiting
Running reconstructPar on /home/user/OpenFOAM/turbineSiting
Additional InformationWhen the script finishes, there are no '0' subdirectories in the processor{1-4} directories.

Line 19 in the Allrun script:

ls -d processor* | xargs -i cp -r 0.org/* ./{}/0/ $1

contains an error. The cp command does not automatically create target directories if they do not exist. The correct way to do this is with a combined mkdir and cp command:

ls -d processor* | xargs -I% sh -c 'mkdir ./%/0/ && cp -r 0.org/* ./%/0/'

TagsNo tags attached.

Activities

user743

2013-08-25 14:59

 

Allrun.patch (356 bytes)   
--- Allrun	2013-08-25 15:46:33.437125019 +0200
+++ Allrun.fixed	2013-08-25 15:52:12.690406004 +0200
@@ -16,7 +16,7 @@
 
 find . -type f -iname "*level*" -exec rm {} \;
 
-ls -d processor* | xargs -i cp -r 0.org/* ./{}/0/ $1
+ls -d processor* | xargs -I% sh -c 'mkdir ./%/0/ && cp -r 0.org/* ./%/0/'
 
 runParallel topoSet 4
 runParallel `getApplication` 4
Allrun.patch (356 bytes)   

wyldckat

2013-08-25 19:23

updater   ~0002439

@rhombus: Nice catch!

Took me a while to figure out why this is needed now. Then I remembered about the commit 7441c735284044b3e7b45c962422b7f228a5517e: https://github.com/OpenFOAM/OpenFOAM-2.2.x/commit/7441c735284044b3e7b45c962422b7f228a5517e

Since the "*level*" files are no longer written by default, then they do not need to be erased either.

In addition rhombus' suggestion:
 1. Remove the line that removes "*level*" files.
 2. The "$1" is a hazard waiting to happen at the end of the "cp" command, unless it's a convenient trick.
 3. Remove "/*" from "0.org/*" and from "0/" remove the "/", in the "cp" command line, therefore no longer needing "mkdir". This is what is done in the "Allrun" script for the tutorial "incompressible/simpleFoam/motorBike".


Although, if you run this command:
  find $FOAM_TUTORIALS -name "Allrun" | xargs grep 0.org

you'll see a few similar situations occurring.

More specifically, the tutorial "incompressible/pisoFoam/les/motorBike/motorBike" suffers from the same symptom reported by rhombus.

henry

2013-08-26 11:52

manager   ~0002441

Resolved by commit 2e2ab8ec890abfa24d2b4fb5c9a726a5c0fb17a6

Issue History

Date Modified Username Field Change
2013-08-25 14:59 user743 New Issue
2013-08-25 14:59 user743 File Added: Allrun.patch
2013-08-25 19:23 wyldckat Note Added: 0002439
2013-08-26 11:52 henry Note Added: 0002441
2013-08-26 11:52 henry Status new => resolved
2013-08-26 11:52 henry Resolution open => fixed
2013-08-26 11:52 henry Assigned To => henry