#include <Batch_Constants.hxx>
#include <Batch_Utils.hxx>
+#include <Batch_NotYetImplementedException.hxx>
#include "Batch_BatchManager_ePBS.hxx"
#include "Batch_JobInfo_ePBS.hxx"
const char * username,
CommunicationProtocolType protocolType, const char * mpiImpl,
int nb_proc_per_node)
- : BatchManager(parent, host),
- BatchManager_eClient(parent, host, username, protocolType, mpiImpl),
+ : BatchManager(parent, host, username, protocolType, mpiImpl),
_nb_proc_per_node(nb_proc_per_node)
{
// Nothing to do
string output;
int status = Utils::getCommandOutput(command, output);
cout << output;
- if (status != 0) throw EmulationException("Can't submit job, error was: " + output);
+ if (status != 0) throw RunTimeException("Can't submit job, error was: " + output);
// normally output contains only id of submitted job, we just need to remove the final \n
string jobref = output.substr(0, output.size() - 1);
cerr << command.c_str() << endl;
status = system(command.c_str());
if (status)
- throw EmulationException("Error of connection on remote host");
+ throw RunTimeException("Error of connection on remote host");
cerr << "jobId = " << ref << "killed" << endl;
}
// Methode pour le controle des jobs : suspend un job en file d'attente
void BatchManager_ePBS::holdJob(const JobId & jobid)
{
- throw EmulationException("Not yet implemented");
+ throw NotYetImplementedException("BatchManager_ePBS::holdJob");
}
// Methode pour le controle des jobs : relache un job suspendu
void BatchManager_ePBS::releaseJob(const JobId & jobid)
{
- throw EmulationException("Not yet implemented");
+ throw NotYetImplementedException("BatchManager_ePBS::releaseJob");
}
// Methode pour le controle des jobs : modifie un job en file d'attente
void BatchManager_ePBS::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
{
- throw EmulationException("Not yet implemented");
+ throw NotYetImplementedException("BatchManager_ePBS::alterJob");
}
// Methode pour le controle des jobs : modifie un job en file d'attente
string output;
int status = Utils::getCommandOutput(command, output);
if(status && status != 153 && status != 256*153)
- throw EmulationException("Error of connection on remote host");
+ throw RunTimeException("Error of connection on remote host");
JobInfo_ePBS ji = JobInfo_ePBS(id, output);
return ji;
// Methode pour le controle des jobs : teste si un job est present en machine
bool BatchManager_ePBS::isRunning(const JobId & jobid)
{
- throw EmulationException("Not yet implemented");
+ throw NotYetImplementedException("BatchManager_ePBS::isRunning");
}
std::string BatchManager_ePBS::buildSubmissionScript(const Job & job)
if (params.find(WORKDIR) != params.end())
workDir = params[WORKDIR].str();
else
- throw EmulationException("params[WORKDIR] is not defined ! Please defined it, cannot submit this job");
+ throw RunTimeException("params[WORKDIR] is not defined ! Please defined it, cannot submit this job");
if (params.find(EXECUTABLE) != params.end())
fileToExecute = params[EXECUTABLE].str();
else
- throw EmulationException("params[EXECUTABLE] is not defined ! Please defined it, cannot submit this job");
+ throw RunTimeException("params[EXECUTABLE] is not defined ! Please defined it, cannot submit this job");
// Optional parameters
if (params.find(NBPROC) != params.end())
// Create batch submit file
ofstream tempOutputFile;
- std::string TmpFileName = createAndOpenTemporaryFile("PBS-script", tempOutputFile);
+ std::string TmpFileName = Utils::createAndOpenTemporaryFile("PBS-script", tempOutputFile);
tempOutputFile << "#! /bin/sh -f" << endl;
if (params.find(NAME) != params.end()) {
workDir + "/" + remoteFileName,
_hostname, _username);
if (status)
- throw EmulationException("Error of connection on remote host, cannot copy batch submission file");
+ throw RunTimeException("Error of connection on remote host, cannot copy batch submission file");
return remoteFileName;
}
}