1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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
23 #ifndef _SALOME_RESOURCESMANAGER_IDL_
24 #define _SALOME_RESOURCESMANAGER_IDL_
26 #include "SALOME_Exception.idl"
28 /*! \file SALOME_ResourcesManager.idl \brief interfaces for %SALOME Resources Manager service
34 //! Type to transmit list of resources.
35 typedef sequence<string> ResourceList;
37 typedef sequence<string> CompoList;
39 //! Type to describe required properties of a resource
40 struct ResourceParameters
42 //! resource name - manual selection
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
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 a resource
76 struct ResourceDefinition
82 //! Type of the resource ("cluster" or "single_machine")
84 //! protocol to connect to the resource
85 //! protocol used to start a remote container (ssh or rsh)
87 //! login name to use to start a remote container
89 //! salome application to use to start a remote container
91 //! list of available components
92 CompoList componentList;
96 //! memory size per node
102 //! number of proc per node
103 long nb_proc_per_node;
106 //! MPI implementation
108 //! if the resource is a cluster:
109 //! internal protocol to use to start a remote container (ssh or rsh) on the cluster
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;
117 //! Predefined working directory on the resource
118 string working_directory;
121 /*! \brief Interface of the %resourcesManager
122 This interface is used for interaction with the unique instance
125 interface ResourcesManager
127 //! Find first available resource in a resources list
128 string FindFirst(in ResourceList possibleResources);
130 //! Find best available computer according to policy in a computers list
131 string Find(in string policy, in ResourceList possibleResources);
133 //! Get a list of resources that are best suited to launch a container given constraints
135 The constraints are resource constraints (params) and components constraints (componentList)
137 ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
139 //! Get definition of a resource
140 ResourceDefinition GetResourceDefinition(in string name) raises (SALOME::SALOME_Exception);
142 //! Add a new resource to the resource_manager
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
148 void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file)
149 raises (SALOME::SALOME_Exception);
151 //! Remove a new resource to the resource_manager
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
157 void RemoveResource(in string resource_name, in boolean write, in string xml_file)
158 raises (SALOME::SALOME_Exception);