#include "Utils_SINGLETON.hxx"
#include "utilities.h"
#include <mpi.h>
+#include "SALOMETraceCollector.hxx"
using namespace std;
int main(int argc, char* argv[])
{
int nbproc, numproc;
- int flag;
Engines_MPIContainer_i * myContainer=NULL;
- BEGIN_OF(argv[0])
+ MPI_Init(&argc,&argv);
+ MPI_Comm_size(MPI_COMM_WORLD,&nbproc);
+ MPI_Comm_rank(MPI_COMM_WORLD,&numproc);
+
+ // Initialise the ORB.
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
+ // SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
+
+ BEGIN_OF("[" << numproc << "] " << argv[0])
try {
- MESSAGE("Connection MPI");
- MPI_Init(&argc,&argv);
- MPI_Comm_size(MPI_COMM_WORLD,&nbproc);
- MPI_Comm_rank(MPI_COMM_WORLD,&numproc);
-
- MESSAGE("[" << numproc << "] Initialisation CORBA");
- // Initialise the ORB.
- // CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
-
// Obtain a reference to the root POA.
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj);
containerName = argv[1] ;
}
- MESSAGE("[" << numproc << "] Chargement container");
+ MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant");
myContainer = new Engines_MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName,argc,argv);
pman->activate();
orb->run();
- orb->destroy();
}
catch(CORBA::SystemException&){
if(myContainer)
delete myContainer;
- MPI_Initialized(&flag);
- if(flag)
- MPI_Finalize();
- END_OF(argv[0]);
+ END_OF("[" << numproc << "] " << argv[0]);
+ // delete myThreadTrace;
+
+ MPI_Finalize();
+
}