CatalogDataType.xml \
KERNELCatalog.xml \
CatalogResources.xml \
-CatalogRessources.xml \
close.png \
config \
default.png \
long cpu_clock;
long nb_proc_per_node;
long nb_node;
+ boolean isMPI;
};
/*!
*/
interface ContainerManager
{
- Container FindOrStartContainer( in string containerName, in MachineList possibleComputers);
+ Container FindOrStartContainer( in MachineParameters params, in MachineList possibleComputers);
string FindBest(in MachineList possibleComputers);
MachineList GetFittingResources( in MachineParameters params, in string componentName );
void Shutdown();
// start MPI container executable
MPIContainer start_MPIimpl( in string ContainerName, in short nbproc );
- // shutdown corba server
- void MPIShutdown() ;
-
// asynchronous version to load and remove parallel component in parallel
oneway void SPload_impl(in string nameToRegister, in string componentName);
oneway void SPremove_impl(in Component component_i);
<!DOCTYPE ResourcesCatalog>
<resources>
-<machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="3200" userName="BS" memInMB="1024" preReqFilePath="/export/home/kloss/Salome2_2.1.0_22.12.04/env_products.sh" nbOfProcPerNode="1" alias="is111793" hostname="is111793" >
-<modules modulePath="/export/home/kloss/Salome2_2.1.0_22.12.04/CCRTTEST_INSTALL" moduleName="CCRTTEST" />
- <modules modulePath="/export/home/kloss/Salome2_2.1.0_22.12.04/KERNEL_INSTALL" moduleName="KERNEL" /> </machine>
- <machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="3200" userName="geay" memInMB="1024" preReqFilePath="/export/home/geay/SALOME_RES_MAN/env_products.sh" nbOfProcPerNode="1" alias="is111918" hostname="is111918" >
-<modules modulePath="/export/home/geay/CCRTTEST/CCRTTEST_INSTALL" moduleName="CCRTTEST" />
- <modules modulePath="/export/home/geay/SALOME_RES_MAN/KERNEL_INSTALL" moduleName="KERNEL" /> </machine></resources>
+<machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" nbOfProcPerNode="1" alias="is111790" hostname="is111790" >
+<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
+ <modules modulePath="/export/home/LGLS/Products/MED_2.2.2" moduleName="MED" /> <modules modulePath="/export/home/LGLS/Products/GEOM_2.2.2" moduleName="GEOM" /> <modules modulePath="/export/home/LGLS/Products/SMESH_2.2.2" moduleName="SMESH" /> <modules modulePath="/export/home/LGLS/Products/SUPERV_2.2.2" moduleName="SUPERV" /> <modules modulePath="/export/home/LGLS/Products/VISU_2.2.2" moduleName="VISU" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" /> </machine>
+
+<machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" nbOfProcPerNode="1" alias="is111915" hostname="is111915" >
+<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
+ <modules modulePath="/export/home/LGLS/Products/MED_2.2.2" moduleName="MED" /> <modules modulePath="/export/home/LGLS/Products/GEOM_2.2.2" moduleName="GEOM" /> <modules modulePath="/export/home/LGLS/Products/SMESH_2.2.2" moduleName="SMESH" /> <modules modulePath="/export/home/LGLS/Products/SUPERV_2.2.2" moduleName="SUPERV" /> <modules modulePath="/export/home/LGLS/Products/VISU_2.2.2" moduleName="VISU" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" /> </machine>
+
+<machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" nbOfProcPerNode="1" alias="is111918" hostname="is111918" >
+<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
+ <modules modulePath="/export/home/LGLS/Products/MED_2.2.2" moduleName="MED" /> <modules modulePath="/export/home/LGLS/Products/GEOM_2.2.2" moduleName="GEOM" /> <modules modulePath="/export/home/LGLS/Products/SMESH_2.2.2" moduleName="SMESH" /> <modules modulePath="/export/home/LGLS/Products/SUPERV_2.2.2" moduleName="SUPERV" /> <modules modulePath="/export/home/LGLS/Products/VISU_2.2.2" moduleName="VISU" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" /> </machine>
+
+<machine protocol="r" nbOfNodes="1" mode="i" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" nbOfProcPerNode="1" alias="is111996" hostname="is111996" >
+<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
+ <modules modulePath="/export/home/LGLS/Products/MED_2.2.2" moduleName="MED" /> <modules modulePath="/export/home/LGLS/Products/GEOM_2.2.2" moduleName="GEOM" /> <modules modulePath="/export/home/LGLS/Products/SMESH_2.2.2" moduleName="SMESH" /> <modules modulePath="/export/home/LGLS/Products/SUPERV_2.2.2" moduleName="SUPERV" /> <modules modulePath="/export/home/LGLS/Products/VISU_2.2.2" moduleName="VISU" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" /> <modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" /> </machine>
+</resources>
+++ /dev/null
-<Ressources-list>
- <computer>
- <name>eri</name>
- <OS>Linux</OS>
- <OS-version>2.2.14-6.1.1smp</OS-version>
- <proc-list>
- <proc>
- <number>0</number>
- <model>Pentium III (Coppermine)</model>
- <CPU-MHz>860.946775</CPU-MHz>
- <cache>256</cache>
- </proc>
- <proc>
- <number>1</number>
- <model>Pentium III (Coppermine)</model>
- <CPU-MHz>860.946775</CPU-MHz>
- <cache>256</cache>
- </proc>
- </proc-list>
- <containertype-list>
- <containertype>C++</containertype>
- <containertype>python</containertype>
- <containertype>NP</containertype>
- </containertype-list>
- </computer>
- <computer>
- <name>omote</name>
- <OS>Linux</OS>
- <OS-version>2.4.3-12smp</OS-version>
- <proc-list>
- <proc>
- <number>0</number>
- <model>Pentium II (Deschutes)</model>
- <CPU-MHz>398.780</CPU-MHz>
- <cache>512</cache>
- </proc>
- </proc-list>
- <containertype-list>
- <containertype>C++</containertype>
- <containertype>python</containertype>
- </containertype-list>
- </computer>
-</Ressources-list>
return ret;
}
-string Engines_Component_i::BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname)
-{
- string ret=Engines_Container_i::BuildContainerNameForNS(ContainerName,hostname);
- ret+="/";
- ret+=ComponentName;
- return ret;
-}
-
extern "C" {void ActSigIntHandler() ; }
extern "C" {void SigIntHandler(int, siginfo_t *, void *) ; }
-const char *Engines_Container_i::_defaultContainerName="FactoryServer";
-
Engines_Container_i::Engines_Container_i () :
_numInstance(0)
{
SCRUTE(hostname);
- _containerName = BuildContainerNameForNS(containerName,hostname.c_str());
-
_orb = CORBA::ORB::_duplicate(orb) ;
_poa = PortableServer::POA::_duplicate(poa) ;
CORBA::Object_var obj=_poa->id_to_reference(*_id);
Engines::Container_var pCont
= Engines::Container::_narrow(obj);
+
+ _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str());
SCRUTE(_containerName);
_NS->Register(pCont, _containerName.c_str());
}
return ret;
}
-string Engines_Container_i::BuildContainerNameForNS(const char *ContainerName, const char *hostname)
-{
- string ret="/Containers/";
- ret += hostname;
- ret+="/";
- if (strlen(ContainerName)== 0)
- ret+=_defaultContainerName;
- else
- ret += ContainerName;
- return ret;
-}
-
-
/*
* Create one instance of componentName component and register it
* as nameToRegister in naming service
CORBA::Long CpuUsed_impl() ;
static std::string GetDynLibraryName(const char *componentName);
- static std::string BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname);
protected:
std::string _instanceName ;
std::string _interfaceName ;
SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb)
{
_NS=new SALOME_NamingService(orb);
+ _ResManager=new SALOME_ResourcesManager(orb);
PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
PortableServer::POAManager_var pman = root_poa->the_POAManager();
PortableServer::POA_var my_poa;
SALOME_ContainerManager::~SALOME_ContainerManager()
{
delete _NS;
+ delete _ResManager;
}
void SALOME_ContainerManager::Shutdown()
vector<string> vec=_NS->list_directory_recurs();
for(vector<string>::iterator iter=vec.begin();iter!=vec.end();iter++)
{
+ cerr << "SALOME_ContainerManager::ShutdownContainers : " << (*iter).c_str() << endl;
SCRUTE((*iter));
CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
Engines::Container_var cont=Engines::Container::_narrow(obj);
}
}
-Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char *containerName, const Engines::MachineList& possibleComputers)
+Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const Engines::MachineParameters& params, const Engines::MachineList& possibleComputers)
{
- Engines::Container_ptr ret=FindContainer(containerName,possibleComputers);
+ Engines::Container_ptr ret=FindContainer(params,possibleComputers);
if(!CORBA::is_nil(ret))
return ret;
// Container doesn't exist try to launch it ...
+ MESSAGE("Container doesn't exist try to launch it ...");
vector<string> vector;
string theMachine=_LoadManager.FindBest(possibleComputers);
string command;
if(theMachine==GetHostname())
- command=_ResManager.BuildCommandToLaunchLocalContainer(containerName);
+ command=_ResManager->BuildCommandToLaunchLocalContainer(params);
else
- command=_ResManager.BuildTempFileToLaunchRemoteContainer(theMachine,containerName);
- _ResManager.RmTmpFile();
+ command=_ResManager->BuildTempFileToLaunchRemoteContainer(theMachine,params);
+ _ResManager->RmTmpFile();
int status=system(command.c_str());
+ cerr << status << endl;
if (status == -1) {
MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status -1)");
return Engines::Container::_nil();
count-- ;
if ( count != 10 )
MESSAGE( count << ". Waiting for FactoryServer on " << theMachine);
- string containerNameInNS=BuildContainerNameInNS(containerName,theMachine.c_str());
+ string containerNameInNS=_NS->BuildContainerNameForNS(params,theMachine.c_str());
SCRUTE(containerNameInNS);
CORBA::Object_var obj = _NS->Resolve(containerNameInNS.c_str());
ret=Engines::Container::_narrow(obj);
Engines::MachineList *SALOME_ContainerManager::GetFittingResources(const Engines::MachineParameters& params, const char *componentName)
{
- vector<string> vec=_ResManager.GetFittingResources(params,componentName);
+ vector<string> vec=_ResManager->GetFittingResources(params,componentName);
Engines::MachineList *ret=new Engines::MachineList;
ret->length(vec.size());
for(unsigned int i=0;i<vec.size();i++)
return CORBA::string_dup(theMachine.c_str());
}
-Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *containerName,const char *theMachine)
+Engines::Container_ptr SALOME_ContainerManager::FindContainer(const Engines::MachineParameters& params,const char *theMachine)
{
- string containerNameInNS(BuildContainerNameInNS(containerName,theMachine));
- SCRUTE(containerNameInNS);
+ string containerNameInNS(_NS->BuildContainerNameForNS(params,theMachine));
CORBA::Object_var obj = _NS->Resolve(containerNameInNS.c_str());
if( !CORBA::is_nil(obj) )
return Engines::Container::_narrow(obj);
return Engines::Container::_nil();
}
-Engines::Container_ptr SALOME_ContainerManager::FindContainer(const char *containerName,const Engines::MachineList& possibleComputers)
+Engines::Container_ptr SALOME_ContainerManager::FindContainer(const Engines::MachineParameters& params,const Engines::MachineList& possibleComputers)
{
for(unsigned int i=0;i<possibleComputers.length();i++)
{
- Engines::Container_ptr cont=FindContainer(containerName,possibleComputers[i]);
+ Engines::Container_ptr cont=FindContainer(params,possibleComputers[i]);
if( !CORBA::is_nil(cont) )
return cont;
}
return Engines::Container::_nil();
}
-
-string SALOME_ContainerManager::BuildContainerNameInNS(const char *containerName,const char *machineName)
-{
- string containerNameInNS("/Containers/");
- containerNameInNS+=machineName;
- containerNameInNS+="/";
- containerNameInNS+=containerName;
- return containerNameInNS;
-}
class SALOME_ContainerManager: public POA_Engines::ContainerManager,
public PortableServer::RefCountServantBase {
private:
- SALOME_ResourcesManager _ResManager;
+ SALOME_ResourcesManager *_ResManager;
SALOME_LoadRateManager _LoadManager;
SALOME_NamingService *_NS;
public:
SALOME_ContainerManager(CORBA::ORB_ptr orb);
~SALOME_ContainerManager();
- Engines::Container_ptr FindOrStartContainer(const char *containerName, const Engines::MachineList& possibleComputer);
+ Engines::Container_ptr FindOrStartContainer(const Engines::MachineParameters& params, const Engines::MachineList& possibleComputer);
Engines::MachineList *GetFittingResources(const Engines::MachineParameters& params, const char *componentName);
char* FindBest(const Engines::MachineList& possibleComputers);
void Shutdown();
static const char *_ContainerManagerNameInNS;
private:
- Engines::Container_ptr FindContainer(const char *containerName,const Engines::MachineList& possibleComputers);
- Engines::Container_ptr FindContainer(const char *containerName,const char *theMachine);
- std::string BuildContainerNameInNS(const char *containerName,const char *machineName);
+ Engines::Container_ptr FindContainer(const Engines::MachineParameters& params,const Engines::MachineList& possibleComputers);
+ Engines::Container_ptr FindContainer(const Engines::MachineParameters& params,const char *theMachine);
};
#endif
char* name();
char* machineName();
- void ping();
- void Shutdown();
+ virtual void ping();
+ virtual void Shutdown();
//! Kill current container
bool Kill_impl() ;
CORBA::Long getPID();
static bool isPythonContainer(const char* ContainerName);
- static std::string BuildContainerNameForNS(const char *ContainerName, const char *hostname);
- static const char *_defaultContainerName;
protected:
SALOME_NamingService *_NS ;
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
#include "SALOME_NamingService.hxx"
using namespace std;
+IncompatibleComponent::IncompatibleComponent( void ): SALOME_Exception( "IncompatibleComponent" )
+{
+ ;
+}
+IncompatibleComponent::IncompatibleComponent( const IncompatibleComponent &ex ): SALOME_Exception( ex )
+{
+ ;
+}
+
SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
{
_NS = ns;
{
}
-string SALOME_LifeCycleCORBA::ContainerName(
- const char * aComputerContainer ,
- string * theComputer ,
- string * theContainer ) {
- char * ContainerName = new char [ strlen( aComputerContainer ) + 1 ] ;
- strcpy( ContainerName , aComputerContainer ) ;
- string theComputerContainer("/Containers/");
- char * slash = strchr( ContainerName , '/' ) ;
- if ( !slash ) {
- *theComputer = GetHostname() ;
- theComputerContainer += *theComputer ;
- theComputerContainer += "/" ;
- *theContainer = ContainerName ;
- theComputerContainer += *theContainer ;
- }
- else {
- slash[ 0 ] = '\0' ;
- slash += 1 ;
- *theContainer = slash ;
- if ( !strcmp( ContainerName , "localhost" ) ) {
- *theComputer = GetHostname() ;
- }
- else {
- *theComputer = ContainerName ;
- }
- theComputerContainer += *theComputer ;
- theComputerContainer += "/" ;
- theComputerContainer += *theContainer ;
- }
- delete [] ContainerName;
- return theComputerContainer ;
-}
-
bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName)
{
return false;
}
-string SALOME_LifeCycleCORBA::ComputerPath(
- const char * theComputer ) {
- CORBA::String_var path;
- CORBA::Object_var obj = _NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
- try {
- path = Catalog->GetPathPrefix( theComputer );
- }
- catch (SALOME_ModuleCatalog::NotFound&) {
- INFOS("GetPathPrefix(" << theComputer << ") not found!");
- path = "" ;
- }
- SCRUTE( path ) ;
- return CORBA::string_dup( path ) ;
-}
-
-Engines::Container_ptr SALOME_LifeCycleCORBA::FindContainer(const char *containerName)
+bool SALOME_LifeCycleCORBA::isMpiContainer(const Engines::MachineParameters& params) throw(IncompatibleComponent)
{
- ASSERT(_NS != NULL);
- string cont ;
- if ( strncmp( containerName , "/Containers/" , 12 ) ) { // Compatibility ...
- string theComputer ;
- string theContainer ;
- cont = ContainerName( containerName , &theComputer , &theContainer ) ;
- }
- else {
- cont = containerName ;
- }
- try {
+// MESSAGE(params.container_name)
+// if( strstr(params.container_name,"MPI") ){
+// if( !params.isMPI ){
+// cerr << "IncompatibleComponent" << endl;
+// throw IncompatibleComponent();
+// }
+// return true;
+// }
+// else{
+// if( params.isMPI ){
+// cerr << "IncompatibleComponent" << endl;
+// throw IncompatibleComponent();
+// }
+// return false;
+// }
+ if( params.isMPI )
+ return true;
+ else
+ return false;
- SCRUTE( cont );
+}
- CORBA::Object_var obj = _NS->Resolve( cont.c_str() );
- if( !CORBA::is_nil( obj ) ) {
- return Engines::Container::_narrow( obj ) ;
- }
- }
- catch (ServiceUnreachable&) {
- INFOS("Caught exception: Naming Service Unreachable");
- }
- catch (...) {
- INFOS("Caught unknown exception.");
- }
- return Engines::Container::_nil();
+int SALOME_LifeCycleCORBA::NbProc(const Engines::MachineParameters& params)
+{
+ if( !isMpiContainer(params) )
+ return 0;
+ else if( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
+ return 1;
+ else if( params.nb_node == 0 )
+ return params.nb_proc_per_node;
+ else if( params.nb_proc_per_node == 0 )
+ return params.nb_node;
+ else
+ return params.nb_node * params.nb_proc_per_node;
}
Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component
(const char *containerName,
const char *componentName)
{
+ // Check if Component Name is known
if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
+
+ // Chack if containerName contains machine name (if yes: rg>0)
char *stContainer=strdup(containerName);
string st2Container(stContainer);
int rg=st2Container.find("/");
- if(rg>=0)
- {
- stContainer[rg]='\0';
- if(strcmp(stContainer,"localhost")==0)
- {
- Engines::Component_ptr ret=FindOrLoad_Component(stContainer+rg+1,componentName);
- free(stContainer);
- return ret;
- }
- }
+
+ Engines::MachineParameters_var params=new Engines::MachineParameters;
if(rg<0) {
- //containerName doesn't contain "/" => Local container
- free(stContainer);
- Engines::MachineList_var listOfMachine=new Engines::MachineList;
- listOfMachine->length(1);
- listOfMachine[0]=CORBA::string_dup(GetHostname().c_str());
- Engines::Component_ptr ret=FindComponent(containerName,componentName,listOfMachine.in());
- if(CORBA::is_nil(ret))
- return LoadComponent(containerName,componentName,listOfMachine);
- else
- return ret;
+ params->container_name=CORBA::string_dup(stContainer);
+ params->hostname=CORBA::string_dup(GetHostname().c_str());
}
else {
- //containerName contains "/" => Remote container
stContainer[rg]='\0';
- Engines::MachineParameters_var params=new Engines::MachineParameters;
params->container_name=CORBA::string_dup(stContainer+rg+1);
params->hostname=CORBA::string_dup(stContainer);
- params->OS=CORBA::string_dup("LINUX");
- free(stContainer);
- return FindOrLoad_Component(params,componentName);
}
+ free(stContainer);
+ return FindOrLoad_Component(params,componentName);
+
}
-Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const Engines::MachineParameters& params,
- const char *componentName)
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const Engines::MachineParameters& params, const char *componentName)
{
if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
+
Engines::MachineList_var listOfMachine=_ContManager->GetFittingResources(params,componentName);
- Engines::Component_ptr ret=FindComponent(params.container_name,componentName,listOfMachine);
+ Engines::Component_ptr ret=FindComponent(params,componentName,listOfMachine);
if(CORBA::is_nil(ret))
- return LoadComponent(params.container_name,componentName,listOfMachine);
+ return LoadComponent(params,componentName,listOfMachine);
else
return ret;
}
-Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const char *containerName,
- const char *componentName,
- const Engines::MachineList& listOfMachines)
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, const char *componentName, const Engines::MachineList& listOfMachines)
{
+ const char *containerName = params.container_name;
+ int nbproc = NbProc(params);
+ cerr << nbproc << endl;;
+
if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
- if(containerName[0]!='\0')
- {
- Engines::MachineList_var machinesOK=new Engines::MachineList;
- unsigned int lghtOfmachinesOK=0;
- machinesOK->length(listOfMachines.length());
- for(unsigned int i=0;i<listOfMachines.length();i++)
- {
- const char *currentMachine=listOfMachines[i];
- string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,currentMachine);
- CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
- if(!CORBA::is_nil(obj))
- {
- machinesOK[lghtOfmachinesOK++]=CORBA::string_dup(currentMachine);
- }
- }
- if(lghtOfmachinesOK!=0)
- {
- machinesOK->length(lghtOfmachinesOK);
- CORBA::String_var bestMachine=_ContManager->FindBest(machinesOK);
- string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
- CORBA::Object_var obj=_NS->Resolve(componentNameForNS.c_str());
- return Engines::Component::_narrow(obj);
- }
- else
- return Engines::Component::_nil();
- }
+
+ // find list of machines which have component
+ Engines::MachineList_var machinesOK=new Engines::MachineList;
+ unsigned int lghtOfmachinesOK=0;
+ machinesOK->length(listOfMachines.length());
+ for(unsigned int i=0;i<listOfMachines.length();i++) {
+ const char *currentMachine=listOfMachines[i];
+
+ CORBA::Object_var obj = _NS->ResolveComponent(currentMachine,containerName,componentName,nbproc);
+ if(!CORBA::is_nil(obj))
+ machinesOK[lghtOfmachinesOK++]=CORBA::string_dup(currentMachine);
+ }
+
+ // find the best machine among the list which have component
+ if(lghtOfmachinesOK!=0) {
+ machinesOK->length(lghtOfmachinesOK);
+ CORBA::String_var bestMachine=_ContManager->FindBest(machinesOK);
+ CORBA::Object_var obj = _NS->ResolveComponent(bestMachine,containerName,componentName,nbproc);
+ return Engines::Component::_narrow(obj);
+ }
else
- {
- //user specified no container name so trying to find a component in the best machine among listOfMachines
- CORBA::String_var bestMachine=_ContManager->FindBest(listOfMachines);
- //Normally look at all containers launched on bestMachine to see if componentName is already launched on one of them. To do..
- string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
- CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
- return Engines::Component::_narrow(obj);
- }
+ return Engines::Component::_nil();
}
-Engines::Component_ptr SALOME_LifeCycleCORBA::LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines)
+Engines::Component_ptr SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, const char *componentName, const Engines::MachineList& listOfMachines)
{
- Engines::Container_var cont=_ContManager->FindOrStartContainer(containerName,listOfMachines);
+ Engines::Container_var cont=_ContManager->FindOrStartContainer(params,listOfMachines);
string implementation=Engines_Component_i::GetDynLibraryName(componentName);
return cont->load_impl(componentName, implementation.c_str());
}
-
-
-Engines::Container_ptr SALOME_LifeCycleCORBA::FindOrStartContainer(
- const string aComputerContainer ,
- const string theComputer ,
- const string theContainer ) {
- SCRUTE( aComputerContainer ) ;
- SCRUTE( theComputer ) ;
- SCRUTE( theContainer ) ;
-
- Engines::Container_var aContainer = FindContainer( aComputerContainer.c_str() ) ;
-
- if ( !CORBA::is_nil( aContainer ) ) {
- return aContainer ;
- }
-
- Engines::Container_var aFactoryServer ;
-
- bool pyCont = false ;
- int len = theContainer.length() ;
- if ( !strcmp( &theContainer.c_str()[len-2] , "Py" ) ) {
- pyCont = true ;
- }
-
- string addr=_NS->getIORaddr();
- string CMD="SALOME_Container";
- if ( pyCont ) {
- CMD="SALOME_ContainerPy.py";
- }
- CMD=CMD + " " + theContainer;
- CMD=CMD + " -ORBInitRef NameService="+addr;
-
- /*
- * Get the appropriate launcher and ask to launch
- */
- PyObject * launcher=getLauncher((char *)theComputer.c_str());
- Launcher_Slaunch(launcher,(char *)theComputer.c_str(),(char *)CMD.c_str());
- /*
- * Wait until the container is registered in Naming Service
- */
- int count = 5 ;
- while ( CORBA::is_nil( aFactoryServer ) && count ) {
- sleep( 1 ) ;
- count-- ;
- if ( count != 10 )
- MESSAGE( count << ". Waiting for FactoryServer on " << theComputer)
- aFactoryServer = FindContainer( aComputerContainer.c_str() ) ;
- }
- if ( !CORBA::is_nil( aFactoryServer ) ) {
- return aFactoryServer;
- }
- MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed") ;
- return Engines::Container::_nil();
-}
class SALOME_NamingService;
+class IncompatibleComponent : public SALOME_Exception
+{
+public :
+ IncompatibleComponent( void );
+ IncompatibleComponent( const IncompatibleComponent &ex );
+} ;
+
class SALOME_LifeCycleCORBA
{
public:
SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
virtual ~SALOME_LifeCycleCORBA();
- Engines::Container_ptr FindContainer(const char *containerName); // for supervision
Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params,
const char *componentName);
Engines::Component_ptr FindOrLoad_Component(const char *containerName,
const char *componentName);
- bool isKnownComponentClass(const char *componentName);
protected:
+ bool isKnownComponentClass(const char *componentName);
+ bool isMpiContainer(const Engines::MachineParameters& params) throw(IncompatibleComponent);
+ int NbProc(const Engines::MachineParameters& params);
//! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources
//! in "listOfMachines". This method uses Naming Service to find the component.
- Engines::Component_ptr FindComponent(const char *containerName,
- const char *componentName,
- const Engines::MachineList& listOfMachines);
+ Engines::Component_ptr FindComponent(const Engines::MachineParameters& params, const char *componentName, const Engines::MachineList& listOfMachines);
- Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines);
+ Engines::Component_ptr LoadComponent(const Engines::MachineParameters& params, const char *componentName, const Engines::MachineList& listOfMachines);
SALOME_NamingService *_NS;
Engines::ContainerManager_var _ContManager;
- //private:
- std::string ContainerName( const char * aComputerContainer ,
- std::string * theComputer ,
- std::string * theContainer ) ;
- std::string ComputerPath( const char * theComputer ) ;
- Engines::Container_ptr FindOrStartContainer(const std::string aComputerContainer ,
- const std::string theComputer ,
- const std::string theContainer ) ;
} ;
#endif
{
MESSAGE("[" << numproc << "] activate object");
_id = _poa->activate_object(this);
- this->_add_ref();
+// this->_add_ref();
if(numproc==0){
- // _NS = new SALOME_NamingService(_orb);
- _NS = SINGLETON_<SALOME_NamingService>::Instance() ;
- ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
- _NS->init_orb( orb ) ;
+ _NS = new SALOME_NamingService();
+// _NS = SINGLETON_<SALOME_NamingService>::Instance() ;
+// ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
+ _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ;
// Engines::Container_ptr pCont
// = Engines::Container::_narrow(POA_Engines::MPIContainer::_this());
- Engines::Container_ptr pCont = Engines::Container::_narrow(_poa->id_to_reference(*_id));
+ CORBA::Object_var obj=_poa->id_to_reference(*_id);
+ Engines::Container_var pCont = Engines::Container::_narrow(obj);
+ string hostname = GetHostname();
+ _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str());
SCRUTE(_containerName);
_NS->Register(pCont, _containerName.c_str());
}
}
// Load component
-void Engines_MPIContainer_i::MPIShutdown()
+void Engines_MPIContainer_i::Shutdown()
{
int ip;
- MESSAGE("[" << _numproc << "] shutdown of Corba Server");
+ MESSAGE("[" << _numproc << "] shutdown of MPI Corba Server");
if( _numproc == 0 ){
+ MESSAGE("[" << _numproc << "] destroy from Naming Service of " << _containerName);
+ _NS->Destroy_Name(_containerName.c_str());
for(ip= 1;ip<_nbproc;ip++)
(Engines::MPIContainer::_narrow((*_tior)[ip]))->Shutdown();
}
-
- Shutdown();
+ _orb->shutdown(0);
}
Engines::Component_ptr load_impl(const char* nameToRegister,
const char* componentName);
// shutdown corba server
- void MPIShutdown();
+ void Shutdown();
// asynchronous version for other process
void SPload_impl(const char* nameToRegister, const char* componentName);
#include "Utils_SINGLETON.hxx"
#include "utilities.h"
#include <mpi.h>
-#include "LocalTraceCollector.hxx"
+#include "SALOMETraceCollector.hxx"
using namespace std;
int main(int argc, char* argv[])
{
int nbproc, numproc;
- int flag;
Engines_MPIContainer_i * myContainer=NULL;
MPI_Init(&argc,&argv);
// Initialise the ORB.
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
CORBA::ORB_var &orb = init( argc , argv ) ;
- LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb);
+ SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
BEGIN_OF("[" << numproc << "] " << argv[0])
try {
pman->activate();
orb->run();
- orb->destroy();
}
catch(CORBA::SystemException&){
if(myContainer)
delete myContainer;
- MPI_Initialized(&flag);
- if(flag)
- MPI_Finalize();
END_OF("[" << numproc << "] " << argv[0]);
delete myThreadTrace;
- return 0 ;
+
+ MPI_Finalize();
+
}
+++ /dev/null
-#==============================================================================
-# File : MPILifeCycleCORBA.py
-# Created : ven may 30 08:42:01 CEST 2003
-# Author : Bernard SECHER, CEA
-# Project : SALOME
-# Copyright : CEA 2003
-# $Header$
-#==============================================================================
-
-from LifeCycleCORBA import *
-from Utils_Identity import getShortHostName
-
-class MPILifeCycleCORBA(LifeCycleCORBA):
- #-------------------------------------------------------------------------
-
- def __init__(self, orb):
- MESSAGE( "MPILifeCycleCORBA::__init__" )
- LifeCycleCORBA.__init__(self, orb)
-
- #-------------------------------------------------------------------------
-
- def FindOrStartMPIContainer(self, theComputer , theMPIContainerRoot, nbproc ):
- theMPIContainer = theMPIContainerRoot + "_" + str(nbproc)
- MESSAGE( "FindOrStartMPIContainer" + theComputer + theMPIContainer )
- aMPIContainer = self.FindContainer( theComputer + "/" + theMPIContainer )
- if aMPIContainer is None :
- if (theMPIContainerRoot == "MPIFactoryServer") | (theMPIContainerRoot == "MPIFactoryServerPy") :
- if theComputer == getShortHostName() :
- rshstr = ""
- else :
- rshstr = "rsh -n " + theComputer + " "
- path = self.ComputerPath( theComputer )
-## if path != "" :
-## rshstr = rshstr + path + "/../bin/salome/"
-## else :
-## rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/"
-# rshstr = rshstr + os.getenv( "PWD" ) + "/"
- if theMPIContainerRoot == "MPIFactoryServer" :
- rshstr = rshstr + "mpirun -np " + str(nbproc) + " " + path + "SALOME_MPIContainer "
- else :
- rshstr = rshstr + path + "SALOME_MPIContainerPy.py '"
- rshstr = rshstr + theMPIContainer + " -"
- omniORBcfg = os.getenv( "OMNIORB_CONFIG" )
-# omniORBcfg = os.getenv( "HOME" ) + "/.omniORB.cfg"
- file = os.open( omniORBcfg , os.O_RDONLY )
- ORBInitRef = os.read(file,132)
- if ORBInitRef[len(ORBInitRef)-1] == '\n' :
- ORBInitRef,bsn = ORBInitRef.split('\n')
- os.close( file )
- rshstr = rshstr + ORBInitRef
- if theMPIContainerRoot == "MPIFactoryServerPy" :
- rshstr = rshstr + "'"
- rshstr = rshstr + " > /tmp/" + theMPIContainer + "_"
- rshstr = rshstr + theComputer
- rshstr = rshstr + ".log 2>&1 &"
- os.system( rshstr )
- MESSAGE( "FindOrStartMPIContainer" + rshstr + " done" )
- else :
- if theMPIContainer.find('Py') == -1 :
- aMPIContainer = self.FindContainer( theComputer + "/" + "MPIFactoryServer_" + str(nbproc) )
- else :
- aMPIContainer = self.FindContainer( theComputer + "/" + "MPIFactoryServerPy_" + str(nbproc) )
- aMPIContainer = aMPIContainer.start_impl( theMPIContainer )
-
- count = 21
- while aMPIContainer is None :
- time.sleep(1)
- count = count - 1
- MESSAGE( str(count) + ". Waiting for " + theComputer + "/" + theMPIContainer )
- aMPIContainer = self.FindContainer( theComputer + "/" + theMPIContainer )
- if count == 0 :
- return aMPIContainer
-
- return aMPIContainer
- #os.system("rsh -n dm2s0017 /export/home/SALOME_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515")
-
- #-------------------------------------------------------------------------
-
- def FindOrLoadMPIComponent(self, MPIcontainerName, MPIcomponentName, nbproc):
-
- theComputer,theMPIContainerRoot = self.ContainerName( MPIcontainerName )
- theMPIContainer = theMPIContainerRoot + "_" + str(nbproc)
- name = [CosNaming.NameComponent(theComputer,"dir"),
- CosNaming.NameComponent(theMPIContainer,"dir"),
- CosNaming.NameComponent(MPIcomponentName,"object")]
- try:
- obj = self._containerRootContext.resolve(name)
- except CosNaming.NamingContext.NotFound, ex:
- MESSAGE( "component " + MPIcomponentName + " not found, trying to load" )
- MPIcontainer = self.FindContainer(theComputer + "/" + theMPIContainer)
- if MPIcontainer is None:
- MESSAGE( "MPIcontainer " + theComputer + "/" + theMPIContainer + " not found in Naming Service, trying to start" )
- if (theMPIContainerRoot != "MPIFactoryServer") & (theMPIContainerRoot != "MPIFactoryServerPy") :
- if theMPIContainer.find('Py') == -1 :
- theMPIFactorycontainerRoot = "MPIFactoryServer"
- theMPIFactorycontainer = theMPIFactorycontainerRoot + "_" + str(nbproc)
- else :
- theMPIFactorycontainerRoot = "MPIFactoryServerPy"
- theMPIFactorycontainer = theMPIFactorycontainerRoot + "_" + str(nbproc)
- MPIFactorycontainer = self.FindContainer(theComputer + "/" + theMPIFactorycontainer)
- if MPIFactorycontainer is None:
- MESSAGE( "MPIcontainer " + theComputer + "/" + theMPIFactorycontainer + " not found in Naming Service, trying to start" )
- MPIFactorycontainer = self.FindOrStartMPIContainer(theComputer,theMPIFactorycontainerRoot,nbproc)
- else:
- MPIFactorycontainer = self.FindOrStartMPIContainer(theComputer,theMPIContainerRoot,nbproc)
- if MPIFactorycontainer != None :
- MPIcontainer = self.FindOrStartMPIContainer(theComputer,theMPIContainerRoot,nbproc)
-
- if MPIcontainer != None:
- compoinfo = self._catalog.GetComponent(MPIcomponentName)
- if compoinfo is None:
- MESSAGE( "MPIcomponent " + MPIcomponentName + " not found in Module Catalog" )
- else:
- try:
- machineName = theComputer
- path = compoinfo.GetPathPrefix(machineName) + "/"
- except SALOME_ModuleCatalog.NotFound, ex:
- MESSAGE( "machine " + machineName + " not found in Module Catalog" )
- MESSAGE( "trying localhost" )
- try:
- path = compoinfo.GetPathPrefix("localhost") + "/"
- except SALOME_ModuleCatalog.NotFound, ex:
- path = ""
- implementation = path + "lib" + MPIcomponentName + "Engine.so"
- MESSAGE( "Trying to load " + implementation )
- try:
- MPIcomponent = MPIcontainer.load_impl(MPIcomponentName, implementation)
- MESSAGE( "component " + MPIcomponent._get_instanceName() + " launched !" )
- return MPIcomponent
- except:
- MESSAGE( "component " + MPIcomponentName + " NOT launched !" )
-
- else:
- try:
- MPIcomponent = obj._narrow(Engines.Component)
- if MPIcomponent is None:
- MESSAGE( MPIcomponentName + " is not a component !" )
- else:
- MESSAGE( "MPIcomponent " + MPIcomponent._get_instanceName() + " found !" )
- return MPIcomponent
- except:
- MESSAGE( MPIcomponentName + " failure" )
- return None
+++ /dev/null
-import salome
-from MPILifeCycleCORBA import *
-
-# create an LifeCycleCORBA instance
-lcc = MPILifeCycleCORBA(salome.orb)
+++ /dev/null
-#==============================================================================
-# File : Makefile.in
-# Created : lun jui 2 20:32:24 CEST 2001
-# Author : Paul RASCLE, EDF - Marc Tajchman, CEA
-# Project : SALOME
-# Copyright : EDF 2001
-# $Header$
-#==============================================================================
-
-# source path
-top_srcdir=@top_srcdir@
-top_builddir=../..
-srcdir=@srcdir@
-VPATH=.:@srcdir@:@top_srcdir@/idl
-
-
-@COMMENCE@
-
-EXPORT_HEADERS = SALOME_MPILifeCycleCORBA.hxx
-
-EXPORT_PYSCRIPTS = MPIsalome.py MPILifeCycleCORBA.py
-
-# Libraries targets
-
-LIB = libSalomeMPILifeCycleCORBA.la
-LIB_SRC = SALOME_MPILifeCycleCORBA.cxx
-LIB_CLIENT_IDL = SALOME_MPIObject.idl SALOME_MPIContainer.idl \
- SALOME_Component.idl SALOME_ModuleCatalog.idl
-
-# Executables targets
-BIN = TestMPILifeCycleCORBA
-BIN_SRC =
-BIN_CLIENT_IDL = Logger.idl SALOME_MPIObject.idl SALOME_MPIContainer.idl SALOME_TestMPIComponent.idl
-
-LDFLAGS += -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace
-
-@CONCLUDE@
-
+++ /dev/null
-//=============================================================================
-// File : SALOME_MPILifeCycleCORBA.cxx
-// Created : mar jui 03 14:55:50 CEST 2003
-// Author : Bernard SECHER CEA
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-
-#include <iostream>
-#include <fstream>
-#include <strstream>
-#include <iomanip>
-#include <stdio.h>
-#include <string.h>
-
-#include "OpUtil.hxx"
-#include "utilities.h"
-
-#include <ServiceUnreachable.hxx>
-
-#include "SALOME_MPILifeCycleCORBA.hxx"
-#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
-#include "SALOME_NamingService.hxx"
-using namespace std;
-
-SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA() :
- SALOME_LifeCycleCORBA()
-{
- _MPIFactoryServer = NULL;
-}
-
-SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA(SALOME_NamingService *ns) :
- SALOME_LifeCycleCORBA(ns)
-{
- _MPIFactoryServer = NULL;
-}
-
-SALOME_MPILifeCycleCORBA::~SALOME_MPILifeCycleCORBA()
-{
-}
-
-Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer(
- const std::string theComputer ,
- const std::string theMPIContainerRoot,
- const int nbproc)
-{
- char nbp[1024];
-
- sprintf(nbp,"_%d",nbproc);
- std::string theMPIContainer = theMPIContainerRoot + nbp;
- std::string aComputerContainer = theComputer + "/" + theMPIContainer;
-
- SCRUTE( aComputerContainer ) ;
- SCRUTE( theComputer ) ;
- SCRUTE( theMPIContainer ) ;
-
- // On recherche si le containe rest deja lance
- Engines::MPIContainer_var aMPIContainer = Engines::MPIContainer::_narrow(FindContainer(aComputerContainer.c_str()));
-
- //On a trouve le container: on renvoie une poigne dessus
- if ( !CORBA::is_nil( aMPIContainer ) ) {
- MESSAGE("MPIContainer " << aComputerContainer << " found!!!");
- return aMPIContainer ;
- }
- // On a pas trouve le container
- else {
- MESSAGE("MPIContainer " << aComputerContainer << " not found!!!");
- // On recherche un container generique
- bool pyCont = false ;
- int len = theMPIContainer.length() ;
- if ( !strcmp( &theMPIContainerRoot.c_str()[len-2] , "Py" ) ) {
- pyCont = true ;
- }
- std::string MPIFactoryServer = theComputer ;
- if ( pyCont ) {
- MPIFactoryServer += "/MPIFactoryServerPy" ;
- }
- else {
- MPIFactoryServer += "/MPIFactoryServer" ;
- }
- MPIFactoryServer += nbp;
- Engines::MPIContainer_var aMPIFactoryServer = Engines::MPIContainer::_narrow(FindContainer( MPIFactoryServer.c_str()));
-
- // On n'a pas trouve le container generique: on lance le container demande
- if ( CORBA::is_nil( aMPIFactoryServer ) ) {
-// rsh -n ikkyo /export/home/rahuel/SALOME_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515 &
- std::string rsh( "" ) ;
- if ( theComputer!= GetHostname() ) {
- rsh += "rsh -n " ;
- rsh += theComputer ;
- rsh += " " ;
- }
- std::string path = ComputerPath( theComputer.c_str() ) ;
- SCRUTE( path ) ;
- // rsh += "runSession " ;
- if ( pyCont ) {
- MESSAGE("MPI python container not implemented");
- return Engines::MPIContainer::_nil();
-// rsh += "SALOME_MPIContainerPy.py " ;
-// rsh += "MPIFactoryServerPy -" ;
- }
- else {
- sprintf(nbp,"mpirun -np %d %sSALOME_MPIContainer ",nbproc,path.c_str());
- rsh += nbp;
- rsh += theMPIContainer +" -" ;
- }
- std::string omniORBcfg( getenv( "OMNIORB_CONFIG" ) ) ;
- ifstream omniORBfile( omniORBcfg.c_str() ) ;
- char ORBInitRef[12] ;
- char nameservice[132] ;
- omniORBfile >> ORBInitRef ;
- rsh += ORBInitRef ;
- rsh += " " ;
- omniORBfile >> nameservice ;
- omniORBfile.close() ;
- char * bsn = strchr( nameservice , '\n' ) ;
- if ( bsn ) {
- bsn[ 0 ] = '\0' ;
- }
- rsh += nameservice ;
- if ( pyCont ) {
- rsh += " > /tmp/MPIFactoryServerPy_" ;
- }
- else {
- rsh += " > /tmp/MPIFactoryServer_" ;
- }
- sprintf(nbp,"%d_",nbproc);
- rsh += nbp;
- rsh += theComputer ;
- rsh += ".log 2>&1 &" ;
- SCRUTE( rsh );
- int status = system( rsh.c_str() ) ;
- if (status == -1) {
- INFOS("SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer rsh failed (system command status -1)") ;
- }
- else if (status == 217) {
- INFOS("SALOME_MPILifeCycleCORBA::FindOrStartContainer rsh failed (system command status 217)") ;
- }
- else {
- int count = 21 ;
- while ( CORBA::is_nil( aMPIFactoryServer ) && count ) {
- sleep( 1 ) ;
- count-- ;
- if ( count != 10 )
- MESSAGE( count << ". Waiting for FactoryServer on " << theComputer)
- aMPIFactoryServer = Engines::MPIContainer::_narrow(FindContainer( MPIFactoryServer.c_str()));
- }
- if ( CORBA::is_nil( aMPIFactoryServer ) ) {
- INFOS("SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer rsh failed") ;
- }
- else if ( strcmp( theComputer.c_str() , GetHostname().c_str() ) ) {
- _MPIFactoryServer = aMPIFactoryServer ;
- }
- }
- }
- // On a trouve le container generique distant: on se sert de lui
- // pour lancer un nouveau container MPI
- // a revoir...
- if ( !CORBA::is_nil( aMPIFactoryServer ) ) {
- if ( strcmp( theMPIContainer.c_str() , "MPIFactoryServer" ) ||
- strcmp( theMPIContainer.c_str() , "MPIFactoryServerPy" ) ) {
- MESSAGE("MPI Container not found ! trying to start " << aComputerContainer);
- Engines::MPIContainer_var myMPIContainer = aMPIFactoryServer->start_MPIimpl( theMPIContainer.c_str(), nbproc ) ;
- if ( !CORBA::is_nil( myMPIContainer ) ) {
- MESSAGE("MPIContainer " << aComputerContainer << " started");
- return myMPIContainer ;
- }
- else {
- MESSAGE("MPIContainer " << aComputerContainer << " NOT started");
- }
- }
- else {
- MESSAGE("MPIContainer " << aComputerContainer << " started");
- return aMPIFactoryServer ;
- }
- }
- }
- return Engines::MPIContainer::_nil();
-}
-
-// Engines::Component_var SALOME_MPILifeCycleCORBA::FindOrLoad_MPIComponent
-// (const char *MPIcontainerName,
-// const char *MPIcomponentName,
-// const char *implementation,
-// const int nbproc)
-// {
-// BEGIN_OF("FindOrLoad_MPIComponent(1)");
-// ASSERT(_NS != NULL);
-// string theComputer ;
-// string theMPIContainer ;
-// string theComputerContainer = ContainerName( MPIcontainerName ,
-// &theComputer ,
-// &theMPIContainer ) ;
-// Engines::MPIContainer_var cont = FindOrStartMPIContainer( theComputerContainer ,
-// theComputer ,
-// theMPIContainer,
-// nbproc) ;
-// // ASSERT(!CORBA::is_nil(cont));
-
-// string path( theComputerContainer );
-// path = path + "/";
-// path = path + MPIcomponentName;
-// SCRUTE(path);
-// try
-// {
-// CORBA::Object_var obj = _NS->Resolve(path.c_str());
-// if (CORBA::is_nil(obj))
-// {
-// MESSAGE("MPIComponent not found ! trying to load " << path);
-// Engines::Component_var compo
-// = cont->load_impl(MPIcomponentName, implementation);
-// // ASSERT(!CORBA::is_nil(compo));
-// MESSAGE("MPIComponent launched !" << path);
-// return compo;
-// }
-// else
-// {
-// MESSAGE("MPIComponent found !" << path);
-// Engines::Component_var compo = Engines::Component::_narrow(obj);
-// // ASSERT(!CORBA::is_nil(compo));
-// try
-// {
-// compo->ping();
-// }
-// catch (CORBA::COMM_FAILURE&)
-// {
-// INFOS("Caught CORBA::SystemException CommFailure. Engine "
-// << path << "does not respond" );
-// }
-// return compo;
-// }
-// }
-// catch (ServiceUnreachable&)
-// {
-// INFOS("Caught exception: Naming Service Unreachable");
-// }
-// catch (...)
-// {
-// INFOS("Caught unknown exception.");
-// }
-// return Engines::Component::_nil();
-// }
-
-Engines::Component_var SALOME_MPILifeCycleCORBA::FindOrLoad_MPIComponent
- (const char *MPIcontainerName,
- const char *MPIcomponentName,
- const int nbproc)
-{
-
- char nbp[1024];
-
- sprintf(nbp,"_%d",nbproc);
-// BEGIN_OF("FindOrLoad_Component(2)");
- ASSERT(_NS != NULL);
- string theComputer ;
- string theMPIContainerRoot ;
- string theMPIContainer;
- string theComputerContainer = ContainerName( MPIcontainerName ,
- &theComputer ,
- &theMPIContainerRoot ) ;
- theMPIContainer = theMPIContainerRoot + nbp;
- Engines::MPIContainer_var cont = FindOrStartMPIContainer( theComputer ,
- theMPIContainerRoot,
- nbproc ) ;
-
- if ( CORBA::is_nil( cont ) ) {
- MESSAGE("MPIContainer not found ! " << theComputerContainer );
- return Engines::Component::_nil();
- }
-
-// char * machine = cont->machineName() ;
- const char * machine = theComputer.c_str() ;
-
- string path( theComputerContainer );
- path += nbp;
- path += "/";
- path += MPIcomponentName;
- SCRUTE(path);
-
- try {
- CORBA::Object_var obj = _NS->Resolve(path.c_str());
- if ( CORBA::is_nil( obj ) ) {
- MESSAGE("MPIComponent not found ! trying to load " << path);
- CORBA::Object_var obj2 = _NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj2);
-
- SALOME_ModuleCatalog::Acomponent_ptr compoInfo =
- Catalog->GetComponent(MPIcomponentName);
- if (CORBA::is_nil (compoInfo))
- {
- INFOS("Catalog Error : Component not found in the catalog")
- return Engines::Component::_nil();
-// exit (-1);
- }
-
- string path;
- try
- {
- path = compoInfo->GetPathPrefix( machine ) ;
- path += "/" ;
- }
- catch (SALOME_ModuleCatalog::NotFound&)
- {
- MESSAGE("GetPathPrefix(" << machine << ") not found!"
- << "trying localhost");
- try {
- path = compoInfo->GetPathPrefix("localhost") ;
- path += "/" ;
- }
- catch (SALOME_ModuleCatalog::NotFound&) {
- MESSAGE("GetPathPrefix(localhost) not found!") ;
- path = "" ;
- }
- }
-
- SCRUTE(path);
- string implementation(path);
- implementation += "lib";
- implementation += MPIcomponentName;
- implementation += "Engine.so";
-
- Engines::Component_var compo
- = cont->load_impl(MPIcomponentName, implementation.c_str());
-
-// ASSERT(!CORBA::is_nil(compo));
-// MESSAGE("Component launched !" << path);
- return compo;
- }
- else
- {
- MESSAGE("MPIComponent found !" << path);
- Engines::Component_var compo = Engines::Component::_narrow(obj);
- // ASSERT(!CORBA::is_nil(compo));
- try
- {
- string instanceName = compo->instanceName();
- }
- catch (CORBA::SystemException&)
- {
- INFOS("Caught CORBA::SystemException CommFailure. Engine "
- << path << "does not respond" );
- }
- return compo;
- }
- }
- catch (ServiceUnreachable&)
- {
- INFOS("Caught exception: Naming Service Unreachable");
- }
- catch (...)
- {
- INFOS("Caught unknown exception.");
- }
- return Engines::Component::_nil();
-}
+++ /dev/null
-//=============================================================================
-// File : SALOME_MPILifeCycleCORBA.hxx
-// Created : mar jui 03 14:55:45 CEST 2003
-// Author : Bernard SECHER, CEA
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-
-#ifndef _SALOME_MPILIFECYCLECORBA_HXX_
-#define _SALOME_MPILIFECYCLECORBA_HXX_
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string>
-
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_MPIContainer)
-#include "SALOME_LifeCycleCORBA.hxx"
-
-class SALOME_MPILifeCycleCORBA : public SALOME_LifeCycleCORBA
-{
-public:
- SALOME_MPILifeCycleCORBA();
- SALOME_MPILifeCycleCORBA(SALOME_NamingService *ns);
- virtual ~SALOME_MPILifeCycleCORBA();
-
-// Engines::Component_var FindOrLoad_MPIComponent(const char *MPIcontainerName,
-// const char *MPIcomponentName,
-// const char *implementationPath,
-// const int nbproc);
- Engines::Component_var FindOrLoad_MPIComponent(const char *MPIcontainerName,
- const char *MPIcomponentName,
- const int nbproc);
-protected:
- Engines::MPIContainer_var _MPIFactoryServer ;
-
-private:
- Engines::MPIContainer_var FindOrStartMPIContainer(const std::string theComputer ,
- const std::string theMPIContainerRoot,
- const int nbproc) ;
-
-} ;
-
-#endif
+++ /dev/null
-// using namespace std;
-//=============================================================================
-// File : TestMPILifeCycleCORBA.cxx
-// Created : mer jui 4 13:11:27 CEST 2003
-// Author : Bernard SECHER, 2003
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-
-#include "utilities.h"
-#include <iostream>
-#include <unistd.h>
-#include <string>
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_MPIContainer)
-#include CORBA_CLIENT_HEADER(SALOME_TestMPIComponent)
-
-# include "Utils_ORB_INIT.hxx"
-# include "Utils_SINGLETON.hxx"
-#include "SALOME_NamingService.hxx"
-#include "SALOME_MPILifeCycleCORBA.hxx"
-#include "OpUtil.hxx"
-using namespace std;
-
-int main (int argc, char * argv[])
-{
-
- try{
- // Initializing omniORB
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
- // Obtain a reference to the root POA
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
-
- // Use Name Service to find container
- SALOME_NamingService NS(orb);
-
- SALOME_MPILifeCycleCORBA LCC(&NS);
-
- Engines::Component_var comp = LCC.FindOrLoad_MPIComponent("MPIFactoryServer","TestMPIComponent",2);
-
- Engines::TestMPIComponent_var m1 = Engines::TestMPIComponent::_narrow(comp);
- if(CORBA::is_nil(m1)){
- INFOS("echec recuperation poignee composant");
- }
- else{
-
- INFOS("Lancement de coucou");
- m1->Coucou(1L);
- }
-
- orb->destroy();
- }
- catch(CORBA::COMM_FAILURE& ex) {
- INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.");
- }
- catch(CORBA::SystemException&) {
- INFOS("Caught a CORBA::SystemException.");
- }
- catch(CORBA::Exception&) {
- INFOS("Caught CORBA::Exception.");
- }
- catch(...) {
- INFOS("Caught unknown exception.");
- }
-
- return 0;
-}
endif
ifeq (@mpi_ok@,yes)
- SUBDIRS+= MPIContainer MPILifeCycleCORBA TestMPIContainer
+ SUBDIRS+= MPIContainer TestMPIContainer
endif
ifeq (@WITH_BATCH@,yes)
#include <iostream>
#include <cstring>
+#include <string>
using namespace std;
return _obj;
}
+//----------------------------------------------------------------------
+/*! Function : Resolve Component from hostname, containername, componentName and number of prcoessors
+ * Purpose : method to get the ObjRef of a component
+ * If the NamingService is out, the exception ServiceUnreachable is thrown
+ * \param hostname const char* argument
+ * \param containername const char* argument
+ * \param componentname const char* argument
+ * \param nbproc const int argument
+ * \return the object reference
+ */
+//----------------------------------------------------------------------
+
+CORBA::Object_ptr SALOME_NamingService::ResolveComponent(const char* hostname, const char* containerName, const char* componentName, const int nbproc)
+{
+
+ string name="/Containers/";
+ name += hostname;
+ if( strlen(containerName) != 0 ){
+ name += "/";
+ if( nbproc >=1 ){
+ char *newContainerName = new char[strlen(containerName)+8];
+ sprintf(newContainerName,"%s_%d",containerName,nbproc);
+ name += newContainerName;
+ }
+ else
+ name += containerName;
+ name += "/";
+ name += componentName;
+ return Resolve(name.c_str());
+ }
+ else {
+ Change_Directory(name.c_str());
+ vector<string> contList = list_directory();
+ for(unsigned int ind = 0; ind < contList.size(); ind++){
+ name = contList[ind].c_str();
+ name += "/";
+ name += componentName;
+ CORBA::Object_ptr obj = Resolve(name.c_str());
+ if( !CORBA::is_nil(obj) )
+ return obj;
+ }
+ return CORBA::Object::_nil();
+ }
+
+}
+
+string SALOME_NamingService::ContainerName(const char *containerName)
+{
+ string ret;
+
+ if (strlen(containerName)== 0)
+ ret = "FactoryServer";
+ else
+ ret = containerName;
+
+ return ret;
+}
+
+string SALOME_NamingService::ContainerName(const Engines::MachineParameters& params)
+{
+ int nbproc;
+ if( !params.isMPI )
+ nbproc = 0;
+ else if( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
+ nbproc = 1;
+ else if( params.nb_node == 0 )
+ nbproc = params.nb_proc_per_node;
+ else if( params.nb_proc_per_node == 0 )
+ nbproc = params.nb_node;
+ else
+ nbproc = params.nb_node * params.nb_proc_per_node;
+
+ string ret=ContainerName(params.container_name);
+
+ if( nbproc >=1 ){
+ char *suffix = new char[8];
+ sprintf(suffix,"_%d",nbproc);
+ ret += suffix;
+ }
+
+ return ret;
+}
+
+string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, const char *hostname)
+{
+ string ret="/Containers/";
+ ret += hostname;
+ ret+="/";
+ ret+=ContainerName(containerName);
+
+ return ret;
+}
+
+string SALOME_NamingService::BuildContainerNameForNS(const Engines::MachineParameters& params, const char *hostname)
+{
+ string ret="/Containers/";
+ ret += hostname;
+ ret+="/";
+ ret+=ContainerName(params);
+
+ return ret;
+}
+
//----------------------------------------------------------------------
/*! Function : Find
* Purpose : method to research a name from the current directory
#include <vector>
#include <string>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
+#include CORBA_CLIENT_HEADER(SALOME_Component)
//class ServiceUnreachable;
#include "ServiceUnreachable.hxx"
CORBA::Object_ptr Resolve(const char* Path)
throw( ServiceUnreachable);
+ //! method to get the ObjRef of a component
+ CORBA::Object_ptr ResolveComponent(const char* hostname, const char* containerName, const char* componentName, const int nbproc=0);
+
+ std::string ContainerName(const char *ContainerName);
+ std::string ContainerName(const Engines::MachineParameters& params);
+
+ std::string BuildContainerNameForNS(const char *ContainerName, const char *hostname);
+ std::string BuildContainerNameForNS(const Engines::MachineParameters& params, const char *hostname);
+
//! method to research a name from the naming service's current directory
int Find(const char* name)
throw(ServiceUnreachable);
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Registry)
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
#include <IntervalWindow.hxx>
#include <unistd.h>
#include <fstream>
#include <iostream>
+#include <sstream>
#include <string.h>
#include <map>
#include <list>
using namespace std;
//just for test
-SALOME_ResourcesManager::SALOME_ResourcesManager(const char *xmlFilePath):_path_resources(xmlFilePath)
+SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb,const char *xmlFilePath):_path_resources(xmlFilePath)
{
+ _NS=new SALOME_NamingService(orb);
}
-SALOME_ResourcesManager::SALOME_ResourcesManager()
+SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb)
{
+ _NS=new SALOME_NamingService(orb);
_path_resources=getenv("KERNEL_ROOT_DIR");
_path_resources+="/share/salome/resources/CatalogResources.xml";
ParseXmlFile();
SALOME_ResourcesManager::~SALOME_ResourcesManager()
{
+ delete _NS;
}
vector<string> SALOME_ResourcesManager::GetFittingResources(const Engines::MachineParameters& params,const char *moduleName) throw(SALOME_Exception)
{
+ MESSAGE("ResourcesManager::GetFittingResources");
vector <std::string> ret;
//To be sure that we search in a correct list.
ParseXmlFile();
const char *hostname=(const char *)params.hostname;
if(hostname[0]!='\0')
{
- if(_resourcesList.find(hostname)!=_resourcesList.end())
+ if( strcmp(hostname,"localhost") == 0 || strcmp(hostname,GetHostname().c_str()) == 0 )
+ ret.push_back(GetHostname().c_str());
+ else if(_resourcesList.find(hostname)!=_resourcesList.end())
// params.hostame is in the list of resources so return it.
ret.push_back(hostname);
else
return _dynamicResourcesSelecter.FindBest(listOfMachines);
}
-string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const string& machine,const char *containerName)
+string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const string& machine,const Engines::MachineParameters& params)
{
_TmpFileName=BuildTemporaryFileName();
ofstream tempOutputFile;
tempOutputFile << "export PYTHONPATH" << endl;
tempOutputFile << "source " << resInfo.PreReqFilePath << endl;
// ! env vars
+ if(params.isMPI){
+ tempOutputFile << "mpirun -np ";
+ int nbproc;
+ if( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
+ nbproc = 1;
+ else if( params.nb_node == 0 )
+ nbproc = params.nb_proc_per_node;
+ else if( params.nb_proc_per_node == 0 )
+ nbproc = params.nb_node;
+ else
+ nbproc = params.nb_node * params.nb_proc_per_node;
+ std::ostringstream o;
+ tempOutputFile << nbproc << " ";
+ }
tempOutputFile << (*(resInfo.ModulesPath.find("KERNEL"))).second << "/bin/salome/";
- if(Engines_Container_i::isPythonContainer(containerName))
- tempOutputFile << "SALOME_ContainerPy.py ";
- else
- tempOutputFile << "SALOME_Container ";
- tempOutputFile << containerName << " -";
+ if(params.isMPI){
+ if(Engines_Container_i::isPythonContainer(params.container_name))
+ tempOutputFile << "pyMPI SALOME_ContainerPy.py ";
+ else
+ tempOutputFile << "SALOME_MPIContainer ";
+ }
+ else{
+ if(Engines_Container_i::isPythonContainer(params.container_name))
+ tempOutputFile << "SALOME_ContainerPy.py ";
+ else
+ tempOutputFile << "SALOME_Container ";
+ }
+ tempOutputFile << _NS->ContainerName(params) << " -";
AddOmninamesParams(tempOutputFile);
tempOutputFile << " &" << endl;
tempOutputFile.flush();
command+=_TmpFileName;
command += " > ";
command += "/tmp/";
- command += containerName;
+ command += _NS->ContainerName(params);
command += "_";
command += machine;
- command += ".log &";
+ command += ".log 2>&1 &";
cout << "Command is ... " << command << endl;
return command;
}
-string SALOME_ResourcesManager::BuildCommandToLaunchLocalContainer(const char *containerName)
+string SALOME_ResourcesManager::BuildCommandToLaunchLocalContainer(const Engines::MachineParameters& params)
{
_TmpFileName="";
string command;
- if(Engines_Container_i::isPythonContainer(containerName))
- command="SALOME_ContainerPy.py ";
- else
- command="SALOME_Container ";
- command+=containerName;
+ int nbproc=0;
+ if(params.isMPI){
+ command="mpirun -np ";
+ if( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
+ nbproc = 1;
+ else if( params.nb_node == 0 )
+ nbproc = params.nb_proc_per_node;
+ else if( params.nb_proc_per_node == 0 )
+ nbproc = params.nb_node;
+ else
+ nbproc = params.nb_node * params.nb_proc_per_node;
+ std::ostringstream o;
+ o << nbproc << " ";
+ command += o.str();
+ if(Engines_Container_i::isPythonContainer(params.container_name))
+ command+="pyMPI SALOME_ContainerPy.py ";
+ else
+ command+="SALOME_MPIContainer ";
+ }
+ else{
+ if(Engines_Container_i::isPythonContainer(params.container_name))
+ command="SALOME_ContainerPy.py ";
+ else
+ command="SALOME_Container ";
+ }
+ command+=_NS->ContainerName(params);
command+=" -";
AddOmninamesParams(command);
command+=" > /tmp/";
- command+=containerName;
+ command+=_NS->ContainerName(params);
command += "_";
command += GetHostname();
command += ".log 2>&1 &" ;
#include <SALOMEconfig.h>
#include "SALOME_ResourcesCatalog_Handler.hxx"
#include "SALOME_LoadRateManager.hxx"
+#include "SALOME_NamingService.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
#include <string>
#include <fstream>
{
public:
//! standard constructor
- SALOME_ResourcesManager();
+ SALOME_ResourcesManager(CORBA::ORB_ptr orb);
//!just for test
- SALOME_ResourcesManager(const char *xmlFilePath);
+ SALOME_ResourcesManager(CORBA::ORB_ptr orb,const char *xmlFilePath);
//! standard destructor
~SALOME_ResourcesManager();
std::string FindBest(const Engines::MachineList& listOfMachines);
//! method that builds in a temporary file the script to be launched
- std::string BuildTempFileToLaunchRemoteContainer(const std::string& machine,const char *containerName);
+ std::string BuildTempFileToLaunchRemoteContainer(const std::string& machine,const Engines::MachineParameters& params);
//! method that builds the command to be launched.
- std::string BuildCommandToLaunchLocalContainer(const char *containerName);
+ std::string BuildCommandToLaunchLocalContainer(const Engines::MachineParameters& params);
//! method that remove the generated temporary file in case of a remote launch.
void RmTmpFile();
const MapOfParserResourcesType& GetList() const;
private:
+ SALOME_NamingService *_NS;
//! method to verify ressources catalog content - return true if verfication is OK
bool _verify_resources(MapOfParserResourcesType resourceslist);
BIN_CLIENT_IDL = Logger.idl SALOME_MPIObject.idl SALOME_MPIContainer.idl SALOME_TestMPIComponent.idl
BIN_SERVER_IDL =
-LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeMPILifeCycleCORBA -lSalomeLifeCycleCORBA -lSalomeMPIContainer -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace ${MPI_LIBS}
+LDFLAGSFORBIN+= -lSalomeNotification -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeMPIContainer -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace -lSalomeResourcesManager ${MPI_LIBS}
CXXFLAGS+=${MPI_INCLUDES}
CXX_DEPEND_FLAG+=${MPI_INCLUDES}
# include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
#include "OpUtil.hxx"
-#include "LocalTraceCollector.hxx"
+#include "SALOMETraceCollector.hxx"
using namespace std;
int main (int argc, char * argv[])
// Initializing omniORB
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
CORBA::ORB_var &orb = init( argc , argv ) ;
- LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb);
+ SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
BEGIN_OF(argv[0])
try{
// // Clean-up.
// // iGenFact->finalize_removal() ;
// // sleep(5);
- iGenFact->MPIShutdown();
+ iGenFact->Shutdown();
// INFOS("shut down corba server for Test MPI Container");
// orb->destroy();
}