X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLoadLeveler%2FTest%2FTest_eLL.cxx;h=8f897cc2fe57c28ff4cbfc1fb6fa6226596ed31a;hb=22e2a51eb83e8e1ff962a027f67f9e433d30389f;hp=d3945259df2ff1be1424575b2f0bac2209307076;hpb=b8e649cf4e8c4bd377f9dd16941926366e2dc6e7;p=tools%2Flibbatch.git diff --git a/src/LoadLeveler/Test/Test_eLL.cxx b/src/LoadLeveler/Test/Test_eLL.cxx index d394525..8f897cc 100644 --- a/src/LoadLeveler/Test/Test_eLL.cxx +++ b/src/LoadLeveler/Test/Test_eLL.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -31,12 +31,12 @@ #include #include +#include #include #include #include -#include +#include #include -#include #include @@ -83,6 +83,7 @@ int main(int argc, char** argv) const string & host = parser.getValue("TEST_ELL_HOST"); const string & user = parser.getValue("TEST_ELL_USER"); const string & queue = parser.getValue("TEST_ELL_QUEUE"); + const string & jobType = parser.getValue("TEST_ELL_JOBTYPE"); int timeout = parser.getValueAsInt("TEST_ELL_TIMEOUT"); // Define the job... @@ -95,12 +96,13 @@ int main(int argc, char** argv) p[INFILE] = Couple("seta.sh", "tmp/Batch/seta.sh"); p[INFILE] += Couple("setb.sh", "tmp/Batch/setb.sh"); p[OUTFILE] = Couple("result.txt", "tmp/Batch/result.txt"); - p[TMPDIR] = "tmp/Batch/"; p[NBPROC] = 1; p[MAXWALLTIME] = 1; - p[MAXRAMSIZE] = 1; + p[MAXRAMSIZE] = 50; p[HOMEDIR] = homedir; p[QUEUE] = queue; + p[LL_JOBTYPE] = jobType; + p[EXCLUSIVE] = false; job.setParametre(p); // ... and its environment Environnement e; @@ -112,8 +114,8 @@ int main(int argc, char** argv) BatchManagerCatalog& c = BatchManagerCatalog::getInstance(); // Create a BatchManager of type ePBS on localhost - FactBatchManager_eClient * fbm = (FactBatchManager_eClient *)(c("eLL")); - BatchManager_eClient * bm = (*fbm)(host.c_str(), user.c_str(), protocol); + FactBatchManager * fbm = c("LL"); + BatchManager * bm = (*fbm)(host.c_str(), user.c_str(), protocol); // Submit the job to the BatchManager JobId jobid = bm->submitJob(job); @@ -122,9 +124,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;