23 #ifndef __SALOME_CONTAINERMANAGER_HXX__ 
   24 #define __SALOME_CONTAINERMANAGER_HXX__ 
   26 #include "SALOME_Container.hxx" 
   28 #include <SALOMEconfig.h> 
   29 #include CORBA_CLIENT_HEADER(SALOME_Component) 
   30 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) 
   31 #include "SALOME_ResourcesCatalog_Parser.hxx" 
   33 #include "Utils_Mutex.hxx" 
   39 class SALOME_ResourcesManager_Client;
 
   51   void ShutdownContainers();
 
   56   static const char *_ContainerManagerNameInNS;
 
   60   Engines::Container_ptr
 
   64   Engines::Container_ptr
 
   66                 const std::string& resource);
 
   68   std::string BuildCommandToLaunchRemoteContainer(
const std::string & resource_name,
 
   70                                                   const std::string& container_exe=
"SALOME_Container") 
const;
 
   73                                                  const std::string& machinesFile,
 
   74                                                  const std::string& container_exe,
 
   75                                                  std::string& tmpFileName) 
const;
 
   77   std::string BuildTempFileToLaunchRemoteContainer(
const std::string& resource_name,
 
   80   static void RmTmpFile(std::string& tmpFile);
 
   82   void AddOmninamesParams(std::string& command) 
const;
 
   84   void AddOmninamesParams(std::ostream& fileStream) 
const;
 
   86   static std::string BuildTemporaryFileName();
 
   88   std::string GetMPIZeroNode(
const std::string machine, 
const std::string machinesFile) 
const;
 
   90   std::string machinesFile(
const int nbproc);
 
   92   std::set<pid_t> getpidofprogram(
const std::string program);
 
   94  static std::string getCommandToRunRemoteProcess(AccessProtocolType protocol, 
const std::string & hostname, 
const std::string & username);
 
   96   Engines::Container_ptr
 
   98                   const std::string & resource_selected,
 
   99                   const std::string & hostname,
 
  100                   const std::string & machFile,
 
  101                   const std::string & containerNameInNS);
 
  104   PortableServer::POA_var _poa;
 
  106   SALOME_ResourcesManager_Client *_resManager;
 
  120   pid_t _pid_mpiServer;
 
  123   typedef std::vector<std::string> actual_launch_machine_t;
 
  127   Engines::Container_ptr
 
  133                                                      std::string machine_file_name,
 
  134                                                      std::string & proxy_hostname);
 
  137                                                     const std::string & machine_file_name,
 
  138                                                     SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
 
  139                                                     const std::string & proxy_hostname);
 
  141   void LogConfiguration(
const std::string & log_type,
 
  142                         const std::string & exe_type,
 
  143                         const std::string & container_name,
 
  144                         const std::string & hostname,
 
  149   LaunchPaCOProxyContainer(
const std::string& command,
 
  151                            const std::string& hostname);
 
  154   LaunchPaCONodeContainer(
const std::string& command,
 
  156                           const std::string& name,
 
  157                           SALOME_ContainerManager::actual_launch_machine_t & vect_machine);
 
  160   static char *GetenvThreadSafe(
const char *name);
 
  161   static std::string GetenvThreadSafeAsString(
const char *name);
 
  162   static int SystemThreadSafe(
const char *command);
 
  164   static void MakeTheCommandToBeLaunchedASync(std::string& command);
 
  165   static int GetTimeOutToLoaunchServer();
 
  166   static void SleepInSecond(
int ellapseTimeInSecond);
 
  168   static const int TIME_OUT_TO_LAUNCH_CONT;