]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Added LIBBATCH_NODEFILE generation for LoadLeveler
authorbarate <barate>
Tue, 30 Nov 2010 13:37:25 +0000 (13:37 +0000)
committerbarate <barate>
Tue, 30 Nov 2010 13:37:25 +0000 (13:37 +0000)
src/LoadLeveler/Batch_BatchManager_eLL.cxx

index 66282284fceced3a9deea57027c922fb7c0dfac2..fc84e50da5f2b4b1bbdee5b97371e619df0f0eca 100644 (file)
@@ -144,7 +144,7 @@ namespace Batch {
     ofstream tempOutputFile;
     string tmpFileName = createAndOpenTemporaryFile("LL-script", tempOutputFile);
 
-    tempOutputFile << "# @ executable = " << fileNameToExecute << endl;
+    tempOutputFile << "#!/bin/bash" << endl;
     tempOutputFile << "# @ output = " << workDir << "/logs/output.log." << rootNameToExecute << endl;
     tempOutputFile << "# @ error = " << workDir << "/logs/error.log." << rootNameToExecute << endl;
     if (queue != "")
@@ -164,6 +164,17 @@ namespace Batch {
     tempOutputFile << "# @ job_type = bluegene" << endl;
     tempOutputFile << "# @ queue" << endl;
 
+    // generate nodes file
+    tempOutputFile << "NODEFILE=`mktemp nodefile-XXXXXXXXXX` || exit 1" << endl;
+    tempOutputFile << "for node in $LOADL_PROCESSOR_LIST; do" << endl;
+    tempOutputFile << "  echo $node >> $NODEFILE" << endl;
+    tempOutputFile << "done" << endl;
+    tempOutputFile << "export LIBBATCH_NODEFILE=$NODEFILE" << endl;
+
+    // Launch the executable
+    tempOutputFile << "cd " << workDir << endl;
+    tempOutputFile << "./" + fileNameToExecute << endl;
+
     tempOutputFile.flush();
     tempOutputFile.close();