From 0fa852a730f699722c4f4aafc88c6265f529357d Mon Sep 17 00:00:00 2001 From: ribes Date: Tue, 24 Mar 2009 15:21:15 +0000 Subject: [PATCH] - create_component_instance patch - proxy correctly registered --- idl/SALOME_PACOExtension.idl | 1 + .../SALOME_ParallelContainerNodeDummy.cxx | 3 +-- src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx | 3 +-- src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx | 5 +++-- src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx | 2 ++ src/ParallelContainer/SALOME_ParallelContainer_i.cxx | 5 +++-- src/ParallelContainer/SALOME_ParallelContainer_i.hxx | 7 +++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/idl/SALOME_PACOExtension.idl b/idl/SALOME_PACOExtension.idl index 6ebecd2d5..eb7a5d0cd 100644 --- a/idl/SALOME_PACOExtension.idl +++ b/idl/SALOME_PACOExtension.idl @@ -43,6 +43,7 @@ module Engines // Replicated Method used by the proxy to create // a PACO Component void create_paco_component_node_instance(in string registeredName, + in string proxy_containerName, in long studyId) raises(SALOME::SALOME_Exception); }; diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx index 2d63fb98d..10139688a 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx @@ -161,8 +161,7 @@ int main(int argc, char* argv[]) proxy_ior, myid, root_poa, - node_name, - containerName); + node_name); // PaCO++ init paco_fabrique_manager * pfm = paco_getFabriqueManager(); pfm->register_com("dummy", new paco_dummy_fabrique()); diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx index 082c3f263..cb8d8b700 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx @@ -198,8 +198,7 @@ int main(int argc, char* argv[]) proxy_ior, myid, root_poa, - node_name, - containerName); + node_name); // PaCO++ init paco_fabrique_manager * pfm = paco_getFabriqueManager(); pfm->register_com("mpi", new paco_mpi_fabrique()); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx index bb09e0978..8fc2d3ee8 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx @@ -35,7 +35,8 @@ Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb, InterfaceManager_impl(orb, fab_thread, is_a_return_proxy) { _numInstance = 0; - _containerName = containerName; + _hostname = Kernel_Utils::GetHostname(); + _containerName = _NS->BuildContainerNameForNS(containerName.c_str(), _hostname.c_str()); _poa = PortableServer::POA::_duplicate(poa); _fab_thread = fab_thread; @@ -317,7 +318,7 @@ Container_proxy_impl_final::create_component_instance(const char* componentName, { try { - node->create_paco_component_node_instance(componentName, studyId); + node->create_paco_component_node_instance(componentName, _containerName.c_str(), studyId); MESSAGE("Call create_paco_component_node_instance done on node : " << i); } catch (SALOME::SALOME_Exception & ex) diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx index 26a880220..abc6b54b0 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx @@ -27,6 +27,7 @@ #define _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_ #include "utilities.h" +#include "Basics_Utils.hxx" #include "SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.hxx" #include "SALOME_ParallelGlobalProcessVar_i.hxx" #include "SALOME_NamingService.hxx" @@ -78,6 +79,7 @@ class Container_proxy_impl_final : const char *, int); int _numInstance; + std::string _hostname; std::string _containerName; PortableServer::POA_var _poa; PortableServer::ObjectId * _id; diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx index f7d43e65d..ef4310a8c 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@ -77,7 +77,6 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb, int rank, PortableServer::POA_ptr poa, std::string containerName, - std::string proxy_containerName, bool isServantAloneInProcess) : InterfaceParallel_impl(orb,ior,rank), Engines::PACO_Container_serv(orb,ior,rank), @@ -101,7 +100,6 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb, _NS = new SALOME_NamingService(); _NS->init_orb(_orb); _containerName = _NS->BuildContainerNameForNS(containerName.c_str(), _hostname.c_str()); - _proxy_containerName = proxy_containerName; // Init Python container part CORBA::String_var sior = _orb->object_to_string(container_node); @@ -884,12 +882,15 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, void Engines_Parallel_Container_i::create_paco_component_node_instance(const char* componentName, + const char* proxy_containerName, CORBA::Long studyId) { // Init de la méthode char * proxy_ior; Engines::Component_PaCO_var work_node; std::string aCompName = componentName; + std::string _proxy_containerName = proxy_containerName; + #ifndef WIN32 string impl_name = string ("lib") + aCompName +string("Engine.so"); #else diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx index 830f676dc..877cc1e07 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx @@ -65,7 +65,6 @@ public: int rank, PortableServer::POA_ptr poa, std::string containerName , - std::string proxy_containerName, bool isServantAloneInProcess = true); virtual ~Engines_Parallel_Container_i(); @@ -87,8 +86,9 @@ public: const char* componentName); void - create_paco_component_node_instance( const char* componentName, - CORBA::Long studyId); // 0 for multiStudy + create_paco_component_node_instance(const char* componentName, + const char* proxy_containerName, + CORBA::Long studyId); // 0 for multiStudy void remove_impl(Engines::Component_ptr component_i); void finalize_removal(); @@ -136,7 +136,6 @@ protected: std::string _hostname; std::string _library_path; std::string _containerName; - std::string _proxy_containerName; std::string _logfilename; CORBA::ORB_var _orb; PortableServer::POA_var _poa; -- 2.39.2