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 //! Type to describe required properties of a resource
44 struct ResourceParameters
46 //! resource name - manual selection
50 //! if given required operating system
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;
56 // Permits to order resources
57 //! required number of proc
59 //! required memory size
61 //! required frequency
63 //! required number of node
65 //! required number of proc per node
66 long nb_proc_per_node;
68 // Permits to configure SALOME resource management
69 //! resource management policy : first, cycl, altcycl or best (can be extended)
71 //! restricted list of resources to search in
75 //! Type to describe required properties of a container
76 struct ContainerParameters
78 //! container name if given else automatic
79 string container_name;
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
88 //! container working directory if given else automatic
92 //! Number of proc of a parallel container
94 //! if true start a MPI container
96 //! PaCO specific informations
99 //! Parameters to choose a resource
100 ResourceParameters resource_params;
103 //! Type to describe a resource
104 struct ResourceDefinition
110 //! protocol to connect to the resource
111 //! protocol used to start a remote container (ssh or rsh)
113 //! login name to use to start a remote container
115 //! salome application to use to start a remote container
117 //! list of available components
118 CompoList componentList;
122 //! memory size per node
128 //! number of proc per node
129 long nb_proc_per_node;
132 //! MPI implementation
134 //! if the resource is a cluster:
135 //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
139 //! exception thrown if a computer is not found in the catalog
140 exception NotFound {};
144 //! Job Type - Could be equal to "command" or "yacs_file" or "python_salome"
152 string work_directory;
153 string local_directory;
154 string result_directory;
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.
159 string maximum_duration;
161 // Memory is expressed in megabytes -> mem_mb
162 // Number of Processors -> nb_proc
163 ResourceParameters resource_required;
166 Name of the batch queue choosed - optional
171 /*! \brief Interface of the %salomelauncher
172 This interface is used for interaction with the unique instance
175 interface SalomeLauncher
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);
185 long createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
186 boolean testBatch (in ResourceParameters params) raises (SALOME::SALOME_Exception);
188 // SALOME kernel service methods
193 /*! \brief Interface of the %containerManager
194 This interface is used for interaction with the unique instance
197 interface ContainerManager
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);
204 //! Shutdown all containers that have been launched by the container manager
205 void ShutdownContainers();
208 /*! \brief Interface of the %resourcesManager
209 This interface is used for interaction with the unique instance
212 interface ResourcesManager
214 //! Find first available resource in a resources list
215 string FindFirst(in ResourceList possibleResources);
217 //! Find best available computer according to policy in a computers list
218 string Find(in string policy, in ResourceList possibleResources);
220 //! Get a list of resources that are best suited to launch a container given constraints
222 The constraints are resource constraints (params) and components constraints (componentList)
224 ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
226 //! Get definition of a resource
227 ResourceDefinition GetResourceDefinition(in string name);
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
236 //! container name if given else automatic
237 string container_name;
238 //! host name if given else automatic
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
246 //! required memory size
248 //! required frequency
250 //! required number of proc per node
251 long nb_proc_per_node;
252 //! required number of node
254 //! if true start a MPI container
256 //! container working directory
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
264 //! resource management policy : first, cycl, altcycl or best (can be extended)
267 //! PaCO specific informations
269 long nb_component_nodes;