X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FContainer%2FSALOME_ContainerManager.hxx;h=3aa4b4a7e04c237e5c2fa8f4b55833b1ede9ec2c;hb=32cb9f7cf3440f3c495de75632b4cefbd23298a2;hp=1f64f7b65f6aaf9235de1aabe245e105cf98800a;hpb=a63265d524e8436588a7bb82147a69812c153b1b;p=modules%2Fkernel.git diff --git a/src/Container/SALOME_ContainerManager.hxx b/src/Container/SALOME_ContainerManager.hxx index 1f64f7b65..3aa4b4a7e 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -31,13 +31,14 @@ #include "SALOME_ResourcesManager.hxx" #include "SALOME_LoadRateManager.hxx" +#include "Utils_Mutex.hxx" + #include #include class SALOME_NamingService; -class CONTAINER_EXPORT SALOME_ContainerManager: - public POA_Engines::ContainerManager +class CONTAINER_EXPORT SALOME_ContainerManager : public POA_Engines::ContainerManager { public: @@ -45,8 +46,7 @@ public: ~SALOME_ContainerManager(); // Corba Methods - Engines::Container_ptr - GiveContainer(const Engines::ContainerParameters& params); + Engines::Container_ptr GiveContainer(const Engines::ContainerParameters& params); void ShutdownContainers(); @@ -67,16 +67,17 @@ protected: std::string BuildCommandToLaunchRemoteContainer(const std::string & resource_name, const Engines::ContainerParameters& params, - const std::string& container_exe="SALOME_Container"); + const std::string& container_exe="SALOME_Container") const; std::string BuildCommandToLaunchLocalContainer(const Engines::ContainerParameters& params, const std::string& machinesFile, - const std::string& container_exe="SALOME_Container"); + const std::string& container_exe,//"SALOME_Container" + std::string& tmpFileName) const; std::string BuildTempFileToLaunchRemoteContainer(const std::string& resource_name, - const Engines::ContainerParameters& params) throw(SALOME_Exception); + const Engines::ContainerParameters& params, std::string& tmpFileName) const throw(SALOME_Exception); - void RmTmpFile(std::string& tmpFile); + static void RmTmpFile(std::string& tmpFile); void AddOmninamesParams(std::string& command) const; @@ -84,17 +85,15 @@ protected: void AddOmninamesParams(std::ofstream& fileStream) const; - std::string BuildTemporaryFileName() const; + static std::string BuildTemporaryFileName(); - std::string GetMPIZeroNode(const std::string machine, const std::string machinesFile); + std::string GetMPIZeroNode(const std::string machine, const std::string machinesFile) const; std::string machinesFile(const int nbproc); std::set getpidofprogram(const std::string program); - std::string getCommandToRunRemoteProcess(AccessProtocolType protocol, - const std::string & hostname, - const std::string & username); + static std::string getCommandToRunRemoteProcess(AccessProtocolType protocol, const std::string & hostname, const std::string & username); Engines::Container_ptr LaunchContainer(const Engines::ContainerParameters& params, @@ -109,13 +108,6 @@ protected: SALOME_ResourcesManager *_ResManager; SALOME_NamingService *_NS; - //! attribute that contains current tmp files generated - std::string _TmpFileName; - - //! contains the rsh or ssh command to access directly to machine. - // Only used by this->RmTmpFile in case of a remote launch. - std::string _CommandForRemAccess; - //! different behaviour if $APPLI exists (SALOME Application) bool _isAppliSalomeDefined; @@ -124,6 +116,9 @@ protected: static omni_mutex _numInstanceMutex ; // lib and instance protection + //! attributes to allow concurrency for // GiveContainer + Utils_Mutex _giveContainerMutex1; + pid_t _pid_mpiServer; // Begin of PacO++ Parallel extension @@ -163,5 +158,11 @@ protected: const std::string& name, SALOME_ContainerManager::actual_launch_machine_t & vect_machine); // End of PaCO++ Parallel extension +public: + static char *GetenvThreadSafe(const char *name); + static int SystemThreadSafe(const char *command); +private: + static Utils_Mutex _getenvMutex; + static Utils_Mutex _systemMutex; }; #endif