From 9912b0fc1e90d1de2d01a264b9ae69aac356277a Mon Sep 17 00:00:00 2001 From: ribes Date: Mon, 21 Jan 2008 09:18:50 +0000 Subject: [PATCH] - Shutdown Parallel proxy --- src/ParallelContainer/Makefile.am | 2 + .../SALOME_ParallelContainerProxyDummy.cxx | 14 +++--- .../SALOME_ParallelContainerProxyMpi.cxx | 12 +++-- .../SALOME_ParallelContainerProxy_i.cxx | 43 ++++++++++++++++++ .../SALOME_ParallelContainerProxy_i.hxx | 44 +++++++++++++++++++ 5 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx create mode 100644 src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx diff --git a/src/ParallelContainer/Makefile.am b/src/ParallelContainer/Makefile.am index 1734d4f10..18ff73d7f 100644 --- a/src/ParallelContainer/Makefile.am +++ b/src/ParallelContainer/Makefile.am @@ -34,6 +34,7 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am # header files salomeinclude_HEADERS = SALOME_ParallelComponent_i.hxx \ SALOME_ParallelContainer_i.hxx \ + SALOME_ParallelContainerProxy_i.hxx \ Parallel_Salome_file_i.hxx # @@ -75,6 +76,7 @@ lib_LTLIBRARIES = libSalomeParallelContainer.la libSalomeParallelContainer_la_SOURCES = SALOME_ParallelComponent_i.cxx \ SALOME_ParallelContainer_i.cxx \ + SALOME_ParallelContainerProxy_i.cxx \ $(top_srcdir)/src/Container/Salome_file_i.cxx \ Parallel_Salome_file_i.cxx diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx index 697ddc96d..e8df8733b 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx @@ -36,7 +36,8 @@ #endif // PaCO++ include -#include "SALOME_ComponentPaCO_Engines_Container_server.h" +//#include "SALOME_ComponentPaCO_Engines_Container_server.h" +#include "SALOME_ParallelContainerProxy_i.hxx" #include #include @@ -86,15 +87,18 @@ int main(int argc, char* argv[]) #ifndef WNT // add this container to the kill list char aCommand[100]; - sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerProxy", getpid()); + sprintf(aCommand, "addToKillList.py %d SALOME_ParallelContainerProxyDummy", getpid()); system(aCommand); #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()); +// 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()); // PaCO++ code paco_fabrique_manager* pfm = paco_getFabriqueManager(); pfm->register_com("dummy", new paco_dummy_fabrique()); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx index bdc99bbb7..f14b09e18 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx @@ -35,7 +35,8 @@ #include #endif -#include "SALOME_ComponentPaCO_Engines_Container_server.h" +//#include "SALOME_ComponentPaCO_Engines_Container_server.h" +#include "SALOME_ParallelContainerProxy_i.hxx" #include #include @@ -95,9 +96,12 @@ 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()); +// 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()); // PaCO++ code paco_fabrique_manager* pfm = paco_getFabriqueManager(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx new file mode 100644 index 000000000..c88588c00 --- /dev/null +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx @@ -0,0 +1,43 @@ +// SALOME_ParallelContainerProxy : implementation of container and engine for Parallel Kernel +// +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// File : SALOME_ParallelContainerProxy_i.cxx +// Author : André RIBES, EDF + +#include "SALOME_ParallelContainerProxy_i.hxx" + +Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb, + paco_fabrique_thread * fab_thread, + bool is_a_return_proxy) : + Engines::Container_proxy_impl(orb, fab_thread, is_a_return_proxy), + InterfaceManager_impl(orb, fab_thread, is_a_return_proxy) +{} + +Container_proxy_impl_final:: ~Container_proxy_impl_final() {} + +void +Container_proxy_impl_final::Shutdown() +{ + INFOS("Shutdown Parallel Proxy"); + if(!CORBA::is_nil(_orb)) + _orb->shutdown(0); +} + diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx new file mode 100644 index 000000000..77d59144f --- /dev/null +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx @@ -0,0 +1,44 @@ +// SALOME_ParallelContainerProxy : implementation of container and engine for Parallel Kernel +// +// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// File : SALOME_ParallelContainerProxy_i.hxx +// Author : André RIBES, EDF + +#ifndef _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_ +#define _SALOME_PARALLEL_CONTAINER_PROXY_I_HXX_ + +#include "utilities.h" +#include "SALOME_ComponentPaCO_Engines_Container_server.h" + +class Container_proxy_impl_final : + public Engines::Container_proxy_impl +{ + public: + Container_proxy_impl_final(CORBA::ORB_ptr orb, + paco_fabrique_thread * fab_thread, + bool is_a_return_proxy = false); + + virtual ~Container_proxy_impl_final(); + + virtual void Shutdown(); +}; + +#endif -- 2.39.2