]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Fixed job submission to LoadLeveler from Windows
authorbarate <barate>
Fri, 4 Mar 2011 16:52:20 +0000 (16:52 +0000)
committerbarate <barate>
Fri, 4 Mar 2011 16:52:20 +0000 (16:52 +0000)
src/Core/Batch_BatchManager_eClient.cxx
src/LoadLeveler/Test/Test_eLL.cxx

index babdb826a83d1561c65cfc0be6d98fdda2518219..6fc77b45c63c922622698eb18832d0be3ad8d258 100644 (file)
@@ -281,7 +281,8 @@ namespace Batch {
 #ifdef WIN32
 
     string fileName = generateTemporaryFileName(prefix);
-    outputStream.open(fileName.c_str());
+    // Open the file as binary to avoid problems with Windows newlines
+    outputStream.open(fileName.c_str(), ios_base::binary | ios_base::out);
 
 #else
 
index d9096d2b77071eb2e3431111a6a5f928f3c6323e..b3dc0b33b6100feb59e149bb8d710167accd5e48 100644 (file)
@@ -126,9 +126,13 @@ int main(int argc, char** argv)
     // Wait for the end of the job
     string state = bm->waitForJobEnd(jobid, timeout);
 
-    if (state == FINISHED || state == FAILED) {
+    if (state == FINISHED) {
       cout << "Job " << jobid.__repr__() << " is done" << endl;
       bm->importOutputFiles(job, "resultdir/seconddirname");
+    } else if (state == FAILED) {
+      cerr << "Job " << jobid.__repr__() << " finished in error" << endl;
+      bm->importOutputFiles(job, "resultdir/seconddirname");
+      return 1;
     } else {
       cerr << "Timeout while executing job" << endl;
       return 1;