Salome HOME
CCAR: documentation update
[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 machines.
35   typedef sequence<string> MachineList;
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 properties of a resource.
44 struct MachineParameters
45 {
46   string container_name;
47   string hostname;
48   string alias;
49   string protocol;
50   string username;
51   string applipath;
52   ModulesList modList;
53   string OS;
54   long mem_mb;
55   long cpu_clock;
56   long nb_proc_per_node;
57   long nb_node;
58   boolean isMPI;
59   string mpiImpl;
60   string batch;
61   string workingdir;
62
63   // PaCO specific informations
64   string parallelLib;
65   long nb_component_nodes;
66 };
67
68 //! exception thrown if a computer is not found in the catalog
69   exception NotFound {};
70
71 //! enumeration to set a resource management policy
72   enum policy {
73   //! first machine in the list of admissible computers
74   P_FIRST,
75   //! next machine in the list of admissible computers
76   P_CYCL,
77   //! best machine in the list of admissible computers
78   P_BEST};
79 //! resource management policy
80   typedef policy ResPolicy;
81
82 //!  Structure used for Salome Batch Job parameters
83 struct BatchParameters
84 {
85   //! Where batch command will be launched and log files will be created
86   string batch_directory; 
87   //! Time for the batch (has to be like this : hh:mm)
88   string expected_during_time; 
89   //! Minimum of memory needed (has to be like : 32gb or 512mb)
90   string mem; 
91   //! Number of processors requested
92   long nb_proc; 
93 };
94
95 /*! \brief Interface of the %salomelauncher
96     This interface is used for interaction with the unique instance
97     of SalomeLauncher
98 */
99   interface SalomeLauncher
100   {
101     long submitJob( in string xmlExecuteFile,
102                     in string clusterName ) raises (SALOME::SALOME_Exception);
103     long submitSalomeJob( in string fileToExecute,
104                           in FilesList filesToExport,
105                           in FilesList filesToImport,
106                           in BatchParameters batch_params,
107                           in MachineParameters params ) raises (SALOME::SALOME_Exception);
108     string queryJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
109     void deleteJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
110     void getResultsJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception);
111
112     boolean testBatch(in MachineParameters params) raises (SALOME::SALOME_Exception);
113
114     void Shutdown();
115
116     long getPID();
117
118   } ;
119   
120 /*! \brief Interface of the %containerManager
121     This interface is used for interaction with the unique instance
122     of ContainerManager
123 */
124   interface ContainerManager
125   {
126     //!  Find an existing container satisfying the constraints given by input parameters or start a new one.
127     Container FindOrStartContainer( in MachineParameters params,
128                                     in MachineList possibleComputers);
129
130     //!  This operation launches a PaCO++ container.
131     /*!  
132
133       \param Description of the container resquested.
134       \param List of computers ressources.
135
136       \return Container's CORBA reference.
137     */
138     Container FindOrStartParallelContainer( in MachineParameters params,
139                                             in MachineList possibleComputers);
140
141     //!  Start a new container satisfying the constraints given by input parameters.
142     Container StartContainer( in MachineParameters params,
143                               in ResPolicy policy,
144                               in CompoList componentList );
145
146     //!  Same as StartContainer except that in batch all containers have already been launched
147     /*! 
148
149          We are in batch if environment variable SALOME_BATCH is 1.
150          In this case, containers have been launched at the beginning of the Salome session and 
151          the container manager picks one in the pool of existing containers.
152     */
153     Container GiveContainer( in MachineParameters params,
154                              in ResPolicy policy,
155                              in CompoList componentList );
156
157     //!  Shutdown all containers that have been launched by the container manager
158     void ShutdownContainers();
159
160   } ;
161   
162 /*! \brief Interface of the %resourcesManager
163     This interface is used for interaction with the unique instance
164     of ResourcesManager
165 */
166   interface ResourcesManager
167   {
168     //!  Find first available computer in a computers list
169     string FindFirst(in MachineList possibleComputers);
170
171     //!  Get a list of computers that are best suited to launch a container given constraints 
172     /*! 
173
174          The constraints are resource constraints (params) and components constraints (componentList)
175     */
176     MachineList GetFittingResources( in MachineParameters params,
177                                      in CompoList componentList )
178       raises (SALOME::SALOME_Exception);
179
180     //!  Get the current machine parameters of a computer
181     MachineParameters GetMachineParameters( in string hostname );
182
183   } ;
184 };
185   
186 #endif