1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 #include "MPIContainer_i.hxx"
26 #include "Utils_ORB_INIT.hxx"
27 #include "Utils_SINGLETON.hxx"
28 #include "utilities.h"
30 int main(int argc, char* argv[])
34 MPI_Init(&argc,&argv);
35 MPI_Comm_size(MPI_COMM_WORLD,&nbproc);
36 MPI_Comm_rank(MPI_COMM_WORLD,&numproc);
38 // Initialise the ORB.
39 ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
40 CORBA::ORB_var &orb = init( argc , argv ) ;
41 // SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
43 BEGIN_OF("[" << numproc << "] " << argv[0])
46 // Obtain a reference to the root POA.
47 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
48 PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj);
50 // obtain the root poa manager
51 PortableServer::POAManager_var pman = root_poa->the_POAManager();
53 char *containerName = (char *)"";
56 containerName = argv[1] ;
59 MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant");
60 new Engines_MPIContainer_i(nbproc,numproc,orb,root_poa, containerName,argc,argv);
67 catch(CORBA::SystemException&){
68 INFOS("Caught CORBA::SystemException.");
70 catch(PortableServer::POA::WrongPolicy&){
71 INFOS("Caught CORBA::WrongPolicyException.");
73 catch(PortableServer::POA::ServantAlreadyActive&){
74 INFOS("Caught CORBA::ServantAlreadyActiveException");
76 catch(CORBA::Exception&){
77 INFOS("Caught CORBA::Exception.");
80 INFOS("Caught unknown exception.");
85 END_OF("[" << numproc << "] " << argv[0]);