Salome HOME
8938ba4cbb1c834e41b38664d54fc7334d25c292
[modules/kernel.git] / idl / SALOME_ResourcesManager.idl
1 // Copyright (C) 2007-2014  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, or (at your option) any later version.
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
23 #ifndef _SALOME_RESOURCESMANAGER_IDL_
24 #define _SALOME_RESOURCESMANAGER_IDL_
25
26 #include "SALOME_Exception.idl"
27
28 /*! \file SALOME_ResourcesManager.idl \brief interfaces for %SALOME Resources Manager service
29 */
30
31 module Engines
32 {
33
34 //!  Type to transmit list of resources.
35 typedef sequence<string> ResourceList;
36 //! components list
37 typedef sequence<string> CompoList;
38
39 //! Type to describe required properties of a resource
40 struct ResourceParameters
41 {
42   //! resource name - manual selection
43   string name;
44   //! host name
45   string hostname;
46   //! if true select only resources that can launch batch jobs
47   boolean can_launch_batch_jobs;
48   //! if true select only resources that can run containers
49   boolean can_run_containers;
50   //! if given required operating system 
51   string OS;
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;
55
56   // Permits to order resources
57   //! required number of proc
58   long nb_proc;
59   //! required memory size
60   long mem_mb;
61   //! required frequency
62   long cpu_clock;
63   //! required number of node
64   long nb_node;
65   //! required number of proc per node
66   long nb_proc_per_node;
67
68   // Permits to configure SALOME resource management
69   //! resource management policy : first, cycl, altcycl or best (can be extended)
70   string policy;
71   //! restricted list of resources to search in
72   ResourceList resList;
73 };
74
75 //!  Type to describe a resource
76 struct ResourceDefinition
77 {
78   //! name 
79   string name;
80   //! hostname 
81   string hostname;
82   //! Type of the resource ("cluster" or "single_machine")
83   string type;
84   //! protocol to connect to the resource
85   //! protocol used to start a remote container (ssh or rsh)
86   string protocol;
87   //! login name to use to start a remote container
88   string username;
89   //! salome application to use to start a remote container
90   string applipath;
91   //! list of available components 
92   CompoList componentList;
93
94   //! operating system 
95   string OS;
96   //! memory size per node
97   long mem_mb;
98   //! frequency
99   long cpu_clock;
100   //! number of node
101   long nb_node;
102   //! number of proc per node
103   long nb_proc_per_node;
104   //! batch system
105   string batch;
106   //! MPI implementation
107   string mpiImpl;
108   //! if the resource is a cluster:
109   //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
110   string iprotocol;
111
112   //! Specify if the resource can launch batch jobs
113   boolean can_launch_batch_jobs;
114   //! Specify if the resource can run containers
115   boolean can_run_containers;
116
117   //! Predefined working directory on the resource
118   string working_directory;
119 };
120
121 /*! \brief Interface of the %resourcesManager
122     This interface is used for interaction with the unique instance
123     of ResourcesManager
124 */
125 interface ResourcesManager
126 {
127   //!  Find first available resource in a resources list
128   string FindFirst(in ResourceList possibleResources);
129
130   //!  Find best available computer according to policy in a computers list
131   string Find(in string policy, in ResourceList possibleResources);
132
133   //!  Get a list of resources that are best suited to launch a container given constraints 
134   /*! 
135        The constraints are resource constraints (params) and components constraints (componentList)
136   */
137   ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
138
139   //!  Get definition of a resource
140   ResourceDefinition GetResourceDefinition(in string name) raises (SALOME::SALOME_Exception);
141
142   //! Add a new resource to the resource_manager
143   /*!
144       write -> true, resource manager will add it into a xml_file
145       xml_file -> could be empty, in this case if write is true, resource manager will write
146       the resource in its first ResourceCatalog file
147     */
148   void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file) 
149     raises (SALOME::SALOME_Exception);
150
151   //! Remove a new resource to the resource_manager
152   /*!
153       write -> true, resource manager will write a new xml_file
154       xml_file -> could be empty, in this case if write is true, resource manager will write
155       the resource in its first ResourceCatalog file
156     */
157   void RemoveResource(in string resource_name, in boolean write, in string xml_file) 
158     raises (SALOME::SALOME_Exception);
159 };
160
161 };
162   
163 #endif