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 #ifndef _SALOME_CONTAINERMANAGER_IDL_
24 #define _SALOME_CONTAINERMANAGER_IDL_
26 #include "SALOME_Exception.idl"
27 #include "SALOME_Component.idl"
29 /*! \file SALOME_ContainerManager.idl \brief interfaces for %SALOME launcher and container manager
35 //! Type to transmit list of resources.
36 typedef sequence<string> ResourceList;
38 typedef sequence<string> CompoList;
40 typedef sequence<string> FilesList;
42 typedef sequence<string> ModulesList;
44 //! A generic parameter
50 //! Generic parameter list
51 typedef sequence<Engines::Parameter> ParameterList;
53 //! Type to describe required properties of a resource
54 struct ResourceParameters
56 //! resource name - manual selection
60 //! if given required operating system
62 //! if given list of components that could be loaded on a container
63 //! Optional if no resource are found with this constraint
64 CompoList componentList;
66 // Permits to order resources
67 //! required number of proc
69 //! required memory size
71 //! required frequency
73 //! required number of node
75 //! required number of proc per node
76 long nb_proc_per_node;
78 // Permits to configure SALOME resource management
79 //! resource management policy : first, cycl, altcycl or best (can be extended)
81 //! restricted list of resources to search in
85 //! Type to describe required properties of a container
86 struct ContainerParameters
88 //! container name if given else automatic
89 string container_name;
91 //! creation mode for GiveContainer if given else automatic
92 /*!start creates a new container
93 * get try to find an existing container
94 * getorstart use an existing container if it exists or creates a new one
98 //! container working directory if given else automatic
102 //! Number of proc of a parallel container
104 //! if true start a MPI container
106 //! PaCO specific informations
109 //! Parameters to choose a resource
110 ResourceParameters resource_params;
113 //! Type to describe a resource
114 struct ResourceDefinition
120 //! protocol to connect to the resource
121 //! protocol used to start a remote container (ssh or rsh)
123 //! login name to use to start a remote container
125 //! salome application to use to start a remote container
127 //! list of available components
128 CompoList componentList;
129 //! Type of resource: interactive or batch
134 //! memory size per node
140 //! number of proc per node
141 long nb_proc_per_node;
144 //! MPI implementation
146 //! if the resource is a cluster:
147 //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
151 //! exception thrown if a computer is not found in the catalog
152 exception NotFound {};
156 //! Job Type - Could be equal to "command" or "yacs_file" or "python_salome"
164 string work_directory;
165 string local_directory;
166 string result_directory;
168 /*! Time for the batch (has to be like this : hh:mm) - Could be empty, in
169 this case, default value of the selected resource will be used.
171 string maximum_duration;
173 // Memory is expressed in megabytes -> mem_mb
174 // Number of Processors -> nb_proc
175 ResourceParameters resource_required;
178 Name of the batch queue choosed - optional
183 Specific parameters for each type of job - optional
185 Engines::ParameterList specific_parameters;
188 /*! \brief Interface of the %salomelauncher
189 This interface is used for interaction with the unique instance
192 interface SalomeLauncher
195 long createJob (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
196 void launchJob (in long job_id) raises (SALOME::SALOME_Exception);
197 string getJobState (in long job_id) raises (SALOME::SALOME_Exception);
198 void getJobResults(in long job_id, in string directory) raises (SALOME::SALOME_Exception);
199 void removeJob (in long job_id) raises (SALOME::SALOME_Exception);
202 long createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
203 boolean testBatch (in ResourceParameters params) raises (SALOME::SALOME_Exception);
205 // SALOME kernel service methods
210 /*! \brief Interface of the %containerManager
211 This interface is used for interaction with the unique instance
214 interface ContainerManager
216 //! GiveContainer - use mode parameter of ContainerParameters to configure
217 //! how this method works
218 //! Currently: get, start, getorstart, findorstart, find
219 Container GiveContainer(in ContainerParameters params);
221 //! Shutdown all containers that have been launched by the container manager
222 void ShutdownContainers();
225 /*! \brief Interface of the %resourcesManager
226 This interface is used for interaction with the unique instance
229 interface ResourcesManager
231 //! Find first available resource in a resources list
232 string FindFirst(in ResourceList possibleResources);
234 //! Find best available computer according to policy in a computers list
235 string Find(in string policy, in ResourceList possibleResources);
237 //! Get a list of resources that are best suited to launch a container given constraints
239 The constraints are resource constraints (params) and components constraints (componentList)
241 ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
243 //! Get definition of a resource
244 ResourceDefinition GetResourceDefinition(in string name);
246 //! Add a new resource to the resource_manager
248 write -> true, resource manager will add it into a xml_file
249 xml_file -> could be empty, in this case if write is true, resource manager will write
250 the resource in its first ResourceCatalog file
252 void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file)
253 raises (SALOME::SALOME_Exception);
255 //! Remove a new resource to the resource_manager
257 write -> true, resource manager will write a new xml_file
258 xml_file -> could be empty, in this case if write is true, resource manager will write
259 the resource in its first ResourceCatalog file
261 void RemoveResource(in string resource_name, in boolean write, in string xml_file)
262 raises (SALOME::SALOME_Exception);
266 // For compatibility - will be erased on SALOME 6
267 typedef sequence<string> MachineList;
268 //! Type to describe required properties of a container.
269 struct MachineParameters
271 //! container name if given else automatic
272 string container_name;
273 //! host name if given else automatic
275 //! if given list of components that could be loaded on the container
276 CompoList componentList;
277 //! if given restricted list of machines to search in
278 MachineList computerList;
279 //! required operating system
281 //! required memory size
283 //! required frequency
285 //! required number of proc per node
286 long nb_proc_per_node;
287 //! required number of node
289 //! if true start a MPI container
291 //! container working directory
293 //! creation mode for GiveContainer.
294 /*!start creates a new container
295 * get try to find an existing container
296 * getorstart use an existing container if it exists or creates a new one
299 //! resource management policy : first, cycl, altcycl or best (can be extended)
302 //! PaCO specific informations
304 long nb_component_nodes;