Salome HOME
For "local" jobs, node file is filled with the number of cores required by the user... V2_1_0rc1
authorbarate <barate>
Tue, 5 Nov 2013 13:43:39 +0000 (13:43 +0000)
committerbarate <barate>
Tue, 5 Nov 2013 13:43:39 +0000 (13:43 +0000)
src/Local/BatchManager_Local.cxx

index 6aad9517ea67f153a846ccfe95de5614c9e6bda6..5462347b05c0767ba1c321065b018843503ecd93 100644 (file)
@@ -321,6 +321,11 @@ namespace Batch {
       tempOutputFile << "ulimit -H -v " << maxramsize << endl;
     }
 
+    // Number of cores to use
+    int nbproc = 1;
+    if (param.find(NBPROC) != param.end())
+      nbproc = param[NBPROC];
+
     // Define environment for the job
     Environnement env = job.getEnvironnement();
     for (Environnement::const_iterator iter = env.begin() ; iter != env.end() ; ++iter) {
@@ -329,7 +334,8 @@ namespace Batch {
 
     // generate nodes file
     tempOutputFile << "LIBBATCH_NODEFILE=`mktemp nodefile-XXXXXXXXXX`" << endl;
-    tempOutputFile << "echo `hostname` > $LIBBATCH_NODEFILE" << endl;
+    for (int i=0 ; i<nbproc ; i++)
+      tempOutputFile << "echo `hostname` >> $LIBBATCH_NODEFILE" << endl;
     tempOutputFile << "export LIBBATCH_NODEFILE" << endl;
 
     // Launch the executable