]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
IDM : Batch sur CCRT
authordutka <dutka>
Thu, 10 Feb 2005 15:39:37 +0000 (15:39 +0000)
committerdutka <dutka>
Thu, 10 Feb 2005 15:39:37 +0000 (15:39 +0000)
18 files changed:
configure.in.base
src/Batch/Batch_BatchManager.hxx
src/Batch/Batch_BatchManagerCatalog.cxx
src/Batch/Batch_BoolType.cxx
src/Batch/Batch_CharType.cxx
src/Batch/Batch_CoupleType.cxx
src/Batch/Batch_Date.cxx
src/Batch/Batch_DateType.cxx
src/Batch/Batch_GenericType.cxx
src/Batch/Batch_IntType.cxx
src/Batch/Batch_JobId.cxx
src/Batch/Batch_Job_LSF.cxx
src/Batch/Batch_LongType.cxx
src/Batch/Batch_Parametre.cxx
src/Batch/Batch_Parametre.hxx
src/Batch/Batch_StringType.cxx
src/Batch/Batch_Versatile.cxx
src/Makefile.in

index a382869d9935947fedfaf121d9f1bf66730bd8a4..687d5d093b8c9e96437c4c4646b5e2365bb82fbf 100644 (file)
@@ -202,6 +202,18 @@ lsf_ok=no
 CHECK_LSF
 dnl lsf_ok is set to yes by CHECK_LSF
 
+dnl
+dnl ---------------------------------------------
+dnl testing Batch
+dnl ---------------------------------------------
+dnl
+
+WITH_BATCH=no
+test x$openpbs_ok = xyes || test x$lsf_ok = xyes && WITH_BATCH=yes
+AC_SUBST(WITH_BATCH)
+
+
+
 echo
 echo ---------------------------------------------
 echo testing LEX \& YACC
