Salome HOME
Major refactoring in classes Versatile, Parametre and Swig wrappings.
[tools/libbatch.git] / src / PBS / Test / Test_ePBS.cxx
index e6da684fb531c184acd9a94b27ca45bbb7d3a5cd..1040faae9374eec5b416cf263acb17e71c30f771 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2011  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,6 +31,7 @@
 #include <fstream>
 #include <cstring>
 
+#include <Batch_Constants.hxx>
 #include <Batch_Job.hxx>
 #include <Batch_BatchManagerCatalog.hxx>
 #include <Batch_FactBatchManager.hxx>
@@ -96,10 +97,9 @@ int main(int argc, char** argv)
     p[INFILE]       += Couple("setb.sh", "tmp/Batch/setb.sh");
     p[OUTFILE]       = Couple("result.txt", "tmp/Batch/result.txt");
     p[TMPDIR]        = "tmp/Batch/";
-    p[USER]          = user;
     p[NBPROC]        = 1;
     p[MAXWALLTIME]   = 1;
-    p[MAXRAMSIZE]    = 1000;
+    p[MAXRAMSIZE]    = 1;
     p[HOMEDIR]       = homedir;
     p[QUEUE]         = queue;
     job.setParametre(p);
@@ -114,7 +114,7 @@ int main(int argc, char** argv)
 
     // Create a BatchManager of type ePBS on localhost
     FactBatchManager_eClient * fbm = (FactBatchManager_eClient *)(c("ePBS"));
-    BatchManager_eClient * bm = (*fbm)(host.c_str(), protocol, "lam");
+    BatchManager_eClient * bm = (*fbm)(host.c_str(), user.c_str(), protocol, "nompi", 8);
 
     // Submit the job to the BatchManager
     JobId jobid = bm->submitJob(job);
@@ -125,7 +125,7 @@ int main(int argc, char** argv)
 
     if (state == FINISHED || state == FAILED) {
       cout << "Job " << jobid.__repr__() << " is done" << endl;
-      bm->importOutputFiles(job, ".");
+      bm->importOutputFiles(job, "resultdir/seconddirname");
     } else {
       cerr << "Timeout while executing job" << endl;
       return 1;
@@ -142,7 +142,7 @@ int main(int argc, char** argv)
   // test the result file
   try {
     SimpleParser resultParser;
-    resultParser.parse("result.txt");
+    resultParser.parse("resultdir/seconddirname/result.txt");
     cout << "Result:" << endl << resultParser;
     const string & envvar = resultParser.getValue("MYENVVAR");
     int result = resultParser.getValueAsInt("c");