]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Mise à jour des executables pour MPI
authorribes <ribes>
Wed, 25 Mar 2009 10:15:12 +0000 (10:15 +0000)
committerribes <ribes>
Wed, 25 Mar 2009 10:15:12 +0000 (10:15 +0000)
src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx
src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx
src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx

index cb8d8b700bd4b0e4b1ec67fc997e892622785b31..bb73976e132f4c29835cdd4cf64477cb6d45cd80 100644 (file)
@@ -58,15 +58,6 @@ using namespace std;
 #ifdef _DEBUG_
 #include <signal.h>
 
-void test(int sigval) {
-  cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
-  cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
-  cerr << "SIGSEGV in :" << getpid() << endl;
-  cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
-  cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
-  while (1) {}
-}
-
 void handler(int t) {
   cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
   cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
@@ -193,12 +184,11 @@ int main(int argc, char* argv[])
 
     // Node creation
     string node_name = containerName + "Node";
-    Engines_Parallel_Container_i * servant = 
-      new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), 
-                                      proxy_ior,
-                                      myid,
-                                      root_poa,
-                                      node_name);
+    Engines_Parallel_Container_i * servant =  new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), 
+                                                                              proxy_ior,
+                                                                              myid,
+                                                                              root_poa,
+                                                                              node_name);
     // PaCO++ init
     paco_fabrique_manager * pfm = paco_getFabriqueManager();
     pfm->register_com("mpi", new paco_mpi_fabrique());
@@ -208,6 +198,7 @@ int main(int argc, char* argv[])
     servant->setLibCom("mpi", &parallel_object_group);
     servant->setLibThread("omni");
 
+    // Activation
     obj = servant->_this();
 
     // In the NamingService
@@ -227,6 +218,9 @@ int main(int argc, char* argv[])
     PyGILState_Ensure();
     //Delete python container that destroy orb from python (pyCont._orb.destroy())
     Py_Finalize();
+    MPI_Finalize();
+    CORBA::string_free(proxy_ior);
+    delete ns;
   }
   catch (PaCO::PACO_Exception& e)
   {
@@ -253,9 +247,6 @@ int main(int argc, char* argv[])
   {
     INFOS("Caught unknown exception.");
   }
-
-  MPI_Finalize();
-
   return 0 ;
 }
 
index 3b078228e8b3216f81ed2ccfa55b7596e2923244..3521a46d81d199fbc024f28a7f1b41c97724fc54 100644 (file)
@@ -84,6 +84,7 @@ int main(int argc, char* argv[])
   int nbnodes = 1;
   if(argc > 4) 
     sscanf(argv[4],"%d",&nbnodes);
+
   try {  
     CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
     ASSERT(!CORBA::is_nil(obj));
@@ -98,9 +99,6 @@ int main(int argc, char* argv[])
 #endif
 
     SALOME_NamingService * ns = new SALOME_NamingService(orb);
-//    Engines::Container_proxy_impl * proxy = 
-//      new Engines::Container_proxy_impl(orb,
-//                                     new paco_omni_fabrique());
 
     // PaCO++ code
     paco_fabrique_manager* pfm = paco_getFabriqueManager();
index 82b28a8bf26c517bb961e549c05b19f7b4f020a4..f3029370e3b792a7a257ac67d1b8597239ca77a3 100644 (file)
@@ -37,7 +37,7 @@
 //#include "SALOME_ComponentPaCO_Engines_Container_server.h"
 #include "SALOME_ParallelContainerProxy_i.hxx"
 #include <paco_omni.h>
-#include <paco_mpi.h>
+#include <paco_dummy.h>
 
 #include <mpi.h>
 
 #include "Utils_SINGLETON.hxx"
 #include "SALOMETraceCollector.hxx"
 #include "OpUtil.hxx"
-using namespace std;
+
+#include "Container_init_python.hxx"
 
 #ifdef _DEBUG_
 #include <signal.h>
+using namespace std;
 
 typedef void (*sighandler_t)(int);
 sighandler_t setsig(int sig, sighandler_t handler)
@@ -120,6 +122,7 @@ int main(int argc, char* argv[])
   int provided;
   MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED ,&provided);
   CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+  KERNEL_PYTHON::init_python(argc,argv);
 
 #ifdef _DEBUG_
   if(getenv ("DEBUGGER"))
@@ -151,22 +154,19 @@ int main(int argc, char* argv[])
 #endif
 
     SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb));
-//    Engines::Container_proxy_impl * proxy = 
-//      new Engines::Container_proxy_impl(orb, 
-//                                     new paco_omni_fabrique());
-    Container_proxy_impl_final * proxy = 
-      new Container_proxy_impl_final(orb,
-                                    new paco_omni_fabrique(),
-                                    root_poa,
-                                    containerName);
 
     // PaCO++ code
     paco_fabrique_manager* pfm = paco_getFabriqueManager();
-    pfm->register_com("mpi", new paco_mpi_fabrique());
-    MPI_Comm parallel_object_group;
-    MPI_Comm_dup(MPI_COMM_WORLD, &parallel_object_group);
-    proxy->setLibCom("mpi", &parallel_object_group);
+    pfm->register_com("dummy", new paco_dummy_fabrique());
     pfm->register_thread("omnithread", new paco_omni_fabrique());
+
+    Container_proxy_impl_final * proxy =   new Container_proxy_impl_final(orb,
+                                                                         pfm->get_thread("omnithread"),
+                                                                         root_poa,
+                                                                         containerName);
+
+    // PaCO++ code
+    proxy->setLibCom("dummy", proxy);
     proxy->setLibThread("omnithread");
     PaCO::PacoTopology_t serveur_topo;
     serveur_topo.total = nb_nodes;
@@ -186,6 +186,11 @@ int main(int argc, char* argv[])
     ns->Register(pCont, _containerName.c_str());
     pman->activate();
     orb->run();
+    PyGILState_Ensure();
+    //Delete python container that destroy orb from python (pyCont._orb.destroy())
+    Py_Finalize();
+    MPI_Finalize();
+    delete ns;
   }
   catch (PaCO::PACO_Exception& e)
   {
@@ -212,9 +217,6 @@ int main(int argc, char* argv[])
   {
     INFOS("Caught unknown exception.");
   }
-
-  MPI_Finalize();
-
   return 0 ;
 }