]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Valgrind issue for Parallel Containers
authorribes <ribes>
Tue, 17 Mar 2009 15:42:34 +0000 (15:42 +0000)
committerribes <ribes>
Tue, 17 Mar 2009 15:42:34 +0000 (15:42 +0000)
src/Container/SALOME_ContainerManager.cxx
src/NamingService/SALOME_NamingService.cxx
src/NamingService/SALOME_NamingService.hxx
src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx
src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx
src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx
src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx
src/ParallelContainer/SALOME_ParallelContainer_i.cxx
src/ParallelContainer/SALOME_ParallelContainer_i.hxx

index e56d42d900b1e536be2468bfff68d3a23f68b954..fdf1465b16bf8c245cf5c77c01235a7466a1c736 100644 (file)
@@ -500,6 +500,8 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const,
            MESSAGE("[FindOrStartParallelContainer] Deploying node : " << name);
            node->deploy();
          }
+
+         MESSAGE ("[FindOrStartParallelContainer] Starting parallel object");
          proxy->start();
        }
        catch(CORBA::SystemException& e)
index 33e94851b703501e0dbee396aa71714d85adc8c4..9b1d479f5e7b4046252d1ad30621dab61940b481 100644 (file)
@@ -67,7 +67,7 @@ SALOME_NamingService::SALOME_NamingService()
 SALOME_NamingService::SALOME_NamingService(CORBA::ORB_ptr orb)
 {
   MESSAGE("SALOME_NamingService creation");
-  _orb = orb ;
+  _orb = CORBA::ORB::_duplicate(orb);
   _initialize_root_context();
 }
 
@@ -99,7 +99,7 @@ void SALOME_NamingService::init_orb(CORBA::ORB_ptr orb)
   MESSAGE("SALOME_NamingService initialisation");
 
   Utils_Locker lock (&_myMutex);
-  _orb = orb;
+  _orb = CORBA::ORB::_duplicate(orb);
 
   _initialize_root_context();
 }
index daa5ca63691566a4e00b540e507ec2dc1c02a759..6e54c5f7dc9db0fc91763649c69a33f4c569fb82 100644 (file)
@@ -94,7 +94,7 @@ public:
 
 protected:
   Utils_Mutex _myMutex;
-  CORBA::ORB_ptr _orb;
+  CORBA::ORB_var _orb;
   CosNaming::NamingContext_var _root_context, _current_context;
 
   void _initialize_root_context();
index 55dd65ad4cdda6826cd6ad60423ae1a413ec5d1c..30bacde221fcaa684eca18c42575bf9309e2de7b 100644 (file)
@@ -148,7 +148,7 @@ int main(int argc, char* argv[])
     system(aCommand);
 #endif
 
-    SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb));
+    SALOME_NamingService * ns = new SALOME_NamingService(orb);
     // Get the proxy
     string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), 
                                                       hostname.c_str());
@@ -161,9 +161,8 @@ int main(int argc, char* argv[])
                                                                              proxy_ior,
                                                                              myid,
                                                                              root_poa,
-                                                                             (char*) node_name.c_str(),
-                                                                             containerName,
-                                                                             argc, argv);
+                                                                             node_name,
+                                                                             containerName);
     // PaCO++ init
     paco_fabrique_manager * pfm = paco_getFabriqueManager();
     pfm->register_com("dummy", new paco_dummy_fabrique());
@@ -188,6 +187,8 @@ int main(int argc, char* argv[])
     PyGILState_Ensure();
     //Delete python container that destroy orb from python (pyCont._orb.destroy())
     Py_Finalize();
+    delete proxy_ior;
+    delete ns;
   }
   catch (PaCO::PACO_Exception& e)
   {
index 72354a0ac19df06fdc5a8266aad568315b8f1450..082c3f26335acf9c118b9adf462e9e9fb1e84166 100644 (file)
@@ -198,9 +198,8 @@ int main(int argc, char* argv[])
                                       proxy_ior,
                                       myid,
                                       root_poa,
-                                      (char*) node_name.c_str(),
-                                      containerName,
-                                      argc, argv);
+                                      node_name,
+                                      containerName);
     // PaCO++ init
     paco_fabrique_manager * pfm = paco_getFabriqueManager();
     pfm->register_com("mpi", new paco_mpi_fabrique());
index 4ff59ce232e0960c16f1cc46c4b38a908679c1e0..24fd47a00e53359821b3bbb6b2ac4b001c2835a1 100644 (file)
@@ -94,7 +94,7 @@ int main(int argc, char* argv[])
     system(aCommand);
 #endif
 
