Version: 6.5.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
SALOME_ContainerManager Class Reference
Inheritance diagram for SALOME_ContainerManager:
Inheritance graph

Public Member Functions

 SALOME_ContainerManager (CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_ResourcesManager *rm, SALOME_NamingService *ns)
 
 ~SALOME_ContainerManager ()
 
Engines::Container_ptr GiveContainer (const Engines::ContainerParameters &params)
 Give a suitable Container given constraints. More...
 
void ShutdownContainers ()
 Loop on all the containers listed in naming service, ask shutdown on each. More...
 
void Shutdown ()
 shutdown all the containers, then the ContainerManager servant More...
 

Static Public Attributes

static const char * _ContainerManagerNameInNS
 

Protected Types

typedef std::vector< std::string > actual_launch_machine_t
 

Protected Member Functions

Engines::Container_ptr FindContainer (const Engines::ContainerParameters &params, const Engines::ResourceList &possibleResources)
 Find a container given constraints (params) on a list of machines (possibleComputers) More...
 
Engines::Container_ptr FindContainer (const Engines::ContainerParameters &params, const std::string &resource)
 Find a container given constraints (params) on a machine (theMachine) More...
 
std::string BuildCommandToLaunchRemoteContainer (const std::string &resource_name, const Engines::ContainerParameters &params, const std::string &container_exe="SALOME_Container")
 
std::string BuildCommandToLaunchLocalContainer (const Engines::ContainerParameters &params, const std::string &machinesFile, const std::string &container_exe="SALOME_Container")
 
std::string BuildTempFileToLaunchRemoteContainer (const std::string &resource_name, const Engines::ContainerParameters &params) throw (SALOME_Exception)
 
void RmTmpFile (std::string &tmpFile)
 
void AddOmninamesParams (std::string &command) const
 
void AddOmninamesParams (std::ostringstream &oss) const
 
void AddOmninamesParams (std::ofstream &fileStream) const
 
std::string BuildTemporaryFileName () const
 
std::string GetMPIZeroNode (const std::string machine, const std::string machinesFile)
 
std::string machinesFile (const int nbproc)
 
std::set< pid_t > getpidofprogram (const std::string program)
 
std::string getCommandToRunRemoteProcess (AccessProtocolType protocol, const std::string &hostname, const std::string &username)
 
Engines::Container_ptr LaunchContainer (const Engines::ContainerParameters &params, const std::string &resource_selected, const std::string &hostname, const std::string &machFile, const std::string &containerNameInNS)
 
bool checkPaCOParameters (Engines::ContainerParameters &params, std::string resource_selected)
 
Engines::Container_ptr StartPaCOPPContainer (const Engines::ContainerParameters &params, std::string resource_selected)
 
std::string BuildCommandToLaunchPaCOProxyContainer (const Engines::ContainerParameters &params, std::string machine_file_name, std::string &proxy_hostname)
 
std::string BuildCommandToLaunchPaCONodeContainer (const Engines::ContainerParameters &params, const std::string &machine_file_name, SALOME_ContainerManager::actual_launch_machine_t &vect_machine, const std::string &proxy_hostname)
 
void LogConfiguration (const std::string &log_type, const std::string &exe_type, const std::string &container_name, const std::string &hostname, std::string &begin, std::string &end)
 
CORBA::Object_ptr LaunchPaCOProxyContainer (const std::string &command, const Engines::ContainerParameters &params, const std::string &hostname)
 
bool LaunchPaCONodeContainer (const std::string &command, const Engines::ContainerParameters &params, const std::string &name, SALOME_ContainerManager::actual_launch_machine_t &vect_machine)
 

Protected Attributes

CORBA::ORB_var _orb
 
PortableServer::POA_var _poa
 
SALOME_ResourcesManager * _ResManager
 
SALOME_NamingService_NS
 
std::string _TmpFileName
 attribute that contains current tmp files generated More...
 
std::string _CommandForRemAccess
 contains the rsh or ssh command to access directly to machine. More...
 
bool _isAppliSalomeDefined
 different behaviour if $APPLI exists (SALOME Application) More...
 
int _nbprocUsed
 attribute that contains the number of processes used in batch mode by MPI containers More...
 
pid_t _pid_mpiServer
 

Static Protected Attributes

