From 8f7a88a255513d7a767ea69de0216ccd91007c4a Mon Sep 17 00:00:00 2001 From: barate Date: Tue, 30 Nov 2010 13:37:25 +0000 Subject: [PATCH] Added LIBBATCH_NODEFILE generation for LoadLeveler --- src/LoadLeveler/Batch_BatchManager_eLL.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/LoadLeveler/Batch_BatchManager_eLL.cxx b/src/LoadLeveler/Batch_BatchManager_eLL.cxx index 6628228..fc84e50 100644 --- a/src/LoadLeveler/Batch_BatchManager_eLL.cxx +++ b/src/LoadLeveler/Batch_BatchManager_eLL.cxx @@ -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(); -- 2.39.2