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 #ifndef _SALOME_CONTAINERMANAGER_IDL_
23 #define _SALOME_CONTAINERMANAGER_IDL_
25 #include "SALOME_Exception.idl"
26 #include "SALOME_Component.idl"
28 /*! \file SALOME_ContainerManager.idl \brief interfaces for %SALOME launcher and container manager
34 //! Type to transmit list of resources.
35 typedef sequence<string> ResourceList;
37 typedef sequence<string> CompoList;
39 typedef sequence<string> FilesList;
41 typedef sequence<string> ModulesList;
43 //! A generic parameter
49 //! Generic parameter list
50 typedef sequence<Engines::Parameter> ParameterList;
52 //! Type to describe required properties of a resource
53 struct ResourceParameters
55 //! resource name - manual selection
59 //! if given required operating system
61 //! if given list of components that could be loaded on a container
62 //! Optional if no resource are found with this constraint
63 CompoList componentList;
65 // Permits to order resources
66 //! required number of proc
68 //! required memory size
70 //! required frequency
72 //! required number of node
74 //! required number of proc per node
75 long nb_proc_per_node;
77 // Permits to configure SALOME resource management
78 //! resource management policy : first, cycl, altcycl or best (can be extended)
80 //! restricted list of resources to search in
84 //! Type to describe required properties of a container
85 struct ContainerParameters
87 //! container name if given else automatic
88 string container_name;
90 //! creation mode for GiveContainer if given else automatic
91 /*!start creates a new container
92 * get try to find an existing container
93 * getorstart use an existing container if it exists or creates a new one
97 //! container working directory if given else automatic
101 //! Number of proc of a parallel container
103 //! if true start a MPI container
105 //! PaCO specific informations
108 //! Parameters to choose a resource
109 ResourceParameters resource_params;
112 //! Type to describe a resource
113 struct ResourceDefinition
119 //! protocol to connect to the resource
120 //! protocol used to start a remote container (ssh or rsh)
122 //! login name to use to start a remote container
124 //! salome application to use to start a remote container
126 //! list of available components
127 CompoList componentList;
131 //! memory size per node
137 //! number of proc per node
138 long nb_proc_per_node;
141 //! MPI implementation
143 //! if the resource is a cluster:
144 //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
148 //! exception thrown if a computer is not found in the catalog
149 exception NotFound {};
153 //! Job Type - Could be equal to "command" or "yacs_file" or "python_salome"
161 string work_directory;
162 string local_directory;
163 string result_directory;
165 /*! Time for the batch (has to be like this : hh:mm) - Could be empty, in
166 this case, default value of the selected resource will be used.
168 string maximum_duration;
170 // Memory is expressed in megabytes -> mem_mb
171 // Number of Processors -> nb_proc
172 ResourceParameters resource_required;
175 Name of the batch queue choosed - optional
180 Specific parameters for each type of job - optional
182 Engines::ParameterList specific_parameters;
185 /*! \brief Interface of the %salomelauncher
186 This interface is used for interaction with the unique instance
189 interface SalomeLauncher
192 long createJob (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
193 void launchJob (in long job_id) raises (SALOME::SALOME_Exception);
194 string getJobState (in long job_id) raises (SALOME::SALOME_Exception);
195 void getJobResults(in long job_id, in string directory) raises (SALOME::SALOME_Exception);
196 void removeJob (in long job_id) raises (SALOME::SALOME_Exception);
199 long createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
200 boolean testBatch (in ResourceParameters params) raises (SALOME::SALOME_Exception);
202 // SALOME kernel service methods
207 /*! \brief Interface of the %containerManager
208 This interface is used for interaction with the unique instance
211 interface ContainerManager
213 //! GiveContainer - use mode parameter of ContainerParameters to configure
214 //! how this method works
215 //! Currently: get, start, getorstart, findorstart, find
216 Container GiveContainer(in ContainerParameters params);
218 //! Shutdown all containers that have been launched by the container manager
219 void ShutdownContainers();
222 /*! \brief Interface of the %resourcesManager
223 This interface is used for interaction with the unique instance
226 interface ResourcesManager
228 //! Find first available resource in a resources list
229 string FindFirst(in ResourceList possibleResources);
231 //! Find best available computer according to policy in a computers list
232 string Find(in string policy, in ResourceList possibleResources);
234 //! Get a list of resources that are best suited to launch a container given constraints
236 The constraints are resource constraints (params) and components constraints (componentList)
238 ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
240 //! Get definition of a resource
241 ResourceDefinition GetResourceDefinition(in string name);
245 // For compatibility - will be erased on SALOME 6
246 typedef sequence<string> MachineList;
247 //! Type to describe required properties of a container.
248 struct MachineParameters
250 //! container name if given else automatic
251 string container_name;
252 //! host name if given else automatic
254 //! if given list of components that could be loaded on the container
255 CompoList componentList;
256 //! if given restricted list of machines to search in
257 MachineList computerList;
258 //! required operating system
260 //! required memory size
262 //! required frequency
264 //! required number of proc per node
265 long nb_proc_per_node;
266 //! required number of node
268 //! if true start a MPI container
270 //! container working directory
272 //! creation mode for GiveContainer.
273 /*!start creates a new container
274 * get try to find an existing container
275 * getorstart use an existing container if it exists or creates a new one
278 //! resource management policy : first, cycl, altcycl or best (can be extended)
281 //! PaCO specific informations
283 long nb_component_nodes;