1 //=============================================================================
2 // File : TestMPIComponentEngine.cxx
3 // Created : mer jui 4 12:28:26 CEST 2003
4 // Author : Bernard SECHER, 2003
6 // Copyright : CEA 2003
8 //=============================================================================
11 #include "utilities.h"
12 #include "TestMPIComponentEngine.hxx"
15 TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
17 PortableServer::POA_ptr poa,
18 PortableServer::ObjectId * contId,
19 const char *instanceName,
20 const char *interfaceName,
22 Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc)
24 MESSAGE("activate object")
26 _id = _poa->reference_to_id(_thisObj->_this());
29 TestMPIComponentEngine::TestMPIComponentEngine(): Engines_Component_i(), MPIObject_i()
33 TestMPIComponentEngine::~TestMPIComponentEngine()
37 void TestMPIComponentEngine::Coucou(CORBA::Long L)
40 for(int ip=1;ip<_nbproc;ip++)
41 Engines::TestMPIComponent::_narrow((*_tior)[ip])->SPCoucou(L);
45 void TestMPIComponentEngine::SPCoucou(CORBA::Long L)
47 BEGIN_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
48 MESSAGE("[" << _numproc << "] TestMPIComponentEngine : L = " << L);
49 END_OF("[" << _numproc << "] TestMPIComponentEngine::Coucou()");
50 MPI_Barrier(MPI_COMM_WORLD);
55 PortableServer::ObjectId * TestMPIComponentEngine_factory(
56 int nbproc, int numproc,
58 PortableServer::POA_ptr poa,
59 PortableServer::ObjectId * contId,
60 const char *instanceName,
61 const char *interfaceName)
64 TestMPIComponentEngine * myTestMPIComponent;
65 MESSAGE("[" << numproc << "] PortableServer::ObjectId * TestMPIComponentEngine_factory()");
66 SCRUTE(interfaceName);
73 = new TestMPIComponentEngine(nbproc,numproc,orb, poa, contId, instanceName, interfaceName,regist);
74 return myTestMPIComponent->getId() ;