-// 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
#include <Batch_Job.hxx>
#include <Batch_BatchManagerCatalog.hxx>
#include <Batch_FactBatchManager.hxx>
-#include <Batch_FactBatchManager_eClient.hxx>
#include <Batch_FactBatchManager_eLL.hxx>
#include <Batch_BatchManager.hxx>
-#include <Batch_BatchManager_eClient.hxx>
#include <SimpleParser.hxx>
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] = 50;
p[HOMEDIR] = homedir;
p[QUEUE] = queue;
- p[LL_JOBTYPE] = jobType;
+ p[LL_JOBTYPE] = jobType;
+ p[EXCLUSIVE] = false;
job.setParametre(p);
// ... and its environment
Environnement e;
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);
// 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;