Parametre params = job.getParametre();
Versatile V = params[INFILE];
Versatile::iterator Vit;
- _username = string(params[USER]);
- string subCommand = string("mkdir -p ") + string(params[TMPDIR]) + string("/logs");
- string command = _protocol.getExecCommand(subCommand, _hostname, _username);
- cerr << command.c_str() << endl;
- status = system(command.c_str());
+ status = _protocol.makeDirectory(string(params[TMPDIR]) + "/logs", _hostname, _username);
if(status) {
std::ostringstream oss;
oss << status;
#ifdef WIN32
// On Windows, we make the remote file executable afterward because
// pscp does not preserve access permissions on files
- subCommand = string("chmod u+x ") + string(params[TMPDIR]) + "/" +
- string(params[EXECUTABLE]);
- command = _protocol.getExecCommand(subCommand, _hostname, _username);
+ string subCommand = string("chmod u+x ") + string(params[TMPDIR]) + "/" +
+ string(params[EXECUTABLE]);
+ string command = _protocol.getExecCommand(subCommand, _hostname, _username);
cerr << command.c_str() << endl;
status = system(command.c_str());
if(status) {
}
- void BatchManager_eClient::importOutputFiles( const Job & job, const string directory ) throw(EmulationException)
+ void BatchManager_eClient::importOutputFiles( const Job & job, const string directory )
{
Parametre params = job.getParametre();
Versatile V = params[OUTFILE];
Versatile::iterator Vit;
_username = string(params[USER]);
+ // Create local result directory
+ int status = CommunicationProtocol::getInstance(SH).makeDirectory(directory, "", "");
+ if (status) {
+ string mess("Directory creation failed. Status is :");
+ ostringstream status_str;
+ status_str << status;
+ mess += status_str.str();
+ cerr << mess << endl;
+ }
+
for(Vit=V.begin(); Vit!=V.end(); Vit++) {
CoupleType cpt = *static_cast< CoupleType * >(*Vit);
Couple outputFile = cpt;
- int status = _protocol.copyFile(outputFile.getRemote(), _hostname, _username,
- directory, "", "");
+ status = _protocol.copyFile(outputFile.getRemote(), _hostname, _username,
+ directory, "", "");
if (status) {
// Try to get what we can (logs files)
// throw BatchException("Error of connection on remote host");
}
// Copy logs
- int status = _protocol.copyFile(string(params[TMPDIR]) + string("/logs"), _hostname, _username,
- directory, "", "");
+ status = _protocol.copyFile(string(params[TMPDIR]) + string("/logs"), _hostname, _username,
+ directory, "", "");
if (status) {
std::string mess("Copy logs directory failed ! status is :");
ostringstream status_str;
}
- MpiImpl *BatchManager_eClient::FactoryMpiImpl(string mpiImpl) throw(EmulationException)
+ MpiImpl *BatchManager_eClient::FactoryMpiImpl(string mpiImpl)
{
if(mpiImpl == "lam")
return new MpiImpl_LAM();
const std::string & BatchManager_eClient::getTmpDir()
{
if (tmpDirName.empty()) {
- char * baseDir = getenv("TEMP");
+ const char * baseDir = getenv("TEMP");
if (baseDir == NULL) baseDir = getenv("TMP");
if (baseDir == NULL) baseDir = getenv("TEMPDIR");
if (baseDir == NULL) baseDir = getenv("TMPDIR");
if (baseDir == NULL) baseDir = "/tmp";
- char * userName = getenv("USER");
+ const char * userName = getenv("USER");
if (userName == NULL) userName = getenv("USERNAME");
if (userName == NULL) userName = "unknown";