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 machines.
35 typedef sequence<string> MachineList;
37 typedef sequence<string> CompoList;
39 typedef sequence<string> FilesList;
41 typedef sequence<string> ModulesList;
43 //! Type to describe required properties of a container.
44 struct MachineParameters
46 //! container name if given else automatic
47 string container_name;
48 //! host name if given else automatic
50 //! if given list of components that could be loaded on the container
51 CompoList componentList;
52 //! if given restricted list of machines to search in
53 MachineList computerList;
54 //! required operating system
56 //! required memory size
58 //! required frequency
60 //! required number of proc per node
61 long nb_proc_per_node;
62 //! required number of node
64 //! if true start a MPI container
66 //! container working directory
68 //! creation mode for GiveContainer.
69 /*!start creates a new container
70 * get try to find an existing container
71 * getorstart use an existing container if it exists or creates a new one
74 //! resource management policy : first, cycl, altcycl or best (can be extended)
77 //! PaCO specific informations
79 long nb_component_nodes;
82 //! Type to describe properties of a resource.
83 struct MachineDefinition
89 //! protocol to use to start a remote container (ssh or rsh)
91 //! login name to use to start a remote container
93 //! salome application to use to start a remote container
95 //! list of available components
96 CompoList componentList;
103 //! number of proc per node
104 long nb_proc_per_node;
107 //! MPI implementation
111 long nb_component_nodes;
113 //! exception thrown if a computer is not found in the catalog
114 exception NotFound {};
116 //! Structure used for Salome Batch Job parameters
117 struct BatchParameters
119 //! Where batch command will be launched and log files will be created
120 string batch_directory;
121 //! Time for the batch (has to be like this : hh:mm)
122 string expected_during_time;
123 //! Minimum of memory needed (has to be like : 32gb or 512mb)
125 //! Number of processors requested
129 /*! \brief Interface of the %salomelauncher
130 This interface is used for interaction with the unique instance
133 interface SalomeLauncher
135 long submitJob( in string xmlExecuteFile,
136 in string clusterName ) raises (SALOME::SALOME_Exception);
137 long submitSalomeJob( in string fileToExecute,
138 in FilesList filesToExport,
139 in FilesList filesToImport,
140 in BatchParameters batch_params,
141 in MachineParameters params ) raises (SALOME::SALOME_Exception);
142 string queryJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
143 void deleteJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
144 void getResultsJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
146 boolean testBatch(in MachineParameters params) raises (SALOME::SALOME_Exception);
154 /*! \brief Interface of the %containerManager
155 This interface is used for interaction with the unique instance
158 interface ContainerManager
160 //! Find an existing container satisfying the constraints given by input parameters or start a new one.
161 Container FindOrStartContainer( in MachineParameters params);
163 //! This operation launches a PaCO++ container.
165 \param Description of the container resquested.
166 \param List of computers ressources.
168 \return Container's CORBA reference.
170 Container StartParallelContainer( in MachineParameters params);
172 //! Start a new container satisfying the constraints given by input parameters.
173 Container StartContainer( in MachineParameters params);
175 //! Same as StartContainer except that in batch all containers have already been launched
177 We are in batch if environment variable SALOME_BATCH is 1.
178 In this case, containers have been launched at the beginning of the Salome session and
179 the container manager picks one in the pool of existing containers.
181 Container GiveContainer( in MachineParameters params);
183 //! Shutdown all containers that have been launched by the container manager
184 void ShutdownContainers();
188 /*! \brief Interface of the %resourcesManager
189 This interface is used for interaction with the unique instance
192 interface ResourcesManager
194 //! Find first available computer in a computers list
195 string FindFirst(in MachineList possibleComputers);
197 //! Find best available computer according to policy in a computers list
198 string Find(in string policy, in MachineList possibleComputers);
200 //! Get a list of computers that are best suited to launch a container given constraints
202 The constraints are resource constraints (params) and components constraints (componentList)
204 MachineList GetFittingResources( in MachineParameters params)
205 raises (SALOME::SALOME_Exception);
207 //! Get the current machine parameters of a computer
208 MachineDefinition GetMachineParameters( in string hostname );