From: barate Date: Thu, 29 Jul 2010 12:22:01 +0000 (+0000) Subject: Use a temporary file for the node file in LSF instead of always appending to the... X-Git-Tag: V1_2_0rc1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=983b9637d51178045574789ef0429bb5dd3b40d4;p=tools%2Flibbatch.git Use a temporary file for the node file in LSF instead of always appending to the same file --- diff --git a/src/LSF/Batch_BatchManager_eLSF.cxx b/src/LSF/Batch_BatchManager_eLSF.cxx index fc36f7f..05eb034 100644 --- a/src/LSF/Batch_BatchManager_eLSF.cxx +++ b/src/LSF/Batch_BatchManager_eLSF.cxx @@ -281,6 +281,7 @@ namespace Batch { tempOutputFile << "cd " << workDir << endl ; // generate nodes file + tempOutputFile << "NODEFILE=`mktemp nodefile-XXXXXXXXXX` || exit 1" << endl; tempOutputFile << "bool=0" << endl; tempOutputFile << "for i in $LSB_MCPU_HOSTS; do" << endl; tempOutputFile << " if test $bool = 0; then" << endl; @@ -288,17 +289,21 @@ namespace Batch { tempOutputFile << " bool=1" << endl; tempOutputFile << " else" << endl; tempOutputFile << " for ((j=0;j<$i;j++)); do" << endl; - tempOutputFile << " echo $n >> nodesFile" << endl; + tempOutputFile << " echo $n >> $NODEFILE" << endl; tempOutputFile << " done" << endl; tempOutputFile << " bool=0" << endl; tempOutputFile << " fi" << endl; tempOutputFile << "done" << endl; // Abstraction of PBS_NODEFILE - TODO - tempOutputFile << "export LIBBATCH_NODEFILE=nodesFile" << endl; + tempOutputFile << "export LIBBATCH_NODEFILE=$NODEFILE" << endl; // Launch the executable tempOutputFile << "./" + fileNameToExecute << endl; + + // Remove the node file + tempOutputFile << "rm $NODEFILE" << endl; + tempOutputFile.flush(); tempOutputFile.close(); diff --git a/src/LSF/Batch_FactBatchManager_eLSF.cxx b/src/LSF/Batch_FactBatchManager_eLSF.cxx index 5e1bfd9..03bf379 100644 --- a/src/LSF/Batch_FactBatchManager_eLSF.cxx +++ b/src/LSF/Batch_FactBatchManager_eLSF.cxx @@ -33,6 +33,8 @@ namespace Batch { + static FactBatchManager_eLSF sFBM_eLSF; + // Constructeur FactBatchManager_eLSF::FactBatchManager_eLSF() : FactBatchManager_eClient("eLSF") {