From: vsr Date: Mon, 8 Sep 2008 06:37:02 +0000 (+0000) Subject: Remove debug output from terminal. Avoid using "utilities.h" in standalone (non-CORBA... X-Git-Tag: TG_TRIPOLI_qt4_porting~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=175c988e0d3b6d8ff4360562e0da7bc8d33a9ec1;p=modules%2Fkernel.git Remove debug output from terminal. Avoid using "utilities.h" in standalone (non-CORBA) classes (requested by B.Sécher via mail) --- diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 279672a15..589ec566f 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -24,7 +24,6 @@ #include "Batch_FactBatchManager_eLSF.hxx" #include "Batch_FactBatchManager_ePBS.hxx" #include "Batch_BatchManager_eClient.hxx" -#include "utilities.h" #include #include @@ -43,7 +42,9 @@ using namespace std; Launcher_cpp::Launcher_cpp() { - MESSAGE ( "Launcher_cpp constructor" ); +#if defined(_DEBUG_) || defined(_DEBUG) + cerr << "Launcher_cpp constructor" << endl; +#endif } //============================================================================= @@ -54,7 +55,9 @@ Launcher_cpp::Launcher_cpp() 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; @@ -78,7 +81,9 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute , 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 aMachineList; @@ -99,7 +104,9 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute , 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); @@ -290,18 +297,26 @@ Batch::BatchManager_eClient *Launcher_cpp::FactoryBatchManager( const ParserReso 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()); @@ -412,7 +427,9 @@ string Launcher_cpp::buildSalomeCouplingScript(const string fileToExecute, const 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; @@ -479,8 +496,10 @@ string Launcher_cpp::getRemoteFile( std::string remoteDir, std::string localFile 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; @@ -517,7 +536,9 @@ bool Launcher_cpp::check(const batchParams& batch_params) 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; @@ -543,7 +564,9 @@ bool Launcher_cpp::check(const batchParams& batch_params) 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; @@ -557,7 +580,9 @@ bool Launcher_cpp::check(const batchParams& batch_params) 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; } @@ -625,7 +650,9 @@ Launcher_cpp::getHomeDir(const ParserResourcesType& p, const std::string& tmpdir 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");