Salome HOME
Major refactoring in classes Versatile, Parametre and Swig wrappings.
[tools/libbatch.git] / src / Slurm / Batch_BatchManager_eSlurm.cxx
index c6bcbc8f486203a543baddcb0db70c6de347f50f..e677509a17cbb82551bd1617ea3695191eb59a06 100644 (file)
@@ -150,10 +150,14 @@ namespace Batch {
     int nbproc = 1;
     if (params.find(NBPROC) != params.end())
       nbproc = params[NBPROC];
+    tempOutputFile << "#SBATCH --ntasks=" << nbproc << endl;
 
-    int nodes_requested = (nbproc + _nb_proc_per_node -1) / _nb_proc_per_node;
-    tempOutputFile << "#SBATCH --nodes=" << nodes_requested << endl;
-    tempOutputFile << "#SBATCH --ntasks-per-node=" << _nb_proc_per_node << endl;
+    if (params.find(EXCLUSIVE) != params.end()) {
+      if (params[EXCLUSIVE])
+        tempOutputFile << "#SBATCH --exclusive" << endl;
+      else
+        tempOutputFile << "#SBATCH --share" << endl;
+    }
 
     if (params.find(MAXWALLTIME) != params.end())
       tempOutputFile << "#SBATCH --time=" << params[MAXWALLTIME] << endl;
@@ -177,6 +181,9 @@ namespace Batch {
     tempOutputFile << "cd " << workDir << endl;
     tempOutputFile << "./" + fileNameToExecute << endl;
 
+    // Remove the node file
+    tempOutputFile << "rm $LIBBATCH_NODEFILE" << endl;
+
     tempOutputFile.flush();
     tempOutputFile.close();