General KERNEL Documentation     End User KERNEL Services  


Engines_MPIContainer_i Class Reference

#include <MPIContainer_i.hxx>

Inheritance diagram for Engines_MPIContainer_i:

Inheritance graph
Collaboration diagram for Engines_MPIContainer_i:

Collaboration graph

Public Member Functions

 Engines_MPIContainer_i (int nbproc, int numproc, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char *containerName, int argc, char *argv[])
 Engines_MPIContainer_i (int nbproc, int numproc)
 ~Engines_MPIContainer_i ()
void Shutdown ()
bool load_component_Library (const char *componentName)
void Asload_component_Library (const char *componentName)
Engines::Component_ptr create_component_instance (const char *componentName, CORBA::Long studyId)
void Ascreate_component_instance (const char *componentName, CORBA::Long studyId)
Engines::Component_ptr load_impl (const char *nameToRegister, const char *componentName)
void Asload_impl (const char *nameToRegister, const char *componentName)
void remove_impl (Engines::Component_ptr component_i)
void Asremove_impl (Engines::Component_ptr component_i)
void finalize_removal ()
void Asfinalize_removal ()
Engines::Component_ptr find_component_instance (const char *registeredName, CORBA::Long studyId)
virtual void ping ()
char * name ()
char * getHostName ()
CORBA::Long getPID ()
bool Kill_impl ()
 Kill current container.
Engines::fileRef_ptr createFileRef (const char *origFileName)
Engines::fileTransfer_ptr getFileTransfer ()
Engines::Component_ptr find_or_create_instance (std::string genericRegisterName, std::string componentLibraryName)
Engines::Component_ptr createInstance (std::string genericRegisterName, void *handle, int studyId)
int getArgc ()
char ** getArgv ()
Engines::IORTabtior ()
void tior (const Engines::IORTab &ior)

Static Public Member Functions

static bool isPythonContainer (const char *ContainerName)
static void decInstanceCnt (std::string genericRegisterName)

Protected Member Functions

void BCastIOR (CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, bool amiCont)

Protected Attributes

bool _isSupervContainer
SALOME_NamingService_NS
std::string _library_path
std::string _containerName
CORBA::ORB_var _orb
PortableServer::POA_var _poa
PortableServer::ObjectId * _id
int _numInstance
std::map< std::string, Engines::Component_var > _listInstances_map
std::map< std::string, Engines::fileRef_var > _fileRef_map
Engines::fileTransfer_var _fileTransfer
int _argc
char ** _argv
long _pid
bool _isServantAloneInProcess
int _numproc
int _nbproc
Engines::IORTab_tior

Static Protected Attributes

static std::map< std::string,
int > 
_cntInstances_map
static std::map< std::string,
void * > 
_library_map
static std::map< std::string,
void * > 
_toRemove_map
static omni_mutex _numInstanceMutex

Private Member Functions

bool Lload_component_Library (const char *componentName)
Engines::Component_ptr Lcreate_component_instance (const char *componentName, CORBA::Long studyId)
Engines::Component_ptr Lload_impl (const char *nameToRegister, const char *componentName)
void Lremove_impl (Engines::Component_ptr component_i)
void Lfinalize_removal ()
Engines::Component_ptr createMPIInstance (std::string genericRegisterName, void *handle, int studyId)

Constructor & Destructor Documentation

Engines_MPIContainer_i::Engines_MPIContainer_i int  nbproc,
int  numproc,
CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa,
char *  containerName,
int  argc,
char *  argv[]
 

Engines_MPIContainer_i::Engines_MPIContainer_i int  nbproc,
int  numproc
 

Engines_MPIContainer_i::~Engines_MPIContainer_i  ) 
 


Member Function Documentation

void Engines_MPIContainer_i::Shutdown  )  [virtual]
 

CORBA method, oneway: Server shutdown.

  • Container name removed from naming service,
  • servant deactivation,
  • orb shutdown if no other servants in the process

Reimplemented from Engines_Container_i.

bool Engines_MPIContainer_i::load_component_Library const char *  componentName  )  [virtual]
 

CORBA method: load a new component class (Python or C++ implementation)

