+++ /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;
-}