Salome HOME
Remove debug output from terminal. Avoid using "utilities.h" in standalone (non-CORBA...
authorvsr <vsr@opencascade.com>
Mon, 8 Sep 2008 06:37:02 +0000 (06:37 +0000)
committervsr <vsr@opencascade.com>
Mon, 8 Sep 2008 06:37:02 +0000 (06:37 +0000)
src/Launcher/Launcher.cxx

index 279672a155d19eecbdb2b16e4bd94bf3dda963c5..589ec566f190129d9b9d01f6e208f8cfaa19d0e1 100644 (file)
@@ -24,7 +24,6 @@
 #include "Batch_FactBatchManager_eLSF.hxx"
 #include "Batch_FactBatchManager_ePBS.hxx"
 #include "Batch_BatchManager_eClient.hxx"
-#include "utilities.h"
 
 #include <iostream>
 #include <sstream>
@@ -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<string> 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");