Parameters:
componentName like COMPONENT try to make a Python import of COMPONENT, then a lib open of libCOMPONENTEngine.so
Returns:
true if dlopen successfull or already done, false otherwise

Reimplemented from Engines_Container_i.

void Engines_MPIContainer_i::Asload_component_Library const char *  componentName  ) 
 

Engines::Component_ptr Engines_MPIContainer_i::create_component_instance const char *  componentName,
CORBA::Long  studyId
[virtual]
 

CORBA method: Creates a new servant instance of a component. The servant registers itself to naming service and Registry.

Parameters:
genericRegisterName Name of the component instance to register in Registry & Name Service (without _inst_n suffix)
studyId 0 for multiStudy instance, study Id (>0) otherwise
Returns:
a loaded component

Reimplemented from Engines_Container_i.

void Engines_MPIContainer_i::Ascreate_component_instance const char *  componentName,
CORBA::Long  studyId
 

Engines::Component_ptr Engines_MPIContainer_i::load_impl const char *  nameToRegister,
const char *  componentName
 

CORBA method: find or create an instance of the component (servant), load a new component class (dynamic library) if required, ---- FOR COMPATIBILITY WITH 2.2 ---- ---- USE ONLY FOR MULTISTUDY INSTANCES ! -------- The servant registers itself to naming service and Registry.

Parameters:
genericRegisterName Name of the component to register in Registry & Name Service
componentName Name of the constructed library of the component
Returns:
a loaded component

Reimplemented from Engines_Container_i.

void Engines_MPIContainer_i::Asload_impl const char *  nameToRegister,
const char *  componentName
 

void Engines_MPIContainer_i::remove_impl Engines::Component_ptr  component_i  ) 
 

CORBA method: Stops the component servant, and deletes all related objects

Parameters:
component_i Component to be removed

Reimplemented from Engines_Container_i.

void Engines_MPIContainer_i::Asremove_impl Engines::Component_ptr  component_i  ) 
 

void Engines_MPIContainer_i::finalize_removal  ) 
 

CORBA method: Discharges unused libraries from the container.

Reimplemented from Engines_Container_i.

void Engines_MPIContainer_i::Asfinalize_removal  ) 
 

bool Engines_MPIContainer_i::Lload_component_Library const char *  componentName  )  [private]
 

Engines::Component_ptr Engines_MPIContainer_i::Lcreate_component_instance const char *  componentName,
CORBA::Long  studyId
[private]
 

Engines::Component_ptr Engines_MPIContainer_i::Lload_impl const char *  nameToRegister,
const char *  componentName
[private]
 

void Engines_MPIContainer_i::Lremove_impl Engines::Component_ptr  component_i  )  [private]
 

void Engines_MPIContainer_i::Lfinalize_removal  )  [private]
 

Engines::Component_ptr Engines_MPIContainer_i::createMPIInstance std::string  genericRegisterName,
void *  handle,
int  studyId
[private]
 

Engines::Component_ptr Engines_Container_i::find_component_instance const char *  registeredName,
CORBA::Long  studyId
[inherited]
 

CORBA method: Finds a servant instance of a component

Parameters:
registeredName Name of the component in Registry or Name Service, without instance suffix number
studyId 0 if instance is not associated to a study, >0 otherwise (== study id)
Returns:
the first instance found with same studyId

void Engines_Container_i::ping  )  [virtual, inherited]
 

CORBA method: check if servant is still alive

char * Engines_Container_i::name  )  [inherited]
 

CORBA attribute: Container name (see constructor)

char * Engines_Container_i::getHostName  )  [inherited]
 

CORBA method: Get the hostName of the Container (without domain extensions)

CORBA::Long Engines_Container_i::getPID  )  [inherited]
 

CORBA method: Get the PID (process identification) of the Container

bool Engines_Container_i::Kill_impl  )  [inherited]
 

CORBA method: Kill the container process with exit(0). To remove : never returns !

Engines::fileRef_ptr Engines_Container_i::createFileRef const char *  origFileName  )  [inherited]
 

CORBA method: get or create a fileRef object associated to a local file (a file on the computer on which runs the container server), which stores a list of (machine, localFileName) corresponding to copies already done.

Parameters:
origFileName absolute path for a local file to copy on other computers
Returns:
a fileRef object associated to the file.