-    SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb));
+    SALOME_NamingService * ns = new SALOME_NamingService(orb);
 //    Engines::Container_proxy_impl * proxy = 
 //      new Engines::Container_proxy_impl(orb,
 //                                     new paco_omni_fabrique());
@@ -128,6 +128,7 @@ int main(int argc, char* argv[])
     ns->Register(pCont, _containerName.c_str());
     pman->activate();
     orb->run();
+    delete ns;
   }
   catch (PaCO::PACO_Exception& e)
   {
index fe79314993fc40bf2d3108c39af556720f8d121b..dff3bac81b6d25f27cd224b350527973bd2f966b 100644 (file)
@@ -47,7 +47,12 @@ Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb,
   _NS->init_orb(_orb);
 }
 
-Container_proxy_impl_final:: ~Container_proxy_impl_final() {}
+Container_proxy_impl_final:: ~Container_proxy_impl_final() {
+  if (_id)
+    delete _id;
+  if (_NS)
+    delete _NS;
+}
 
 void
 Container_proxy_impl_final::Shutdown()
index d2dd64ebd24857f201b07054f5ee317b48e4b9b4..8c4c5dbc996a413b658f4f8db39cc64a7ce592e5 100644 (file)
@@ -76,11 +76,9 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb,
                                                            char * ior, 
                                                            int rank,
                                                            PortableServer::POA_ptr poa,
-                                                           char *containerName,
+                                                           std::string containerName,
                                                            std::string proxy_containerName,
-                                                           int argc , char* argv[],
-                                                           bool isServantAloneInProcess
-                                                          ) :
+                                                           bool isServantAloneInProcess) :
   InterfaceParallel_impl(orb,ior,rank), 
   Engines::PACO_Container_serv(orb,ior,rank),
   Engines::PACO_Container_base_serv(orb,ior,rank),
@@ -90,8 +88,6 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb,
 {
   // Members init
   _pid = getpid();
-  _argc = argc ;
-  _argv = argv ;
   _hostname = Kernel_Utils::GetHostname();
   _orb = CORBA::ORB::_duplicate(orb);
   _poa = PortableServer::POA::_duplicate(poa);
@@ -104,9 +100,8 @@ Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb,
   // Adding this servant to SALOME
   _NS = new SALOME_NamingService();
   _NS->init_orb(_orb);
-  _containerName = _NS->BuildContainerNameForNS(containerName, _hostname.c_str());
+  _containerName = _NS->BuildContainerNameForNS(containerName.c_str(), _hostname.c_str());
   _proxy_containerName = proxy_containerName;
-  //_NS->Register(container_node, _containerName.c_str());
 
   // Init Python container part
   CORBA::String_var sior =  _orb->object_to_string(container_node);
index 251941f92b5d8c35707ad16d9b9c1065b5bee29a..7bf0b91824f2733d91fa9885fb0fd4bf15088e8b 100644 (file)
@@ -60,12 +60,14 @@ class CONTAINER_EXPORT Engines_Parallel_Container_i:
   virtual public PortableServer::RefCountServantBase
 {
 public:
-  Engines_Parallel_Container_i(CORBA::ORB_ptr orb, char * ior, int rank,
-                     PortableServer::POA_ptr poa,
-                     char * containerName ,
-                     std::string proxy_containerName,
-                      int argc, char* argv[],
-                     bool isServantAloneInProcess = true);
+  Engines_Parallel_Container_i(CORBA::ORB_ptr orb, 
+                              char * ior, 
+                              int rank,
+                              PortableServer::POA_ptr poa,
+                              std::string containerName ,
+                              std::string proxy_containerName,
+                              bool isServantAloneInProcess = true);
+
   virtual ~Engines_Parallel_Container_i();
 
   // --- CORBA methods
@@ -126,10 +128,6 @@ public:
   static void decInstanceCnt(std::string genericRegisterName);
 
   // --- needed for parallel components, Numerical Platon
-
-  int getArgc() { return _argc; }
-  char **getArgv() { return _argv; }
-
   void set_id(PortableServer::ObjectId * id) { _id = id;}
 
   Engines::fileRef_ptr createFileRef(const char* origFileName);
@@ -149,8 +147,6 @@ protected:
   PortableServer::POA_var _poa;
   PortableServer::ObjectId * _id;
   int _numInstance;
-  int    _argc;
-  char** _argv;
   CORBA::Long   _pid;
   bool   _isServantAloneInProcess;
   Engines::fileTransfer_var _fileTransfer;