From: secher Date: Tue, 18 May 2010 14:36:51 +0000 (+0000) Subject: only default constructor is needed for MPIObject X-Git-Tag: Plotenh~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c68573d3a54148b70f775049a59d6f1e34a8f00;p=modules%2Fkernel.git only default constructor is needed for MPIObject --- diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index a4b8acdc4..e1ca6cc6b 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -41,12 +41,11 @@ #include "Container_init_python.hxx" // L'appel au registry SALOME ne se fait que pour le process 0 -Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, - CORBA::ORB_ptr orb, +Engines_MPIContainer_i::Engines_MPIContainer_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char * containerName, int argc, char *argv[]) - : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc) + : Engines_Container_i(orb,poa,containerName,argc,argv,false) { _id = _poa->activate_object(this); @@ -54,7 +53,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, Engines::Container_var pCont = Engines::Container::_narrow(obj); _remove_ref(); - if(numproc==0){ + if(_numproc==0){ _NS = new SALOME_NamingService(); _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ; @@ -71,8 +70,8 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, BCastIOR(_orb,pobj,true); } -Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc) - : Engines_Container_i(), MPIObject_i(nbproc,numproc) +Engines_MPIContainer_i::Engines_MPIContainer_i() + : Engines_Container_i() { } @@ -326,8 +325,7 @@ Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName, std::string factory_name = aGenRegisterName + std::string("Engine_factory"); typedef PortableServer::ObjectId * (*MPIFACTORY_FUNCTION) - (int,int, - CORBA::ORB_ptr, + (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, @@ -365,8 +363,7 @@ Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName, // --- Instanciate required CORBA object PortableServer::ObjectId *id ; //not owner, do not delete (nore use var) - id = (MPIComponent_factory) ( _nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), - aGenRegisterName.c_str() ) ; + id = (MPIComponent_factory) ( _orb, _poa, _id, instanceName.c_str(), aGenRegisterName.c_str() ) ; // --- get reference & servant from id @@ -468,14 +465,12 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ; dlerror(); - PortableServer::ObjectId * (*MPIComponent_factory) (int,int, - CORBA::ORB_ptr, + PortableServer::ObjectId * (*MPIComponent_factory) (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, const char *) = - (PortableServer::ObjectId * (*) (int,int, - CORBA::ORB_ptr, + (PortableServer::ObjectId * (*) (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, @@ -494,7 +489,7 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( // Instanciation du composant parallele MESSAGE("[" << _numproc << "] Try to load a parallel component"); PortableServer::ObjectId * id = (MPIComponent_factory) - (_nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), _nameToRegister.c_str()); + (_orb, _poa, _id, instanceName.c_str(), _nameToRegister.c_str()); // get reference from id CORBA::Object_var o = _poa->id_to_reference(*id); pobj = Engines::MPIObject::_narrow(o) ; diff --git a/src/MPIContainer/MPIContainer_i.hxx b/src/MPIContainer/MPIContainer_i.hxx index 6b5c6eefb..88b29e4d1 100644 --- a/src/MPIContainer/MPIContainer_i.hxx +++ b/src/MPIContainer/MPIContainer_i.hxx @@ -54,12 +54,11 @@ class Engines_MPIContainer_i : public POA_Engines::MPIContainer, public: // Constructor - Engines_MPIContainer_i( int nbproc, int numproc, - CORBA::ORB_ptr orb, + Engines_MPIContainer_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char * containerName, int argc, char *argv[]); - Engines_MPIContainer_i(int nbproc, int numproc); + Engines_MPIContainer_i(); // Destructor ~Engines_MPIContainer_i(); diff --git a/src/MPIContainer/MPIObject_i.cxx b/src/MPIContainer/MPIObject_i.cxx index fa5907612..fd04587e1 100644 --- a/src/MPIContainer/MPIObject_i.cxx +++ b/src/MPIContainer/MPIObject_i.cxx @@ -37,13 +37,6 @@ MPIObject_i::MPIObject_i() _tior=NULL; } -MPIObject_i::MPIObject_i(int nbproc, int numproc) -{ - _nbproc = nbproc; - _numproc = numproc; - _tior=NULL; -} - MPIObject_i::~MPIObject_i() { if(_tior) delete _tior; diff --git a/src/MPIContainer/MPIObject_i.hxx b/src/MPIContainer/MPIObject_i.hxx index 049021c66..a00768929 100644 --- a/src/MPIContainer/MPIObject_i.hxx +++ b/src/MPIContainer/MPIObject_i.hxx @@ -36,7 +36,6 @@ class MPIObject_i: public virtual POA_Engines::MPIObject { public: MPIObject_i(); - MPIObject_i(int nbproc, int numproc); ~MPIObject_i(); Engines::IORTab* tior(); diff --git a/src/MPIContainer/SALOME_MPIContainer.cxx b/src/MPIContainer/SALOME_MPIContainer.cxx index c42a995fe..fa5d54a17 100644 --- a/src/MPIContainer/SALOME_MPIContainer.cxx +++ b/src/MPIContainer/SALOME_MPIContainer.cxx @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) } MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant"); - new Engines_MPIContainer_i(nbproc,numproc,orb,root_poa, containerName,argc,argv); + new Engines_MPIContainer_i(orb,root_poa, containerName,argc,argv); pman->activate(); diff --git a/src/TestMPIContainer/TestMPIComponentEngine.cxx b/src/TestMPIContainer/TestMPIComponentEngine.cxx index 443f04cd0..0e7602056 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.cxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.cxx @@ -32,21 +32,20 @@ #include "utilities.h" #include "TestMPIComponentEngine.hxx" -TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, +TestMPIComponentEngine::TestMPIComponentEngine(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, bool regist) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc) + Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist) { MESSAGE("activate object") _thisObj = this ; _id = _poa->reference_to_id(_thisObj->_this()); } -TestMPIComponentEngine::TestMPIComponentEngine(): Engines_Component_i(), MPIObject_i() +TestMPIComponentEngine::TestMPIComponentEngine() { } @@ -73,24 +72,26 @@ void TestMPIComponentEngine::SPCoucou(CORBA::Long L) extern "C" { PortableServer::ObjectId * TestMPIComponentEngine_factory( - int nbproc, int numproc, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) { + int numproc; bool regist; TestMPIComponentEngine * myTestMPIComponent; + MESSAGE("[" << numproc << "] PortableServer::ObjectId * TestMPIComponentEngine_factory()"); SCRUTE(interfaceName); + MPI_Comm_rank( MPI_COMM_WORLD, &numproc ); if(numproc==0) regist = true; else regist = false; myTestMPIComponent - = new TestMPIComponentEngine(nbproc,numproc,orb, poa, contId, instanceName, interfaceName,regist); + = new TestMPIComponentEngine(orb, poa, contId, instanceName, interfaceName,regist); return myTestMPIComponent->getId() ; } } diff --git a/src/TestMPIContainer/TestMPIComponentEngine.hxx b/src/TestMPIContainer/TestMPIComponentEngine.hxx index ea422bce3..df161dffa 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.hxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.hxx @@ -43,8 +43,7 @@ class TestMPIComponentEngine: { public: TestMPIComponentEngine(); - TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, + TestMPIComponentEngine(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName,