From ecf998193f2eedd40999aa79f6a7cc81b3479405 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 3 Dec 2010 14:27:30 +0000
Subject: [PATCH] ENH: redistributeMeshPar : allow generic

---
 .../redistributeMeshPar/Make/options                |  1 +
 .../redistributeMeshPar/redistributeMeshPar.C       | 13 +++++--------
 bin/tools/RunFunctions                              |  6 ++++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options
index 05d603887ae..a23979358b7 100644
--- a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options
+++ b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options
@@ -6,6 +6,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lfiniteVolume \
+    -lgenericPatchFields \
     -ldecompositionMethods \
     -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
     -lmeshTools \
diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
index 18ecebece98..b870e9efab8 100644
--- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
+++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
@@ -87,12 +87,6 @@ autoPtr<fvMesh> createMesh
     {
         // Create dummy mesh. Only used on procs that don't have mesh.
 
-        // Switch timeStamp checking to one which does not do any
-        // parallel sync
-        regIOobject::fileCheckTypes oldCheckType =
-            regIOobject::fileModificationChecking;
-        regIOobject::fileModificationChecking = regIOobject::timeStamp;
-
         {
             IOdictionary fvSolution
             (
@@ -146,8 +140,6 @@ autoPtr<fvMesh> createMesh
         Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
             << endl;
         dummyMesh.write();
-
-        regIOobject::fileModificationChecking = oldCheckType;
     }
 
     Pout<< "Reading mesh from " << io.objectPath() << endl;
@@ -569,8 +561,13 @@ int main(int argc, char *argv[])
         mkDir(args.path());
     }
 
+    // Switch timeStamp checking to one which does not do any
+    // parallel sync for same reason
+    regIOobject::fileModificationChecking = regIOobject::timeStamp;
+
 #   include "createTime.H"
 
+
     word regionName = polyMesh::defaultRegion;
     fileName meshSubDir;
 
diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions
index d259693f360..20a9cd080c1 100644
--- a/bin/tools/RunFunctions
+++ b/bin/tools/RunFunctions
@@ -57,8 +57,10 @@ runParallel()
     then
         echo "$APP_RUN already run on $PWD: remove log file to run"
     else
-        echo "Running $APP_RUN in parallel on $PWD using $1 processes"
-        ( mpirun -np $1 $APP_RUN -parallel < /dev/null > log.$APP_RUN 2>&1 )
+        nProcs=$1
+        shift
+        echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
+        ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_RUN 2>&1 )
     fi
 }
 
-- 
GitLab