Engines::fileTransfer_ptr Engines_Container_i::getFileTransfer  )  [inherited]
 

CORBA method:

Returns:
a reference to the fileTransfer object

Engines::Component_ptr Engines_Container_i::find_or_create_instance std::string  genericRegisterName,
std::string  componentLibraryName
[inherited]
 

C++ method: Finds an already existing servant instance of a component, or create an instance. ---- USE ONLY FOR MULTISTUDY INSTANCES ! --------

Parameters:
genericRegisterName Name of the component instance to register in Registry & Name Service, (without _inst_n suffix, like "COMPONENT")
componentLibraryName like "libCOMPONENTEngine.so"
Returns:
a loaded component
example with names: aGenRegisterName = COMPONENT (= first argument) impl_name = libCOMPONENTEngine.so (= second argument) _containerName = /Containers/cli76ce/FactoryServer factoryName = COMPONENTEngine_factory component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT

instanceName = COMPONENT_inst_1 component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1

Engines::Component_ptr Engines_Container_i::createInstance std::string  genericRegisterName,
void *  handle,
int  studyId
[inherited]
 

C++ method: create a servant instance of a component.

Parameters:
genericRegisterName Name of the component instance to register in Registry & Name Service, (without _inst_n suffix, like "COMPONENT")
handle loaded library handle
studyId 0 for multiStudy instance, study Id (>0) otherwise
Returns:
a loaded component
example with names: aGenRegisterName = COMPONENT (= first argument) _containerName = /Containers/cli76ce/FactoryServer factoryName = COMPONENTEngine_factory component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT instanceName = COMPONENT_inst_1 component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1

bool Engines_Container_i::isPythonContainer const char *  ContainerName  )  [static, inherited]
 

Retrieves only with container naming convention if it is a python container

void Engines_Container_i::decInstanceCnt std::string  genericRegisterName  )  [static, inherited]
 

int Engines_Container_i::getArgc  )  [inline, inherited]
 

char** Engines_Container_i::getArgv  )  [inline, inherited]
 

Engines::IORTab * MPIObject_i::tior  )  [inherited]
 

void MPIObject_i::tior const Engines::IORTab ior  )  [inherited]
 

void MPIObject_i::BCastIOR CORBA::ORB_ptr  orb,
Engines::MPIObject_ptr  pobj,
bool  amiCont
[protected, inherited]
 


Field Documentation

map< std::string, int > Engines_Container_i::_cntInstances_map [static, protected, inherited]
 

map< std::string, void * > Engines_Container_i::_library_map [static, protected, inherited]
 

map< std::string, void * > Engines_Container_i::_toRemove_map [static, protected, inherited]
 

omni_mutex Engines_Container_i::_numInstanceMutex [static, protected, inherited]
 

bool Engines_Container_i::_isSupervContainer [protected, inherited]
 

SALOME_NamingService* Engines_Container_i::_NS [protected, inherited]
 

std::string Engines_Container_i::_library_path [protected, inherited]
 

std::string Engines_Container_i::_containerName [protected, inherited]
 

CORBA::ORB_var Engines_Container_i::_orb [protected, inherited]
 

PortableServer::POA_var Engines_Container_i::_poa [protected, inherited]
 

PortableServer::ObjectId* Engines_Container_i::_id [protected, inherited]
 

int Engines_Container_i::_numInstance [protected, inherited]
 

std::map<std::string,Engines::Component_var> Engines_Container_i::_listInstances_map [protected, inherited]
 

std::map<std::string,Engines::fileRef_var> Engines_Container_i::_fileRef_map [protected, inherited]
 

Engines::fileTransfer_var Engines_Container_i::_fileTransfer [protected, inherited]
 

int Engines_Container_i::_argc [protected, inherited]
 

char** Engines_Container_i::_argv [protected, inherited]
 

long Engines_Container_i::_pid [protected, inherited]
 

bool Engines_Container_i::_isServantAloneInProcess [protected, inherited]
 

int MPIObject_i::_numproc [protected, inherited]
 

int MPIObject_i::_nbproc [protected, inherited]
 

Engines::IORTab* MPIObject_i::_tior [protected, inherited]