View Issue Details

IDProjectCategoryView StatusLast Update
0002632OpenFOAMPatchpublic2017-07-24 08:24
Reportertaherc Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0002632: foamJob is not working correctly when collated file handler is set
DescriptionBy using "-fileHandler collated" flag with decomposePar, a folder named processors is made whereas foamJob looks for processor0 folder to validate a parallel case. Therefore it throws an error that case is not ready for parallel. I attached a simple patch for foamJob file.
TagsNo tags attached.

Activities

taherc

2017-07-23 06:09

reporter  

foamJob.patch (518 bytes)   
diff --git a/bin/foamJob b/bin/foamJob
index 5bfed74c9..e34ba820e 100755
--- a/bin/foamJob
+++ b/bin/foamJob
@@ -175,9 +175,9 @@ then
     #
     # Check if the case decomposed
     #
-    if [ -r "processor0" ]
+    if [[ -r "processor0" || -r "processors" ]]
     then
-        NPROCS="$(/bin/ls -1d processor* | wc -l)"
+        NPROCS="$(foamDictionary -entry numberOfSubdomains -value system/decomposeParDict)"
     else
         echo "Case is not currently decomposed"
         if [ -r system/decomposeParDict ]
foamJob.patch (518 bytes)   

wyldckat

2017-07-24 00:24

updater   ~0008445

Quick note: The more general "/bin/sh" way of doing this is to replace in the patch this line:

   if [[ -r "processor0" || -r "processors" ]]

with this one:

   if [ -r "processor0" -o -r "processors" ]


This is because "/bin/sh" isn't always Bash. For example, on Ubuntu it's Dash, which AFAIK, doesn't support Bash's double square brackets.

henry

2017-07-24 08:24

manager   ~0008448

Resolved by commit 2fb9ffc651d0825d723fc848f5c381368d5d57ef

Issue History

Date Modified Username Field Change
2017-07-23 06:09 taherc New Issue
2017-07-23 06:09 taherc File Added: foamJob.patch
2017-07-24 00:24 wyldckat Note Added: 0008445
2017-07-24 08:24 henry Assigned To => henry
2017-07-24 08:24 henry Status new => resolved
2017-07-24 08:24 henry Resolution open => fixed
2017-07-24 08:24 henry Fixed in Version => dev
2017-07-24 08:24 henry Note Added: 0008448