BatchManager * FactBatchManager_eCCC::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
// MESSAGE("Building new BatchManager_CCC on host '" << hostname << "'");
return new BatchManager_eCCC(this, hostname, username, protocolType, mpiImpl);
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
}
def_Constant(MODIFICATIONTIME);
def_Constant(NAME);
def_Constant(NBPROC);
+ def_Constant(NBPROCPERNODE);
def_Constant(OUTFILE);
def_Constant(PID);
def_Constant(QUEUE);
decl_extern_Constant(MODIFICATIONTIME);
decl_extern_Constant(NAME);
decl_extern_Constant(NBPROC);
+ decl_extern_Constant(NBPROCPERNODE);
decl_extern_Constant(OUTFILE);
decl_extern_Constant(PID);
decl_extern_Constant(QUEUE);
virtual Batch::BatchManager * operator() (const char * hostname,
const char * username = "",
CommunicationProtocolType protocolType = SSH,
- const char * mpi = "nompi",
- int nb_proc_per_node = 1) const = 0;
+ const char * mpi = "nompi") const = 0;
std::string getType() const;
std::string __repr__() const;
addParameter("MODIFICATIONTIME", LONG, 1);
addParameter("NAME", STRING, 1);
addParameter("NBPROC", LONG, 1);
+ addParameter("NBPROCPERNODE", LONG, 1);
addParameter("OUTFILE", COUPLE, 0);
addParameter("PID", LONG, 1);
addParameter("QUEUE", STRING, 1);
BatchManager * FactBatchManager_eLSF::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
// MESSAGE("Building new BatchManager_LSF on host '" << hostname << "'");
return new BatchManager_eLSF(this, hostname, username, protocolType, mpiImpl);
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
BatchManager_eLL::BatchManager_eLL(const FactBatchManager * parent, const char * host,
const char * username,
- CommunicationProtocolType protocolType, const char * mpiImpl,
- int nb_proc_per_node)
- : BatchManager(parent, host, username, protocolType, mpiImpl),
- _nb_proc_per_node(nb_proc_per_node)
+ CommunicationProtocolType protocolType, const char * mpiImpl)
+ : BatchManager(parent, host, username, protocolType, mpiImpl)
{
// Nothing to do
}
int nbproc = 1;
if (params.find(NBPROC) != params.end())
nbproc = params[NBPROC];
+ int nbprocpernode = 1;
+ if (params.find(NBPROCPERNODE) != params.end())
+ nbprocpernode = params[NBPROCPERNODE];
if (params.find(EXCLUSIVE) != params.end()) {
if (params[EXCLUSIVE])
tempOutputFile << "# @ job_type = " << job_type << endl;
if (job_type == "mpich") {
- int nodes_requested = (nbproc + _nb_proc_per_node -1) / _nb_proc_per_node;
+ int nodes_requested = (nbproc + nbprocpernode -1) / nbprocpernode;
tempOutputFile << "# @ node = " << nodes_requested << endl;
tempOutputFile << "# @ total_tasks = " << nbproc << endl;
}
public:
BatchManager_eLL(const FactBatchManager * parent, const char * host = "localhost",
const char * username = "",
- CommunicationProtocolType protocolType = SSH, const char * mpiImpl = "nompi",
- int nb_proc_per_node=1);
+ CommunicationProtocolType protocolType = SSH, const char * mpiImpl = "nompi");
virtual ~BatchManager_eLL();
// Methods to control jobs
protected:
std::string buildCommandFile(const Job & job);
- int _nb_proc_per_node;
-
};
}
BatchManager * FactBatchManager_eLL::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
// MESSAGE("Building new BatchManager_eLL on host '" << hostname << "'");
- return new BatchManager_eLL(this, hostname, username, protocolType, mpiImpl, nb_proc_per_node);
+ return new BatchManager_eLL(this, hostname, username, protocolType, mpiImpl);
}
}
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
}
// Constructeur
BatchManager_Local::BatchManager_Local(const Batch::FactBatchManager * parent, const char * host,
const char * username,
- CommunicationProtocolType protocolType, const char * mpiImpl,
- int nb_proc_per_node)
+ CommunicationProtocolType protocolType, const char * mpiImpl)
: BatchManager(parent, host, username, protocolType, mpiImpl), _connect(0),
_idCounter(0)
{
BatchManager_Local(const Batch::FactBatchManager * parent, const char * host = "localhost",
const char * username = "",
- CommunicationProtocolType protocolType = SSH, const char * mpiImpl = "nompi",
- int nb_proc_per_node = 1);
+ CommunicationProtocolType protocolType = SSH, const char * mpiImpl = "nompi");
virtual ~BatchManager_Local();
// Recupere le nom du serveur par defaut
BatchManager * FactBatchManager_Local::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpi,
- int nb_proc_per_node) const
+ const char * mpi) const
{
- return new BatchManager_Local(this, hostname, username,
- protocolType, mpi, nb_proc_per_node);
+ return new BatchManager_Local(this, hostname, username, protocolType, mpi);
}
}
virtual BatchManager * operator() (const char * hostname,
const char * username = "",
CommunicationProtocolType protocolType = SSH,
- const char * mpi = "nompi",
- int nb_proc_per_node = 1) const;
+ const char * mpi = "nompi") const;
};
BatchManager_ePBS::BatchManager_ePBS(const FactBatchManager * parent, const char * host,
const char * username,
- CommunicationProtocolType protocolType, const char * mpiImpl,
- int nb_proc_per_node)
- : BatchManager(parent, host, username, protocolType, mpiImpl),
- _nb_proc_per_node(nb_proc_per_node)
+ CommunicationProtocolType protocolType, const char * mpiImpl)
+ : BatchManager(parent, host, username, protocolType, mpiImpl)
{
// Nothing to do
}
Parametre params = job.getParametre();
Environnement env = job.getEnvironnement();
- // Job Parameters
- string workDir = "";
- string fileToExecute = "";
- int nbproc = 0;
- int edt = 0;
- int mem = 0;
- string queue = "";
-
// Mandatory parameters
+ string workDir;
if (params.find(WORKDIR) != params.end())
workDir = params[WORKDIR].str();
else
throw RunTimeException("params[WORKDIR] is not defined ! Please defined it, cannot submit this job");
+ string fileToExecute;
if (params.find(EXECUTABLE) != params.end())
fileToExecute = params[EXECUTABLE].str();
else
throw RunTimeException("params[EXECUTABLE] is not defined ! Please defined it, cannot submit this job");
// Optional parameters
- if (params.find(NBPROC) != params.end())
+ int nbproc = 1;
+ if (params.find(NBPROC) != params.end())
nbproc = params[NBPROC];
+ int nbprocpernode = 1;
+ if (params.find(NBPROCPERNODE) != params.end())
+ nbprocpernode = params[NBPROCPERNODE];
+ int edt = 0;
if (params.find(MAXWALLTIME) != params.end())
edt = params[MAXWALLTIME];
+ int mem = 0;
if (params.find(MAXRAMSIZE) != params.end())
mem = params[MAXRAMSIZE];
+ string queue = "";
if (params.find(QUEUE) != params.end())
queue = params[QUEUE].str();
if (nbproc > 0)
{
- int nb_full_nodes = nbproc / _nb_proc_per_node;
- int nb_proc_on_last_node = nbproc % _nb_proc_per_node;
+ int nb_full_nodes = nbproc / nbprocpernode;
+ int nb_proc_on_last_node = nbproc % nbprocpernode;
// In exclusive mode, we reserve all procs on the nodes
if (params.find(EXCLUSIVE) != params.end() && params[EXCLUSIVE] && nb_proc_on_last_node > 0) {
// Full nodes
if (nb_full_nodes > 0) {
- tempOutputFile << nb_full_nodes << ":ppn=" << _nb_proc_per_node;
+ tempOutputFile << nb_full_nodes << ":ppn=" << nbprocpernode;
if (nb_proc_on_last_node > 0) {
tempOutputFile << "+";
}
tempOutputFile << endl;
}
- // Abstraction of PBS_NODEFILE - TODO
+ // Define NODEFILE
tempOutputFile << "export LIBBATCH_NODEFILE=$PBS_NODEFILE" << endl;
// Launch the executable
// Constructeur et destructeur
BatchManager_ePBS(const FactBatchManager * parent, const char * host="localhost",
const char * username="",
- CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi",
- int nb_proc_per_node=1); // connexion a la machine host
+ CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi");
virtual ~BatchManager_ePBS();
// Recupere le nom du serveur par defaut
protected:
std::string buildSubmissionScript(const Job & job);
- private:
- int _nb_proc_per_node;
-
#ifdef SWIG
public:
// Recupere le l'identifiant d'un job deja soumis au BatchManager
BatchManager * FactBatchManager_ePBS::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
- return new BatchManager_ePBS(this, hostname, username, protocolType, mpiImpl, nb_proc_per_node);
+ return new BatchManager_ePBS(this, hostname, username, protocolType, mpiImpl);
}
}
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
p[INFILE] += Couple("setb.sh", "tmp/Batch/setb.sh");
p[OUTFILE] = Couple("result.txt", "tmp/Batch/result.txt");
p[NBPROC] = 1;
+ p[NBPROCPERNODE] = 8;
p[MAXWALLTIME] = 1;
p[MAXRAMSIZE] = 128;
p[HOMEDIR] = homedir;
// Create a BatchManager of type ePBS on localhost
FactBatchManager * fbm = c("PBS");
- BatchManager * bm = (*fbm)(host.c_str(), user.c_str(), protocol, "nompi", 8);
+ BatchManager * bm = (*fbm)(host.c_str(), user.c_str(), protocol, "nompi");
// Submit the job to the BatchManager
JobId jobid = bm->submitJob(job);
BatchManager * FactBatchManager_eSGE::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
// MESSAGE("Building new BatchManager_SGE on host '" << hostname << "'");
return new BatchManager_eSGE(this, hostname, username, protocolType, mpiImpl);
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
const char * host,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node)
+ const char * mpiImpl)
: BatchManager(parent, host, username, protocolType, mpiImpl)
{
}
const char * host = "localhost",
const char * username = "",
CommunicationProtocolType protocolType = SSH,
- const char * mpiImpl = "nompi",
- int nb_proc_per_node = 1);
+ const char * mpiImpl = "nompi");
virtual ~BatchManager_eSlurm();
// Methods to control jobs
BatchManager * FactBatchManager_eSlurm::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
- return new BatchManager_eSlurm(this, hostname, username, protocolType, mpiImpl, nb_proc_per_node);
+ return new BatchManager_eSlurm(this, hostname, username, protocolType, mpiImpl);
}
}
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};
const char * host,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node)
+ const char * mpiImpl)
: // Force SH protocol for Vishnu
- BatchManager(parent, host, username, SH, mpiImpl),
- _nb_proc_per_node(nb_proc_per_node)
+ BatchManager(parent, host, username, SH, mpiImpl)
{
}
const char * host = "localhost",
const char * username = "",
CommunicationProtocolType protocolType = SSH,
- const char * mpiImpl = "nompi",
- int nb_proc_per_node = 1);
+ const char * mpiImpl = "nompi");
virtual ~BatchManager_eVishnu();
// Methods to control jobs
std::string buildCommandFile(const Job & job);
void exportInputFiles(const Job & job);
- int _nb_proc_per_node;
-
};
}
BatchManager * FactBatchManager_eVishnu::operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node) const
+ const char * mpiImpl) const
{
// MESSAGE("Building new BatchManager_eVishnu on host '" << hostname << "'");
- return new BatchManager_eVishnu(this, hostname, username, protocolType, mpiImpl, nb_proc_per_node);
+ return new BatchManager_eVishnu(this, hostname, username, protocolType, mpiImpl);
}
}
virtual BatchManager * operator() (const char * hostname,
const char * username,
CommunicationProtocolType protocolType,
- const char * mpiImpl,
- int nb_proc_per_node = 1) const;
+ const char * mpiImpl) const;
};