1 // Copyright (C) 2007-2010 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
23 // SALOME MPIContainer : implemenation of container based on MPI libraries
24 // File : MPIContainer_i.hxx
27 #ifndef _SALOME_PCONTAINER_
28 #define _SALOME_PCONTAINER_
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(SALOME_MPIContainer)
32 #include "SALOME_Container_i.hxx"
33 #include "MPIObject_i.hxx"
35 void * th_loadcomponentlibrary(void *st);
36 void * th_createcomponentinstance(void *st);
37 void * th_loadimpl(void *st);
38 void * th_removeimpl(void *st);
39 void * th_finalizeremoval(void *st);
43 Engines::IORTab* tior;
44 std::string compoName;
45 std::string nameToRegister;
47 Engines::Component_ptr cptr;
50 class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
51 public Engines_Container_i,
57 Engines_MPIContainer_i( int nbproc, int numproc,
59 PortableServer::POA_ptr poa,
61 int argc, char *argv[]);
62 Engines_MPIContainer_i(int nbproc, int numproc);
64 ~Engines_MPIContainer_i();
66 // shutdown corba server
69 // Load a component library
70 // synchronous version for process 0
71 bool load_component_Library(const char* componentName, CORBA::String_out reason);
73 // Create an instance of component
74 // synchronous version for process 0
75 virtual Engines::Component_ptr
76 create_component_instance_env( const char* componentName,
77 CORBA::Long studyId, // 0 for multiStudy
78 const Engines::FieldsDict& env,
79 CORBA::String_out reason);
81 // Load a component in current MPI container
82 // synchronous version for process 0
83 Engines::Component_ptr load_impl(const char* nameToRegister,
84 const char* componentName);
86 // Unload a component from current MPI container
87 // synchronous version for process 0
88 void remove_impl(Engines::Component_ptr component_i);
90 // synchronous version for process 0
91 void finalize_removal();
94 bool Lload_component_Library(const char* componentName);
95 Engines::Component_ptr
96 Lcreate_component_instance( const char* componentName,
97 CORBA::Long studyId); // 0 for multiStudy
98 Engines::Component_ptr Lload_impl(const char* nameToRegister,
99 const char* componentName);
101 Engines::Component_ptr
102 createMPIInstance(std::string genericRegisterName,