1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME MPIContainer : implemenation of container based on MPI libraries
23 // File : MPIContainer_i.hxx
26 #ifndef _SALOME_PCONTAINER_
27 #define _SALOME_PCONTAINER_
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(SALOME_MPIContainer)
31 #include "SALOME_Container_i.hxx"
32 #include "MPIObject_i.hxx"
34 class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
35 public Engines_Container_i,
41 Engines_MPIContainer_i( int nbproc, int numproc,
43 PortableServer::POA_ptr poa,
45 int argc, char *argv[]);
46 Engines_MPIContainer_i(int nbproc, int numproc);
48 ~Engines_MPIContainer_i();
50 // shutdown corba server
53 // Load a component library
54 // synchronous version for process 0
55 bool load_component_Library(const char* componentName);
56 // asynchronous version for other process
57 void Asload_component_Library(const char* componentName);
59 // Create an instance of component
60 // synchronous version for process 0
61 Engines::Component_ptr
62 create_component_instance( const char* componentName,
63 CORBA::Long studyId); // 0 for multiStudy
64 // asynchronous version for other process
65 void Ascreate_component_instance( const char* componentName,
66 CORBA::Long studyId); // 0 for multiStudy
68 // Load a component in current MPI container
69 // synchronous version for process 0
70 Engines::Component_ptr load_impl(const char* nameToRegister,
71 const char* componentName);
72 // asynchronous version for other process
73 void Asload_impl(const char* nameToRegister, const char* componentName);
75 // Unload a component from current MPI container
76 // synchronous version for process 0
77 void remove_impl(Engines::Component_ptr component_i);
78 // asynchronous version for other process
79 void Asremove_impl(Engines::Component_ptr component_i);
81 // synchronous version for process 0
82 void finalize_removal();
83 // asynchronous version for other process
84 void Asfinalize_removal();
87 // local version to not duplicate code
88 // called by synchronous and asynchronous version
89 bool Lload_component_Library(const char* componentName);
90 Engines::Component_ptr
91 Lcreate_component_instance( const char* componentName,
92 CORBA::Long studyId); // 0 for multiStudy
93 Engines::Component_ptr Lload_impl(const char* nameToRegister,
94 const char* componentName);
95 void Lremove_impl(Engines::Component_ptr component_i);
96 void Lfinalize_removal();
98 Engines::Component_ptr
99 createMPIInstance(std::string genericRegisterName,