#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()
{
- MESSAGE ( "Launcher_cpp constructor" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Launcher_cpp constructor" << endl;
+#endif
}
//=============================================================================
Launcher_cpp::~Launcher_cpp()
{
- MESSAGE ( "Launcher_cpp destructor" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Launcher_cpp destructor" << endl;
+#endif
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)
{
- MESSAGE ( "BEGIN OF Launcher_cpp::submitSalomeJob" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "BEGIN OF Launcher_cpp::submitSalomeJob" << endl;
+#endif
long jobId;
vector<string> aMachineList;
ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]);
string clustername(p.Alias);
- MESSAGE ( "Choose cluster: " << clustername );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Choose cluster: " << clustername << endl;
+#endif
// 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;
}
- MESSAGE ( "Instanciation of batch manager" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Instanciation of batch manager" << endl;
+#endif
switch( params.Batch ){
case pbs:
- MESSAGE ( "Instantiation of PBS batch manager" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Instantiation of PBS batch manager" << endl;
+#endif
fact = new Batch::FactBatchManager_ePBS;
break;
case lsf:
- MESSAGE ( "Instantiation of LSF batch manager" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Instantiation of LSF batch manager" << endl;
+#endif
fact = new Batch::FactBatchManager_eLSF;
break;
default:
- MESSAGE ( "BATCH = " << params.Batch );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "BATCH = " << params.Batch << endl;
+#endif
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);
- MESSAGE ( TmpFileName.c_str() );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << TmpFileName.c_str() << endl;
+#endif
delete mpiImpl;
bool Launcher_cpp::check(const batchParams& batch_params)
{
bool rtn = true;
- MESSAGE ( "Job parameters are :" );
- MESSAGE ( "Directory : $HOME/Batch/$date" );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Job parameters are :" << endl;
+ cerr << "Directory : $HOME/Batch/$date" << endl;
+#endif
// check expected_during_time (check the format)
std::string edt_info = batch_params.expected_during_time;
else {
edt_info = "No value given";
}
- MESSAGE ( "Expected during time : " << edt_info );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Expected during time : " << edt_info << endl;;
+#endif
// check memory (check the format)
std::string mem_info;
else {
mem_info = "No value given";
}
- MESSAGE ( "Memory : " << mem_info );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Memory : " << mem_info << endl;
+#endif
// check nb_proc
std::string nb_proc_info;
else {
nb_proc_info = nb_proc_value.str();
}
- MESSAGE ( "Nb of processors : " << nb_proc_info );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ cerr << "Nb of processors : " << nb_proc_info << endl;
+#endif
return rtn;
}
command += p.Alias;
command += " 'echo $HOME' > ";
command += filelogtemp;
- MESSAGE ( command.c_str() );
+#if defined(_DEBUG_) || defined(_DEBUG)
+ std::cerr << command.c_str() << std::endl;
+#endif
int status = system(command.c_str());
if(status)
throw LauncherException("Error of launching home command on remote host");