]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- create_component_instance patch
authorribes <ribes>
Tue, 24 Mar 2009 15:21:15 +0000 (15:21 +0000)
committerribes <ribes>
Tue, 24 Mar 2009 15:21:15 +0000 (15:21 +0000)
- proxy correctly registered

idl/SALOME_PACOExtension.idl
src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx
src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx
src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx
src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx
src/ParallelContainer/SALOME_ParallelContainer_i.cxx
src/ParallelContainer/SALOME_ParallelContainer_i.hxx

index 6ebecd2d58d443db40532d6fef0429947d9c4cf4..eb7a5d0cda25425cacf7503c663ed74362c64d70 100644 (file)
@@ -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);
   };
 
index 2d63fb98db48a89dcb470a5721fc6d0f18f7e22a..10139688a1dcf92b40f860443908da656d09c1da 100644 (file)
@@ -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());
index 082c3f26335acf9c118b9adf462e9e9fb1e84166..cb8d8b700bd4b0e4b1ec67fc997e892622785b31 100644 (file)
@@ -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());
index bb09e0978a46099c4e17ae345bc6362e4af2bc2a..8fc2d3ee817a1da7575ecb3b03c03f8b2dd8cfb7 100644 (file)
@@ -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)
index 26a880220a329ea65a066caa1a5b4c4f2397be44..abc6b54b010cdd789e7a29c699f20b3f39d0bac9 100644 (file)
@@ -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;
index f7d43e65d55d1f14dcb27602f0e9e00ff24d5414..ef4310a8c764b8221ca0d96ca94fd5a6e708e4c3 100644 (file)
@@ -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
index 830f676dc2222b71e9a7f59fd5be6dfd1b2e4c77..877cc1e07c71cd516a4c59395bc806c1426a618a 100644 (file)
@@ -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;