#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);
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) ) ;
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()
{
}
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 *,
// --- 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
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 *,
// 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) ;
#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()
{
}
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() ;
}
}