]> SALOME platform Git repositories - modules/kernel.git/blob - idl/SALOME_ContainerManager.idl
Salome HOME
CCAR:
[modules/kernel.git] / idl / SALOME_ContainerManager.idl
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef _SALOME_CONTAINERMANAGER_IDL_
23 #define _SALOME_CONTAINERMANAGER_IDL_
24
25 #include "SALOME_Exception.idl"
26 #include "SALOME_Component.idl"
27
28 /*! \file SALOME_ContainerManager.idl \brief interfaces for %SALOME launcher and container manager
29 */
30
31 module Engines
32 {
33
34 //!  Type to transmit list of machines.
35   typedef sequence<string> MachineList;
36 //! components list
37   typedef sequence<string> CompoList;
38 //! files list
39   typedef sequence<string> FilesList;
40 //! modules list
41   typedef sequence<string> ModulesList;
42
43 //!  Type to describe required properties of a container.
44 struct MachineParameters
45 {
46   //! container name if given else automatic
47   string container_name;
48   //! host name if given else automatic
49   string hostname;
50   //! if given alias name to use ??
51   string alias;
52   //! protocol to use to start a remote container (ssh or rsh)
53   string protocol;
54   //! login name to use to start a remote container
55   string username;
56   //! salome application to use to start a remote container
57   string applipath;
58   //! if given list of components that could be loaded on the container
59   CompoList componentList;
60   //! if given restricted list of machines to search in
61   MachineList computerList;
62   //! required operating system 
63   string OS;
64   //! required memory size
65   long mem_mb;
66   //! required frequency
67   long cpu_clock;
68   //! required number of proc per node
69   long nb_proc_per_node;
70   //! required number of node
71   long nb_node;
72   //! if true start a MPI container ??
73   boolean isMPI;
74   //! required MPI implementation to use
75   string mpiImpl;
76   //! required batch system to use
77   string batch;
78   //! container working directory 
79   string workingdir;
80   //! creation mode for GiveContainer. 
81   /*!start creates a new container
82    * get  try to find an existing container
83    * getorstart   use an existing container if it exists or creates a new one
84    */
85   string mode;
86   //! resource management policy : first, cycl, altcycl or best (can be extended)
87   string policy;
88
89   //! PaCO specific informations
90   string parallelLib;
91   long nb_component_nodes;
92 };
93
94 //!  Type to describe properties of a resource.
95 struct MachineDefinition
96 {
97   //! host name 
98   string hostname;
99   string alias;
100   //! protocol to use to start a remote container (ssh or rsh)
101   string protocol;
102   //! login name to use to start a remote container
103   string username;
104   //! salome application to use to start a remote container
105   string applipath;
106   //! list of available components 
107   CompoList componentList;
108   //! operating system 
109   string OS;
110   //! memory size
111   long mem_mb;
112   //! frequency
113   long cpu_clock;
114   //! number of proc per node
115   long nb_proc_per_node;
116   //! number of node
117   long nb_node;
118   //! MPI implementation
119   string mpiImpl;
120   //! batch system
121   string batch;
122   long nb_component_nodes;
123 };
124 //! exception thrown if a computer is not found in the catalog
125   exception NotFound {};
126
127 //! enumeration to set a resource management policy
128   enum policy {
129   //! first machine in the list of admissible computers
130   P_FIRST,
131   //! next machine in the list of admissible computers
132   P_CYCL,
133   //! best machine in the list of admissible computers
134   P_BEST};
135 //! resource management policy
136   typedef policy ResPolicy;
137
138 //!  Structure used for Salome Batch Job parameters
139 struct BatchParameters
140 {
141   //! Where batch command will be launched and log files will be created
142   string batch_directory; 
143   //! Time for the batch (has to be like this : hh:mm)
144   string expected_during_time; 
145   //! Minimum of memory needed (has to be like : 32gb or 512mb)
146   string mem; 
147   //! Number of processors requested
148   long nb_proc; 
149 };
150
151 /*! \brief Interface of the %salomelauncher
152     This interface is used for interaction with the unique instance
153     of SalomeLauncher
154 */
155   interface SalomeLauncher
156   {
157     long submitJob( in string xmlExecuteFile,
158                     in string clusterName ) raises (SALOME::SALOME_Exception);
159     long submitSalomeJob( in string fileToExecute,
160                           in FilesList filesToExport,
161                           in FilesList filesToImport,
162                           in BatchParameters batch_params,
163                           in MachineParameters params ) raises (SALOME::SALOME_Exception);
164     string queryJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
165     void deleteJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
166     void getResultsJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
167
168     boolean testBatch(in MachineParameters params) raises (SALOME::SALOME_Exception);
169
170     void Shutdown();
171
172     long getPID();
173
174   } ;
175   
176 /*! \brief Interface of the %containerManager
177     This interface is used for interaction with the unique instance
178     of ContainerManager
179 */
180   interface ContainerManager
181   {
182     //!  Find an existing container satisfying the constraints given by input parameters or start a new one.
183     Container FindOrStartContainer( in MachineParameters params,
184                                     in MachineList possibleComputers);
185
186     //!  This operation launches a PaCO++ container.
187     /*!  
188
189       \param Description of the container resquested.
190       \param List of computers ressources.
191
192       \return Container's CORBA reference.
193     */
194     Container FindOrStartParallelContainer( in MachineParameters params,
195                                             in MachineList possibleComputers);
196
197     //!  Start a new container satisfying the constraints given by input parameters.
198     Container StartContainer( in MachineParameters params,
199                               in ResPolicy policy,
200                               in CompoList componentList );
201
202     //!  Same as StartContainer except that in batch all containers have already been launched
203     /*! 
204
205          We are in batch if environment variable SALOME_BATCH is 1.
206          In this case, containers have been launched at the beginning of the Salome session and 
207          the container manager picks one in the pool of existing containers.
208     */
209     Container GiveContainer( in MachineParameters params,
210                              in ResPolicy policy,
211                              in CompoList componentList );
212
213     //!  Shutdown all containers that have been launched by the container manager
214     void ShutdownContainers();
215
216   } ;
217   
218 /*! \brief Interface of the %resourcesManager
219     This interface is used for interaction with the unique instance
220     of ResourcesManager
221 */
222   interface ResourcesManager
223   {
224     //!  Find first available computer in a computers list
225     string FindFirst(in MachineList possibleComputers);
226
227     //!  Find best available computer according to policy in a computers list
228     string Find(in string policy, in MachineList possibleComputers);
229
230     //!  Get a list of computers that are best suited to launch a container given constraints 
231     /*! 
232          The constraints are resource constraints (params) and components constraints (componentList)
233     */
234     MachineList GetFittingResources( in MachineParameters params,
235                                      in CompoList componentList )
236       raises (SALOME::SALOME_Exception);
237
238     //!  Get the current machine parameters of a computer
239     MachineDefinition GetMachineParameters( in string hostname );
240
241   } ;
242 };
243   
244 #endif