SALOME documentation central

SALOME_ContainerManager Class Reference

Inheritance diagram for SALOME_ContainerManager:

Public Member Functions

 SALOME_ContainerManager (CORBA::ORB_ptr orb, PortableServer::POA_var poa, SALOME_ResourcesManager *rm, SALOME_NamingService *ns)
 ~SALOME_ContainerManager ()
void Shutdown ()
 shutdown all the containers, then the ContainerManager servant
void ShutdownContainers ()
 Loop on all the containers listed in naming service, ask shutdown on each.
Engines::Container_ptr StartContainer (const Engines::MachineParameters &params, const Engines::MachineList &possibleComputer, const std::string &container_exe="SALOME_Container")
 Start a suitable Container in a list of machines with constraints.
Engines::Container_ptr StartContainer (const Engines::MachineParameters &params)
 Start a suitable Container given constraints.
Engines::Container_ptr GiveContainer (const Engines::MachineParameters &params)
 Give a suitable Container given constraints.
Engines::Container_ptr FindOrStartContainer (const Engines::MachineParameters &params)
 Find or start a suitable Container given some constraints.
Engines::Container_ptr StartParallelContainer (const Engines::MachineParameters &params)

Static Public Attributes

static const char * _ContainerManagerNameInNS = "/ContainerManager"

Protected Types

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

Protected Member Functions

Engines::Container_ptr FindContainer (const Engines::MachineParameters &params, const Engines::MachineList &possibleComputers)
 Find a container given constraints (params) on a list of machines (possibleComputers)
Engines::Container_ptr FindContainer (const Engines::MachineParameters &params, const char *theMachine)
 Find a container given constraints (params) on a machine (theMachine)
void fillBatchLaunchedContainers ()
std::string BuildCommandToLaunchRemoteContainer (const std::string &machine, const Engines::MachineParameters &params, const std::string &container_exe="SALOME_Container")
std::string BuildCommandToLaunchLocalContainer (const Engines::MachineParameters &params, const std::string &container_exe="SALOME_Container")
std::string BuildTempFileToLaunchRemoteContainer (const std::string &machine, const Engines::MachineParameters &params) throw (SALOME_Exception)
void RmTmpFile (std::string &tmpFile)
void AddOmninamesParams (std::string &command) const
void AddOmninamesParams (std::ofstream &fileStream) const
std::string BuildTemporaryFileName () const
std::string GetMPIZeroNode (std::string machine)
std::string BuildCommandToLaunchParallelContainer (const std::string &exe_name, const Engines::MachineParameters &params, SALOME_ContainerManager::actual_launch_machine_t &vect_machine, const std::string proxy_hostname="")
CORBA::Object_ptr LaunchParallelContainer (const std::string &command, const Engines::MachineParameters &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
std::string _CommandForRemAccess
 contains the rsh or ssh command to access directly to machine.
bool _isAppliSalomeDefined
 different behaviour if $APPLI exists (SALOME Application)

Static Protected Attributes

static std::vector
< Engines::Container_ptr > 
_batchLaunchedContainers
static std::vector
< Engines::Container_ptr >
::iterator 
_batchLaunchedContainersIter

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

void SALOME_ContainerManager::Shutdown ( )

shutdown all the containers, then the ContainerManager servant

CORBA method:

void SALOME_ContainerManager::ShutdownContainers ( )

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

CORBA Method:

Engines::Container_ptr SALOME_ContainerManager::StartContainer ( const Engines::MachineParameters params,
const Engines::MachineList possibleComputers,
const std::string &  container_exe = "SALOME_Container" 
)

Start a suitable Container in a list of machines with constraints.

C++ Method: Constraints are given by a machine parameters struct

Parameters:
paramsMachine Parameters required for the container
possibleComputerslist of machines usable for start
container_exespecific container executable (default=SALOME_Container)
Engines::Container_ptr SALOME_ContainerManager::StartContainer ( const Engines::MachineParameters params)

Start a suitable Container given constraints.

CORBA Method:

Parameters:
paramsMachine Parameters required for the container
Engines::Container_ptr SALOME_ContainerManager::GiveContainer ( const Engines::MachineParameters params)

Give a suitable Container given constraints.

CORBA Method:

Parameters:
paramsMachine Parameters required for the container
Returns:
the container or nil
Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer ( const Engines::MachineParameters params)

Find or start a suitable Container given some constraints.

CORBA Method:

Parameters:
paramsMachine Parameters required for the container
Returns:
the container or nil
Engines::Container_ptr SALOME_ContainerManager::StartParallelContainer ( const Engines::MachineParameters params)

CORBA Method: Find or Start a suitable PaCO++ Parallel Container in a list of machines.

Parameters:
paramsMachine Parameters required for the container
Returns:
CORBA container reference.
Engines::Container_ptr SALOME_ContainerManager::FindContainer ( const Engines::MachineParameters params,
const Engines::MachineList possibleComputers 
) [protected]

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

Engines::Container_ptr SALOME_ContainerManager::FindContainer ( const Engines::MachineParameters params,
const char *  theMachine 
) [protected]

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

string SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer ( const std::string &  machine,
const Engines::MachineParameters 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
string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer ( const Engines::MachineParameters params,
const std::string &  container_exe = "SALOME_Container" 
) [protected]

builds the command to be launched.

string SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer ( const std::string &  machine,
const Engines::MachineParameters 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.

string SALOME_ContainerManager::BuildTemporaryFileName ( ) const [protected]

generate a file name in /tmp directory

string SALOME_ContainerManager::BuildCommandToLaunchParallelContainer ( const std::string &  exe_name,
const Engines::MachineParameters params,
SALOME_ContainerManager::actual_launch_machine_t &  vect_machine,
const std::string  proxy_hostname = "" 
) [protected]

Creates a command line that the container manager uses to launch a parallel container.

CORBA::Object_ptr SALOME_ContainerManager::LaunchParallelContainer ( const std::string &  command,
const Engines::MachineParameters params,
const std::string &  name,
SALOME_ContainerManager::actual_launch_machine_t &  vect_machine 
) [protected]

This method launches the parallel container. It will may be placed on the ressources manager.

Parameters:
commandto launch
container'sparameters
nameof the container
Returns:
CORBA container reference

Field Documentation

std::string SALOME_ContainerManager::_TmpFileName [protected]

attribute that contains current tmp files generated

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

different behaviour if $APPLI exists (SALOME Application)