static omni_mutex _numInstanceMutex
 

Constructor & Destructor Documentation

SALOME_ContainerManager::SALOME_ContainerManager ( CORBA::ORB_ptr  orb,
PortableServer::POA_var  poa,
SALOME_ResourcesManager *  rm,
SALOME_NamingService ns 
)

Constructor

Parameters
orbDefine a CORBA single thread policy for the server, which avoid to deal with non thread-safe usage like Change_Directory in SALOME naming service
SALOME_ContainerManager::~SALOME_ContainerManager ( )

destructor

Member Function Documentation

Engines::Container_ptr SALOME_ContainerManager::GiveContainer ( const Engines::ContainerParameters params)

Give a suitable Container given constraints.

CORBA Method:

Parameters
paramsContainer Parameters required for the container
Returns
the container or nil
void SALOME_ContainerManager::ShutdownContainers ( )

Loop on all the containers listed in naming service, ask shutdown on each.

CORBA Method:

void SALOME_ContainerManager::Shutdown ( )

shutdown all the containers, then the ContainerManager servant

CORBA method:

Engines::Container_ptr SALOME_ContainerManager::FindContainer ( const Engines::ContainerParameters params,
const Engines::ResourceList possibleResources 
)
protected

Find a container given constraints (params) on a list of machines (possibleComputers)

Engines::Container_ptr SALOME_ContainerManager::FindContainer ( const Engines::ContainerParameters params,
const std::string &  resource 
)
protected

Find a container given constraints (params) on a machine (theMachine)

std::string SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer ( const std::string &  resource_name,
const Engines::ContainerParameters params,
const std::string &  container_exe = "SALOME_Container" 
)
protected

Builds the script to be launched

If SALOME Application not defined ($APPLI), see BuildTempFileToLaunchRemoteContainer()

Else rely on distant configuration. Command is under the form (example): ssh user distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir \ SALOME_Container containerName &"

  • where user is ommited if not specified in CatalogResources,
  • where distant path is always relative to user $HOME, and equal to $APPLI if not specified in CatalogResources,
  • where hostNS is the hostname of CORBA naming server (set by scripts to use to launch SALOME and servers in $APPLI: runAppli.sh, runRemote.sh)
  • where portNS is the port used by CORBA naming server (set by scripts to use to launch SALOME and servers in $APPLI: runAppli.sh, runRemote.sh)
  • where workingdir is the requested working directory for the container. If WORKINGDIR (and workingdir) is not present the working dir will be $HOME
std::string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer ( const Engines::ContainerParameters params,
const std::string &  machinesFile,
const std::string &  container_exe = "SALOME_Container" 
)
protected

builds the command to be launched.

std::string SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer ( const std::string &  resource_name,
const Engines::ContainerParameters params 
)
throw (SALOME_Exception
)
protected

Builds in a temporary file the script to be launched.

Used if SALOME Application ($APPLI) is not defined. The command is build with data from CatalogResources, in which every path used on remote computer must be defined.

void SALOME_ContainerManager::RmTmpFile ( std::string &  tmpFileName)
protected

removes the generated temporary file in case of a remote launch.

void SALOME_ContainerManager::AddOmninamesParams ( std::string &  command) const
protected

add to command all options relative to naming service.

void SALOME_ContainerManager::AddOmninamesParams ( std::ostringstream &  oss) const
protected

add to command all options relative to naming service.

void SALOME_ContainerManager::AddOmninamesParams ( std::ofstream &  fileStream) const
protected

add to command all options relative to naming service.

std::string SALOME_ContainerManager::BuildTemporaryFileName ( ) const
protected

generate a file name in /tmp directory

Field Documentation

const char * SALOME_ContainerManager::_ContainerManagerNameInNS
static
Initial value:
=
"/ContainerManager"
std::string SALOME_ContainerManager::_TmpFileName
protected

attribute that contains current tmp files generated

std::string SALOME_ContainerManager::_CommandForRemAccess
protected

contains the rsh or ssh command to access directly to machine.

bool SALOME_ContainerManager::_isAppliSalomeDefined
protected

different behaviour if $APPLI exists (SALOME Application)

int SALOME_ContainerManager::_nbprocUsed
protected

attribute that contains the number of processes used in batch mode by MPI containers

Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS