From 46962229d9f97f3465cdd9d0cf0e1a548c9418a6 Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 25 Mar 2009 10:15:12 +0000 Subject: [PATCH] =?utf8?q?-=20Mise=20=C3=83=C2=A0=20jour=20des=20executabl?= =?utf8?q?es=20pour=20MPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../SALOME_ParallelContainerNodeMpi.cxx | 27 +++++--------- .../SALOME_ParallelContainerProxyDummy.cxx | 4 +-- .../SALOME_ParallelContainerProxyMpi.cxx | 36 ++++++++++--------- 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx index cb8d8b700..bb73976e1 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx @@ -58,15 +58,6 @@ using namespace std; #ifdef _DEBUG_ #include -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", ¶llel_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 ; } diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx index 3b078228e..3521a46d8 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx @@ -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(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx index 82b28a8bf..f3029370e 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx @@ -37,7 +37,7 @@ //#include "SALOME_ComponentPaCO_Engines_Container_server.h" #include "SALOME_ParallelContainerProxy_i.hxx" #include -#include +#include #include @@ -49,10 +49,12 @@ #include "Utils_SINGLETON.hxx" #include "SALOMETraceCollector.hxx" #include "OpUtil.hxx" -using namespace std; + +#include "Container_init_python.hxx" #ifdef _DEBUG_ #include +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, ¶llel_object_group); - proxy->setLibCom("mpi", ¶llel_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 ; } -- 2.39.2