index 60d80e37673f8e684a5d33487483660698332818..8cac3447c51f687b8a3b5119f3aa3ab6e8a4c22a 100644 (file)
@@ -49,7 +49,8 @@ namespace Batch {
 
   protected:
     std::string _hostname; // serveur ou tourne le BatchManager
-    std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
+    // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
+    std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
     const Batch::FactBatchManager * _parent;
 
   private:
index 6485411bce10a706a23fa813bfa54c4832c8e493..76a017f213d1fa37ee1839aeb6c5bc8b0b721a25 100644 (file)
@@ -17,7 +17,7 @@ using namespace std;
 namespace Batch {
 
   pthread_mutex_t BatchManagerCatalog::_mutex = PTHREAD_MUTEX_INITIALIZER;
-  map<string, FactBatchManager *> * BatchManagerCatalog::_p_catalog = 0;
+  std::map<string, FactBatchManager *> * BatchManagerCatalog::_p_catalog = 0;
 
   // Constructeur
   BatchManagerCatalog::BatchManagerCatalog()
@@ -42,7 +42,7 @@ namespace Batch {
     if (pFBM) { // *** section critique ***
       pthread_mutex_lock(&_mutex);
 
-      if (! BatchManagerCatalog::_p_catalog) BatchManagerCatalog::_p_catalog = new map<string, FactBatchManager *>;
+      if (! BatchManagerCatalog::_p_catalog) BatchManagerCatalog::_p_catalog = new std::map<string, FactBatchManager *>;
       (*BatchManagerCatalog::_p_catalog)[type] = pFBM;
 
       pthread_mutex_unlock(&_mutex);
@@ -54,7 +54,7 @@ namespace Batch {
     return BatchManagerCatalog::getFactBatchManager(type);
   }
 
-  map<string, FactBatchManager *> * BatchManagerCatalog::dict() const
+  std::map<string, FactBatchManager *> * BatchManagerCatalog::dict() const
   {
     return _p_catalog;
   }
@@ -64,7 +64,7 @@ namespace Batch {
     ostringstream oss;
     oss << "<BatchManagerCatalog contains {";
     string sep;
-    for(map<string, FactBatchManager *>::const_iterator it = (*_p_catalog).begin(); it != (*_p_catalog).end(); it++, sep=", ") {
+    for(std::map<string, FactBatchManager *>::const_iterator it = (*_p_catalog).begin(); it != (*_p_catalog).end(); it++, sep=", ") {
       oss << sep << "'" << (*it).first << "' : '" << (*it).second->__repr__() << "'";
     }
     oss << "}>";
index 6e28f197bb3678dd964ecf3bfc45caf0c4793cd8..7a1c8b9e66a59c099c300d1574087a8112ccb161 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <string>
+#include <assert.h>
 #include "Batch_BoolType.hxx"
 using namespace std;
 
index 52f64146d9c2369f003570ccfae1bcf65e9e6710..da4cb9aed4721d1bec48bea8cf17ece6c62a1650 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <string>
+#include <assert.h>
 #include "Batch_CharType.hxx"
 using namespace std;
 
index 2cf112a26df6f3599454d0be10e677fb1c9b5a7c..ae2ca4be0735dc487d014e853a71d22fc21895ce 100644 (file)
@@ -8,6 +8,7 @@
  *
  */
 
+#include <assert.h>
 #include "Batch_CoupleType.hxx"
 using namespace std;
 
index 9c48d233db3d09573c1e4c862211a4375a3ef777..da0a22194ee6f1cb8b7e8a4d073731aa571adc6f 100644 (file)
@@ -17,7 +17,8 @@ namespace Batch {
 
   Date::Date(const long l)
   {
-    struct tm * p_tm = localtime(&l);
+    time_t l_t = l;
+    struct tm * p_tm = localtime(&l_t);
     _day   = p_tm->tm_mday;
     _month = p_tm->tm_mon  + 1;
     _year  = p_tm->tm_year + 1900;
@@ -30,7 +31,8 @@ namespace Batch {
   { 
     if ((s == "now") ||        (s == "Now") || (s == "NOW")) {
       long l = time(0);
-      struct tm * p_tm = localtime(&l);
+      time_t l_t = l;
+      struct tm * p_tm = localtime(&l_t);
       _day   = p_tm->tm_mday;
       _month = p_tm->tm_mon  + 1;
       _year  = p_tm->tm_year + 1900;
@@ -53,7 +55,8 @@ namespace Batch {
 
   Date & Date::operator =(long l)
   {
-    struct tm * p_tm = localtime(&l);
+    time_t l_t = l;
+    struct tm * p_tm = localtime(&l_t);
     _day   = p_tm->tm_mday;
     _month = p_tm->tm_mon  + 1;
     _year  = p_tm->tm_year + 1900;
@@ -92,7 +95,8 @@ namespace Batch {
   {
     if ((s == "now") ||        (s == "Now") || (s == "NOW")) {
       long l = time(0);
-      struct tm * p_tm = localtime(&l);
+      time_t l_t = l;
+      struct tm * p_tm = localtime(&l_t);
       _day   = p_tm->tm_mday;
       _month = p_tm->tm_mon  + 1;
       _year  = p_tm->tm_year + 1900;
index 4e08dd2a5e3bb5575979249d6b5805700df58559..90819ae6e0d743f56997bf47781728c9e4621fd9 100644 (file)
@@ -10,6 +10,7 @@
 extern "C" {
 #include <time.h>
 }
+#include <assert.h>
 #include "Batch_DateType.hxx"
 using namespace std;
 
index dc00c838f8d756e146a1e74e9d939c9243882801..8b8ae01ac4c794139949f0f891700d413da19dbe 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <iostream>
 #include <string>
+#include <assert.h>
 #include "Batch_GenericType.hxx"
 using namespace std;
 
index a9aa692ffebb36fdd50c5bce019401b2b7d6ee82..2a642b3bbbfea5bb70e32c12afef15b8037cbc89 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <string>
 #include <sstream>
+#include <assert.h>
 //#include "MEDMEM_STRING.hxx"
 #include "Batch_IntType.hxx"
 using namespace std;
index 370fe44769477ef960b2ace9d4dbb1e4f178badd..2c977cce8c8c87614544d1f3acd3ee58968ddfc9 100644 (file)
@@ -10,6 +10,7 @@
 #include "Batch_JobId.hxx"
 #include "Batch_BatchManager.hxx"
 #include <sstream>
+#include <assert.h>
 //#include "MEDMEM_STRING.hxx"
 using namespace std;
 
index 91466145c87b6ca0169baade3ab1a35f4b59e82c..4d7a761416c8f650aa6e7db55eda7e3c412988a4 100644 (file)
@@ -146,8 +146,8 @@ namespace Batch {
 
          } else {
            struct xFile xf;
-           strncpy(xf.subFn,  local.c_str(),  MAXFILENAMELEN); xf.subFn[MAXFILENAMELEN]  = 0;
-           strncpy(xf.execFn, remote.c_str(), MAXFILENAMELEN); xf.execFn[MAXFILENAMELEN] = 0;
+           strncpy(xf.subFn,  local.c_str(),  MAXFILENAMELEN - 1); xf.subFn[MAXFILENAMELEN - 1]  = 0;
+           strncpy(xf.execFn, remote.c_str(), MAXFILENAMELEN - 1); xf.execFn[MAXFILENAMELEN - 1] = 0;
            xf.options = XF_OP_SUB2EXEC;
            xf_tab.push_back(xf);
          }
@@ -200,8 +200,8 @@ namespace Batch {
 
          } else {
            struct xFile xf;
-           strncpy(xf.subFn,  local.c_str(),  MAXFILENAMELEN); xf.subFn[MAXFILENAMELEN]  = 0;
-           strncpy(xf.execFn, remote.c_str(), MAXFILENAMELEN); xf.execFn[MAXFILENAMELEN] = 0;
+           strncpy(xf.subFn,  local.c_str(),  MAXFILENAMELEN - 1); xf.subFn[MAXFILENAMELEN - 1]  = 0;
+           strncpy(xf.execFn, remote.c_str(), MAXFILENAMELEN - 1); xf.execFn[MAXFILENAMELEN - 1] = 0;
            xf.options = XF_OP_EXEC2SUB;
            xf_tab.push_back(xf);
          }
index 6a7c10038f8dad984fd530a7d9b8fba2cdbe12c1..9e7dd3ac0bd2c2dc6b4671e9383244c3440ff8e1 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <string>
 #include <sstream>
+#include <assert.h>
 //#include "MEDMEM_STRING.hxx"
 #include "Batch_LongType.hxx"
 using namespace std;
index 47547061faa11aef144f1087a3e4cb11c988c3f6..84a0b122ce8f3a3a597b1c584de6c4c497587d34 100644 (file)
 #include "Batch_Versatile.hxx"
 #include "Batch_InvalidKeyException.hxx"
 #include "Batch_Parametre.hxx"
-using namespace std;
 
 // Definition des membres constants statiques
 // Definition des noms globaux pour les clefs en tant que references
 // TODO : supprimer les declarations statiques des clefs de la map
 def_static_MapKey(ACCOUNT);
+def_static_MapKey(ARGUMENTS);
 def_static_MapKey(CHECKPOINT);
 def_static_MapKey(CKPTINTERVAL);
 def_static_MapKey(CREATIONTIME);
 def_static_MapKey(EGROUP);
 def_static_MapKey(ELIGIBLETIME);
+def_static_MapKey(ENDTIME);
 def_static_MapKey(EUSER);
 def_static_MapKey(EXECUTABLE);
 def_static_MapKey(EXECUTIONHOST);
+def_static_MapKey(EXITCODE);
 def_static_MapKey(HOLD);
 def_static_MapKey(ID);
 def_static_MapKey(INFILE);
@@ -35,12 +37,13 @@ def_static_MapKey(MAXRAMSIZE);
 def_static_MapKey(MAXWALLTIME);
 def_static_MapKey(MODIFICATIONTIME);
 def_static_MapKey(NAME);
+def_static_MapKey(NBPROC);
 def_static_MapKey(OUTFILE);
 def_static_MapKey(PID);
 def_static_MapKey(QUEUE);
 def_static_MapKey(QUEUEDTIME);
 def_static_MapKey(SERVER);
-def_static_MapKey(STARTDATE);
+def_static_MapKey(STARTTIME);
 def_static_MapKey(STATE);
 def_static_MapKey(TEXT);
 def_static_MapKey(TMPDIR);
@@ -62,6 +65,9 @@ namespace Batch {
     TypeMap[ACCOUNT].type = STRING;
     TypeMap[ACCOUNT].maxelem = 1;
 
+    TypeMap[ARGUMENTS].type = STRING;
+    TypeMap[ARGUMENTS].maxelem = 0;
+
     TypeMap[CHECKPOINT].type = LONG;
     TypeMap[CHECKPOINT].maxelem = 1;
 
@@ -77,6 +83,9 @@ namespace Batch {
     TypeMap[ELIGIBLETIME].type = LONG;
     TypeMap[ELIGIBLETIME].maxelem = 1;
 
+    TypeMap[ENDTIME].type = LONG;
+    TypeMap[ENDTIME].maxelem = 1;
+
     TypeMap[EUSER].type = STRING;
     TypeMap[EUSER].maxelem = 1;
 
@@ -86,6 +95,9 @@ namespace Batch {
     TypeMap[EXECUTIONHOST].type = STRING;
     TypeMap[EXECUTIONHOST].maxelem = 0;
 
+    TypeMap[EXITCODE].type = LONG;
+    TypeMap[EXITCODE].maxelem = 1;
+
     TypeMap[HOLD].type = LONG;
     TypeMap[HOLD].maxelem = 1;
 
@@ -116,6 +128,9 @@ namespace Batch {
     TypeMap[NAME].type = STRING;
     TypeMap[NAME].maxelem = 1;
 
+    TypeMap[NBPROC].type = LONG;
+    TypeMap[NBPROC].maxelem = 1;
+
     TypeMap[OUTFILE].type = COUPLE;
     TypeMap[OUTFILE].maxelem = 0;
 
@@ -131,8 +146,8 @@ namespace Batch {
     TypeMap[SERVER].type = STRING;
     TypeMap[SERVER].maxelem = 1;
 
-    TypeMap[STARTDATE].type = LONG;
-    TypeMap[STARTDATE].maxelem = 1;
+    TypeMap[STARTTIME].type = LONG;
+    TypeMap[STARTTIME].maxelem = 1;
 
     TypeMap[STATE].type = STRING;
     TypeMap[STATE].maxelem = 1;
index e4ed4d8897c44fa5bc8f971e27b899b8ad235ba6..ae031342feab4667af03db28e0727d36ff61a421 100644 (file)
 // TODO : d'une descrption dans un fichier exterieur (genre XML)
 
 #define def_extern_MapKey(mk) extern const std::string & mk;
-#define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk); \
-                              const std::string & mk = Batch::Parametre::mk;
+#define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk);     \
+  const std::string & mk = Batch::Parametre::mk;
 
 namespace Batch {
 
   class Parametre : public std::map< std::string, Versatile >
   {
   public:
-               // Constructeur standard
+    // Constructeur standard
     Parametre();
 
-               // Constructeur par recopie
-    Parametre::Parametre(const Parametre & PM);
+    // Constructeur par recopie
+    Parametre(const Batch::Parametre & PM);
 
-               // Operateur de recherche dans la map
+    // Operateur de recherche dans la map
     Versatile & operator [] (const std::string &);
     const Versatile & operator [] (const std::string &) const;
 
-               // Operateur d'affectation
-    Parametre & operator =(const Parametre & PM);
+    // Operateur d'affectation
+    Parametre & operator =(const Batch::Parametre & PM);
 
-               // Declarations statique des clefs de la map
-               // TODO : supprimer les declarations statiques des clefs de la map
+    // Declarations statique des clefs de la map
+    // TODO : supprimer les declarations statiques des clefs de la map
     static const std::string ACCOUNT;
+    static const std::string ARGUMENTS;
     static const std::string CHECKPOINT;
     static const std::string CKPTINTERVAL;
     static const std::string CREATIONTIME;
     static const std::string EGROUP;
     static const std::string ELIGIBLETIME;
+    static const std::string ENDTIME;
     static const std::string EUSER;
     static const std::string EXECUTABLE;
     static const std::string EXECUTIONHOST;
+    static const std::string EXITCODE;
     static const std::string HOLD;
     static const std::string ID;
     static const std::string INFILE;
@@ -64,12 +67,13 @@ namespace Batch {
     static const std::string MAXWALLTIME;
     static const std::string MODIFICATIONTIME;
     static const std::string NAME;
+    static const std::string NBPROC;
     static const std::string OUTFILE;
     static const std::string PID;
     static const std::string QUEUE;
     static const std::string QUEUEDTIME;
     static const std::string SERVER;
-    static const std::string STARTDATE;
+    static const std::string STARTTIME;
     static const std::string STATE;
     static const std::string TEXT;
     static const std::string TMPDIR;
@@ -89,14 +93,17 @@ namespace Batch {
 }
 
 def_extern_MapKey(ACCOUNT);
+def_extern_MapKey(ARGUMENTS);
 def_extern_MapKey(CHECKPOINT);
 def_extern_MapKey(CKPTINTERVAL);
 def_extern_MapKey(CREATIONTIME);
 def_extern_MapKey(EGROUP);
 def_extern_MapKey(ELIGIBLETIME);
+def_extern_MapKey(ENDTIME);
 def_extern_MapKey(EUSER);
 def_extern_MapKey(EXECUTABLE);
 def_extern_MapKey(EXECUTIONHOST);
+def_extern_MapKey(EXITCODE);
 def_extern_MapKey(HOLD);
 def_extern_MapKey(ID);
 def_extern_MapKey(INFILE);
@@ -107,12 +114,13 @@ def_extern_MapKey(MAXRAMSIZE);
 def_extern_MapKey(MAXWALLTIME);
 def_extern_MapKey(MODIFICATIONTIME);
 def_extern_MapKey(NAME);
+def_extern_MapKey(NBPROC);
 def_extern_MapKey(OUTFILE);
 def_extern_MapKey(PID);
 def_extern_MapKey(QUEUE);
 def_extern_MapKey(QUEUEDTIME);
 def_extern_MapKey(SERVER);
-def_extern_MapKey(STARTDATE);
+def_extern_MapKey(STARTTIME);
 def_extern_MapKey(STATE);
 def_extern_MapKey(TEXT);
 def_extern_MapKey(TMPDIR);
index fa01f03314ca74cb5ee4329777fe98cd8a786722..98c9e8447bed2dc9cbe1758cda121f1229b97010 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <string>
+#include <assert.h>
 #include "Batch_StringType.hxx"
 using namespace std;
 
index 8ed9d9a3ec287be00fd67820d7b77df75e9bc5ca..efc505a1579a320c84061ec458c481e59bd965bd 100644 (file)
@@ -11,6 +11,7 @@
 #include <list>
 #include <string>
 #include <sstream>
+#include <assert.h>
 //#include "MEDMEM_STRING.hxx"
 #include "Batch_GenericType.hxx"
 #include "Batch_IntType.hxx"
index 91f81257ec63339db11971c4acbd0f143201a9b8..c64ecb109433b89435f4d252b44a9209994fa6e7 100644 (file)
@@ -60,7 +60,7 @@ ifeq (@mpi_ok@,yes)
   SUBDIRS+= MPIContainer MPILifeCycleCORBA TestMPIContainer
 endif
 
-ifeq (@WITHOPENPBS@,yes)
+ifeq (@WITH_BATCH@,yes)
   SUBDIRS += Batch Batch_SWIG
 endif