]> SALOME platform Git repositories - modules/kernel.git/blob - idl/SALOME_ContainerManager.idl
Salome HOME
merge from branch BR_V511_PR 15 12 2009
[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 resources.
35 typedef sequence<string> ResourceList;
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 resource
44 struct ResourceParameters
45 {
46   //! resource name - manual selection
47   string name;
48   //! host name
49   string hostname;
50   //! if given required operating system 
51   string OS;
52   //! if given list of components that could be loaded on a container
53   //! Optional if no resource are found with this constraint
54   CompoList componentList;
55
56   // Permits to order resources
57   //! required number of proc
58   long nb_proc;
59   //! required memory size
60   long mem_mb;
61   //! required frequency
62   long cpu_clock;
63   //! required number of node
64   long nb_node;
65   //! required number of proc per node
66   long nb_proc_per_node;
67
68   // Permits to configure SALOME resource management
69   //! resource management policy : first, cycl, altcycl or best (can be extended)
70   string policy;
71   //! restricted list of resources to search in
72   ResourceList resList;
73 };
74
75 //! Type to describe required properties of a container
76 struct ContainerParameters
77 {
78   //! container name if given else automatic
79   string container_name;
80
81   //! creation mode for GiveContainer if given else automatic 
82   /*!start creates a new container
83    * get  try to find an existing container
84    * getorstart   use an existing container if it exists or creates a new one
85    */
86   string mode;
87
88   //! container working directory if given else automatic
89   string workingdir;
90
91   // Parallel part
92   //! Number of proc of a parallel container
93   long nb_proc;
94   //! if true start a MPI container
95   boolean isMPI;
96   //! PaCO specific informations
97   string parallelLib;
98
99   //! Parameters to choose a resource
100   ResourceParameters resource_params;
101 };
102
103 //!  Type to describe a resource
104 struct ResourceDefinition
105 {
106   //! name 
107   string name;
108   //! hostname 
109   string hostname;
110   //! protocol to connect to the resource
111   //! protocol used to start a remote container (ssh or rsh)
112   string protocol;
113   //! login name to use to start a remote container
114   string username;
115   //! salome application to use to start a remote container
116   string applipath;
117   //! list of available components 
118   CompoList componentList;
119
120   //! operating system 
121   string OS;
122   //! memory size per node
123   long mem_mb;
124   //! frequency
125   long cpu_clock;
126   //! number of node
127   long nb_node;
128   //! number of proc per node
129   long nb_proc_per_node;
130   //! batch system
131   string batch;
132   //! MPI implementation
133   string mpiImpl;
134   //! if the resource is a cluster:
135   //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
136   string iprotocol;
137 };
138
139 //! exception thrown if a computer is not found in the catalog
140 exception NotFound {};
141
142 struct JobParameters
143 {
144   //! Job Type - Could be equal to "command" or "yacs_file" or "python_salome"
145   string job_type;
146
147   // Common values
148   string job_file;
149   string env_file; 
150   FilesList in_files;
151   FilesList out_files;
152   string work_directory;
153   string local_directory;
154   string result_directory;
155
156   /*! Time for the batch (has to be like this : hh:mm) - Could be empty, in
157        this case, default value of the selected resource will be used.
158   */
159   string maximum_duration; 
160
161   // Memory is expressed in megabytes -> mem_mb
162   // Number of Processors -> nb_proc
163   ResourceParameters resource_required;
164
165   /*!
166     Name of the batch queue choosed - optional
167   */
168   string queue;
169 };
170
171 /*! \brief Interface of the %salomelauncher
172     This interface is used for interaction with the unique instance
173     of SalomeLauncher
174 */
175 interface SalomeLauncher
176 {
177   // Main methods
178   long   createJob    (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
179   void   launchJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
180   string getJobState  (in long job_id)                           raises (SALOME::SALOME_Exception);
181   void   getJobResults(in long job_id, in string directory)      raises (SALOME::SALOME_Exception);
182   void   removeJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
183
184   // Useful methods
185   long    createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
186   boolean testBatch        (in ResourceParameters params)                raises (SALOME::SALOME_Exception);
187
188   // SALOME kernel service methods
189   void Shutdown();
190   long getPID();
191 };
192   
193 /*! \brief Interface of the %containerManager
194     This interface is used for interaction with the unique instance
195     of ContainerManager
196 */
197 interface ContainerManager
198 {
199   //! GiveContainer - use mode parameter of ContainerParameters to configure
200   //! how this method works
201   //! Currently: get, start, getorstart, findorstart, find
202   Container GiveContainer(in ContainerParameters params);
203
204   //!  Shutdown all containers that have been launched by the container manager
205   void ShutdownContainers();
206 } ;
207   
208 /*! \brief Interface of the %resourcesManager
209     This interface is used for interaction with the unique instance
210     of ResourcesManager
211 */
212 interface ResourcesManager
213 {
214   //!  Find first available resource in a resources list
215   string FindFirst(in ResourceList possibleResources);
216
217   //!  Find best available computer according to policy in a computers list
218   string Find(in string policy, in ResourceList possibleResources);
219
220   //!  Get a list of resources that are best suited to launch a container given constraints 
221   /*! 
222        The constraints are resource constraints (params) and components constraints (componentList)
223   */
224   ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
225
226   //!  Get definition of a resource
227   ResourceDefinition GetResourceDefinition(in string name);
228 };
229
230
231 // For compatibility - will be erased on SALOME 6
232 typedef sequence<string> MachineList;
233 //!  Type to describe required properties of a container.
234 struct MachineParameters
235 {
236   //! container name if given else automatic
237   string container_name;
238   //! host name if given else automatic
239   string hostname;
240   //! if given list of components that could be loaded on the container
241   CompoList componentList;
242   //! if given restricted list of machines to search in
243   MachineList computerList;
244   //! required operating system 
245   string OS;
246   //! required memory size
247   long mem_mb;
248   //! required frequency
249   long cpu_clock;
250   //! required number of proc per node
251   long nb_proc_per_node;
252   //! required number of node
253   long nb_node;
254   //! if true start a MPI container
255   boolean isMPI;
256   //! container working directory 
257   string workingdir;
258   //! creation mode for GiveContainer. 
259   /*!start creates a new container
260    * get  try to find an existing container
261    * getorstart   use an existing container if it exists or creates a new one
262    */
263   string mode;
264   //! resource management policy : first, cycl, altcycl or best (can be extended)
265   string policy;
266
267   //! PaCO specific informations
268   string parallelLib;
269   long nb_component_nodes;
270 };
271 };
272   
273 #endif