* Author : Renaud BARATE - EDF R&D
*/
+#include <cstdlib>
#include <iostream>
#include <fstream>
CommunicationProtocolType protocolType, const char * mpiImpl,
int nb_proc_per_node)
: BatchManager(parent, host),
- BatchManager_eClient(parent, host, username, protocolType, mpiImpl)
+ BatchManager_eClient(parent, host, username, protocolType, mpiImpl),
+ _nb_proc_per_node(nb_proc_per_node)
{
// Nothing to do
}
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 EmulationException("params[WORKDIR] is not defined. Please define 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");
-
- // Optional parameters
- if (params.find(QUEUE) != params.end())
- queue = params[QUEUE].str();
+ throw EmulationException("params[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
string::size_type p1 = fileToExecute.find_last_of("/");
string::size_type p2 = fileToExecute.find_last_of(".");
tempOutputFile << "#!/bin/bash" << endl;
tempOutputFile << "# @ output = " << workDir << "/logs/output.log." << rootNameToExecute << endl;
tempOutputFile << "# @ error = " << workDir << "/logs/error.log." << rootNameToExecute << endl;
- if (queue != "")
- tempOutputFile << "# @ class = " << queue << endl;
+ tempOutputFile << "# @ node_usage = not_shared" << endl;
+
+ if (params.find(NAME) != params.end())
+ tempOutputFile << "# @ job_name = " << params[NAME] << endl;
+
+ // Optional parameters
+ int nbproc = 1;
+ if (params.find(NBPROC) != params.end())
+ nbproc = params[NBPROC];
+ //if (nbproc == 1)
+ // tempOutputFile << "# @ job_type = serial" << endl;
+ //else {
+ // tempOutputFile << "# @ job_type = parallel" << endl;
+ int nodes_requested = (nbproc + _nb_proc_per_node -1) / _nb_proc_per_node;
+ tempOutputFile << "# @ job_type = mpich" << endl;
+ tempOutputFile << "# @ node = " << nodes_requested << endl;
+ tempOutputFile << "# @ tasks_per_node = " << _nb_proc_per_node << endl;
+ //}
+ //tempOutputFile << "# @ job_type = bluegene" << endl;
+
+ if (params.find(MAXWALLTIME) != params.end())
+ tempOutputFile << "# @ wall_clock_limit = " << params[MAXWALLTIME] << ":00" << endl;
+ if (params.find(MAXRAMSIZE) != params.end())
+ tempOutputFile << "# @ as_limit = " << params[MAXRAMSIZE] << "mb" << endl;
+ if (params.find(QUEUE) != params.end())
+ tempOutputFile << "# @ class = " << params[QUEUE] << endl;
// Define environment for the job
Environnement env = job.getEnvironnement();
tempOutputFile << endl;
}
- tempOutputFile << "# @ job_type = bluegene" << endl;
tempOutputFile << "# @ queue" << endl;
// generate nodes file
void BatchManager_eLL::deleteJob(const JobId & jobid)
{
- throw NotYetImplementedException("BatchManager_eLL::deleteJob");
+ // define command to delete job
+ string subCommand = "llcancel " + jobid.getReference();
+ string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+ cerr << command.c_str() << endl;
+
+ int status = system(command.c_str());
+ if (status)
+ throw EmulationException("Can't delete job " + jobid.getReference());
+
+ cerr << "job " << jobid.getReference() << " killed" << endl;
}
void BatchManager_eLL::holdJob(const JobId & jobid)