From: ribes Date: Thu, 26 Mar 2009 14:07:19 +0000 (+0000) Subject: Use PaCO++ event service to synchronise port creation X-Git-Tag: new_launcher_alpha_091119~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=516affb85cb5cc25baa188aee49bb8a764824e84;p=modules%2Fkernel.git Use PaCO++ event service to synchronise port creation --- diff --git a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx index 06eecd118..4484eba24 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx @@ -22,6 +22,7 @@ #include #include +#include #include "Param_Double_Port_provides_i.hxx" @@ -168,28 +169,57 @@ Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo, GaBro * dislib_gabro = (GaBro *) method_ptr->getDistLibArg("param_results", "out"); dislib_gabro->setEltSize(sizeof(CORBA::Double)); - com->paco_barrier(); - // Enregistement du port - for (int i = 0; i < totalNode; i++) { + for (int i = 0; i < totalNode; i++) + { + std::ostringstream node_number; + node_number << i; + std::string event_name("AddNode"); + event_name += node_number.str(); + std::string tag_name = proxy_ior; + if (i == rank) { std::cerr << "Adding node of processor : " << i << std::endl; par_compo->add_parallel_provides_node_port(Ports::Port_PaCO::_narrow(port->_this()), port_name.c_str()); port->_remove_ref(); + par_compo->InterfaceParallel_impl::_proxy->send_event(event_name.c_str(), tag_name.c_str()); } - com->paco_barrier(); + + par_compo->wait_event(event_name.c_str(), tag_name.c_str()); } // On démarre l'objet parallèle - if (rank == 0) { + std::string event_name("StartingProxy"); + std::string tag_name = proxy_ior; + if (rank == 0) + { proxy_node->start(); - com->paco_barrier(); + par_compo->InterfaceParallel_impl::_proxy->send_event(event_name.c_str(), tag_name.c_str()); } - else - com->paco_barrier(); return port; } +void +Param_Double_Port_provides_i::wait_init_port(Engines_ParallelDSC_i * par_compo, + std::string port_name, + CORBA::ORB_ptr orb) +{ + int rank = par_compo->getMyRank(); + int totalNode = par_compo->getTotalNode(); + // Enregistement du port + for (int i = 0; i < totalNode; i++) + { + std::ostringstream node_number; + node_number << i; + std::string event_name("WaitingNode"); + event_name += node_number.str(); + std::string tag_name = (char * ) par_compo->get_proxy(port_name.c_str()); + if (i == rank) + par_compo->InterfaceParallel_impl::_proxy->send_event(event_name.c_str(), tag_name.c_str()); + par_compo->wait_event(event_name.c_str(), tag_name.c_str()); + } +} + void Param_Double_Port_provides_i::put(const Ports::Param_Double_Port::seq_double & param_data) { diff --git a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx index 3eba98b21..7a01fc56c 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx @@ -50,6 +50,10 @@ class Param_Double_Port_provides_i : std::string port_name, CORBA::ORB_ptr orb); + // Méthode temporaire en attendant d'avoir des méthodes parallèles bien synchronisé + static void wait_init_port(Engines_ParallelDSC_i * par_compo, + std::string port_name, + CORBA::ORB_ptr orb); private: // Buffers pour la réception et l'envoi Ports::Param_Double_Port::seq_double * _seq_data; diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx index f6eb80b37..a80d51f08 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx @@ -194,6 +194,11 @@ Container_proxy_impl_final::load_component_Library(const char* componentName) } else { + MESSAGE("Error in importing Cpp component : " << impl_name); +#ifndef WIN32 + MESSAGE("dlerror() result is : " << dlerror()); +#endif + MESSAGE("Try to import Python component "<