#include "Batch_FactBatchManager_eLSF.hxx"
#include "Batch_FactBatchManager_ePBS.hxx"
#include "Launcher.hxx"
+#include "utilities.h"
#include <iostream>
#include <sstream>
#include <sys/stat.h>
Launcher_cpp::Launcher_cpp()
{
- cerr << "Launcher_cpp constructor" << endl;
+ MESSAGE ( "Launcher_cpp constructor" );
}
//=============================================================================
Launcher_cpp::~Launcher_cpp()
{
- cerr << "Launcher_cpp destructor" << endl;
+ MESSAGE ( "Launcher_cpp destructor" );
std::map < string, Batch::BatchManager_eClient * >::const_iterator it1;
for(it1=_batchmap.begin();it1!=_batchmap.end();it1++)
delete it1->second;
const batchParams& batch_params,
const machineParams& params) throw(LauncherException)
{
- cerr << "BEGIN OF Launcher_cpp::submitSalomeJob" << endl;
+ MESSAGE ( "BEGIN OF Launcher_cpp::submitSalomeJob" );
long jobId;
vector<string> aMachineList;
ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]);
string clustername(p.Alias);
- cerr << "Choose cluster: " << clustername << endl;
+ MESSAGE ( "Choose cluster: " << clustername );
// search batch manager for that cluster in map or instanciate one
map < string, Batch::BatchManager_eClient * >::const_iterator it = _batchmap.find(clustername);
mpi = "indif";
break;
}
- cerr << "Instanciation of batch manager" << endl;
+ MESSAGE ( "Instanciation of batch manager" );
switch( params.Batch ){
case pbs:
- cerr << "Instantiation of PBS batch manager" << endl;
+ MESSAGE ( "Instantiation of PBS batch manager" );
fact = new Batch::FactBatchManager_ePBS;
break;
case lsf:
- cerr << "Instantiation of LSF batch manager" << endl;
+ MESSAGE ( "Instantiation of LSF batch manager" );
fact = new Batch::FactBatchManager_eLSF;
break;
default:
- cerr << "BATCH = " << params.Batch << endl;
+ MESSAGE ( "BATCH = " << params.Batch );
throw LauncherException("no batchmanager for that cluster");
}
return (*fact)(hostname.c_str(),protocol.c_str(),mpi.c_str());
tempOutputFile.flush();
tempOutputFile.close();
chmod(TmpFileName.c_str(), 0x1ED);
- cerr << TmpFileName.c_str() << endl;
+ MESSAGE ( TmpFileName.c_str() );
delete mpiImpl;
bool Launcher_cpp::check(const batchParams& batch_params)
{
bool rtn = true;
- cerr << "Job parameters are :" << endl;
- cerr << "Directory : $HOME/Batch/$date" << endl;
+ MESSAGE ( "Job parameters are :" );
+ MESSAGE ( "Directory : $HOME/Batch/$date" );
// check expected_during_time (check the format)
std::string edt_info = batch_params.expected_during_time;
else {
edt_info = "No value given";
}
- cerr << "Expected during time : " << edt_info << endl;;
+ MESSAGE ( "Expected during time : " << edt_info );
// check memory (check the format)
std::string mem_info;
else {
mem_info = "No value given";
}
- cerr << "Memory : " << mem_info << endl;
+ MESSAGE ( "Memory : " << mem_info );
// check nb_proc
std::string nb_proc_info;
else {
nb_proc_info = nb_proc_value.str();
}
- cerr << "Nb of processors : " << nb_proc_info << endl;
+ MESSAGE ( "Nb of processors : " << nb_proc_info );
return rtn;
}
command += p.Alias;
command += " 'echo $HOME' > ";
command += filelogtemp;
- std::cerr << command.c_str() << std::endl;
+ MESSAGE ( command.c_str() );
int status = system(command.c_str());
if(status)
throw LauncherException("Error of launching home command on remote host");