From 30a05940f755ee0e479808b2669b1ff02b1d2116 Mon Sep 17 00:00:00 2001 From: barate Date: Fri, 4 Mar 2011 16:52:20 +0000 Subject: [PATCH 1/1] Fixed job submission to LoadLeveler from Windows --- src/Core/Batch_BatchManager_eClient.cxx | 3 ++- src/LoadLeveler/Test/Test_eLL.cxx | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Core/Batch_BatchManager_eClient.cxx b/src/Core/Batch_BatchManager_eClient.cxx index babdb82..6fc77b4 100644 --- a/src/Core/Batch_BatchManager_eClient.cxx +++ b/src/Core/Batch_BatchManager_eClient.cxx @@ -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 diff --git a/src/LoadLeveler/Test/Test_eLL.cxx b/src/LoadLeveler/Test/Test_eLL.cxx index d9096d2..b3dc0b3 100644 --- a/src/LoadLeveler/Test/Test_eLL.cxx +++ b/src/LoadLeveler/Test/Test_eLL.cxx @@ -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; -- 2.30.2