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
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:
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()
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);
return BatchManagerCatalog::getFactBatchManager(type);
}
- map<string, FactBatchManager *> * BatchManagerCatalog::dict() const
+ std::map<string, FactBatchManager *> * BatchManagerCatalog::dict() const
{
return _p_catalog;
}
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 << "}>";
*/
#include <string>
+#include <assert.h>
#include "Batch_BoolType.hxx"
using namespace std;
*/
#include <string>
+#include <assert.h>
#include "Batch_CharType.hxx"
using namespace std;
*
*/
+#include <assert.h>
#include "Batch_CoupleType.hxx"
using namespace std;
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;
{
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;
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;
{
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;
extern "C" {
#include <time.h>
}
+#include <assert.h>
#include "Batch_DateType.hxx"
using namespace std;
#include <iostream>
#include <string>
+#include <assert.h>
#include "Batch_GenericType.hxx"
using namespace std;
#include <string>
#include <sstream>
+#include <assert.h>
//#include "MEDMEM_STRING.hxx"
#include "Batch_IntType.hxx"
using namespace std;
#include "Batch_JobId.hxx"
#include "Batch_BatchManager.hxx"
#include <sstream>
+#include <assert.h>
//#include "MEDMEM_STRING.hxx"
using namespace std;
} 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);
}
} 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);
}
#include <string>
#include <sstream>
+#include <assert.h>
//#include "MEDMEM_STRING.hxx"
#include "Batch_LongType.hxx"
using namespace std;
#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);
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);
TypeMap[ACCOUNT].type = STRING;
TypeMap[ACCOUNT].maxelem = 1;
+ TypeMap[ARGUMENTS].type = STRING;
+ TypeMap[ARGUMENTS].maxelem = 0;
+
TypeMap[CHECKPOINT].type = LONG;
TypeMap[CHECKPOINT].maxelem = 1;
TypeMap[ELIGIBLETIME].type = LONG;
TypeMap[ELIGIBLETIME].maxelem = 1;
+ TypeMap[ENDTIME].type = LONG;
+ TypeMap[ENDTIME].maxelem = 1;
+
TypeMap[EUSER].type = STRING;
TypeMap[EUSER].maxelem = 1;
TypeMap[EXECUTIONHOST].type = STRING;
TypeMap[EXECUTIONHOST].maxelem = 0;
+ TypeMap[EXITCODE].type = LONG;
+ TypeMap[EXITCODE].maxelem = 1;
+
TypeMap[HOLD].type = LONG;
TypeMap[HOLD].maxelem = 1;
TypeMap[NAME].type = STRING;
TypeMap[NAME].maxelem = 1;
+ TypeMap[NBPROC].type = LONG;
+ TypeMap[NBPROC].maxelem = 1;
+
TypeMap[OUTFILE].type = COUPLE;
TypeMap[OUTFILE].maxelem = 0;
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;
// 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;
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;
}
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);
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);
*/
#include <string>
+#include <assert.h>
#include "Batch_StringType.hxx"
using namespace std;
#include <list>
#include <string>
#include <sstream>
+#include <assert.h>
//#include "MEDMEM_STRING.hxx"
#include "Batch_GenericType.hxx"
#include "Batch_IntType.hxx"
SUBDIRS+= MPIContainer MPILifeCycleCORBA TestMPIContainer
endif
-ifeq (@WITHOPENPBS@,yes)
+ifeq (@WITH_BATCH@,yes)
SUBDIRS += Batch Batch_SWIG
endif