Back to index

salome-kernel  6.5.0
SALOME_ContainerManager.idl
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef _SALOME_CONTAINERMANAGER_IDL_
00024 #define _SALOME_CONTAINERMANAGER_IDL_
00025 
00026 #include "SALOME_Exception.idl"
00027 #include "SALOME_Component.idl"
00028 
00032 module Engines
00033 {
00034 
00036 typedef sequence<string> ResourceList;
00038 typedef sequence<string> CompoList;
00040 typedef sequence<string> FilesList;
00042 typedef sequence<string> ModulesList;
00043 
00045 struct Parameter
00046 {
00047   string name;
00048   string value;
00049 };
00051 typedef sequence<Engines::Parameter> ParameterList;
00052 
00054 struct ResourceParameters
00055 {
00057   string name;
00059   string hostname;
00061   string OS;
00064   CompoList componentList;
00065 
00066   // Permits to order resources
00068   long nb_proc;
00070   long mem_mb;
00072   long cpu_clock;
00074   long nb_node;
00076   long nb_proc_per_node;
00077 
00078   // Permits to configure SALOME resource management
00080   string policy;
00082   ResourceList resList;
00083 };
00084 
00086 struct ContainerParameters
00087 {
00089   string container_name;
00090 
00092 
00096   string mode;
00097 
00099   string workingdir;
00100 
00101   // Parallel part
00103   long nb_proc;
00105   boolean isMPI;
00107   string parallelLib;
00108 
00110   ResourceParameters resource_params;
00111 };
00112 
00114 struct ResourceDefinition
00115 {
00117   string name;
00119   string hostname;
00122   string protocol;
00124   string username;
00126   string applipath;
00128   CompoList componentList;
00130   string mode;
00131 
00133   string OS;
00135   long mem_mb;
00137   long cpu_clock;
00139   long nb_node;
00141   long nb_proc_per_node;
00143   string batch;
00145   string mpiImpl;
00148   string iprotocol;
00149 
00151   boolean is_cluster_head;
00152 
00154   string working_directory;
00155 };
00156 
00158 exception NotFound {};
00159 
00160 struct JobParameters
00161 {
00162   string job_name;
00164   string job_type;
00165 
00166   // Common values
00167   string job_file;
00168   string env_file; 
00169   FilesList in_files;
00170   FilesList out_files;
00171   string work_directory;
00172   string local_directory;
00173   string result_directory;
00174 
00178   string maximum_duration; 
00179 
00180   // Memory is expressed in megabytes -> mem_mb
00181   // Number of Processors -> nb_proc
00182   ResourceParameters resource_required;
00183 
00187   string queue;
00188 
00192   Engines::ParameterList specific_parameters;
00193 };
00194 
00195 struct JobDescription
00196 {
00197   long job_id;
00198   Engines::JobParameters job_parameters;
00199 };
00200 typedef sequence<Engines::JobDescription> JobsList;
00201 
00202 interface SalomeLauncherObserver
00203 {
00204   void notify(in string event_name, in string event_data);
00205 };
00206 
00211 interface SalomeLauncher
00212 {
00213   // Main methods
00214   long   createJob    (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
00215   void   launchJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
00216   string getJobState  (in long job_id)                           raises (SALOME::SALOME_Exception);
00217   void   getJobResults(in long job_id, in string directory)      raises (SALOME::SALOME_Exception);
00218   boolean getJobDumpState(in long job_id, in string directory)   raises (SALOME::SALOME_Exception);
00219   void   stopJob      (in long job_id)                           raises (SALOME::SALOME_Exception);
00220   void   removeJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
00221 
00222   // Useful methods
00223   long    createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
00224   boolean testBatch        (in ResourceParameters params)                raises (SALOME::SALOME_Exception);
00225 
00226   // SALOME kernel service methods
00227   void Shutdown();
00228   long getPID();
00229 
00230   // Observer and introspection methods
00231   void addObserver(in Engines::SalomeLauncherObserver observer);
00232   void removeObserver(in Engines::SalomeLauncherObserver observer);
00233   Engines::JobsList getJobsList();
00234   Engines::JobParameters getJobParameters(in long job_id) raises (SALOME::SALOME_Exception);
00235 
00236   // Save and load methods
00237   void loadJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
00238   void saveJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
00239 
00240 };
00241   
00246 interface ContainerManager
00247 {
00251   Container GiveContainer(in ContainerParameters params) raises (SALOME::SALOME_Exception);
00252 
00254   void ShutdownContainers();
00255 } ;
00256   
00261 interface ResourcesManager
00262 {
00264   string FindFirst(in ResourceList possibleResources);
00265 
00267   string Find(in string policy, in ResourceList possibleResources);
00268 
00270 
00273   ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
00274 
00276   ResourceDefinition GetResourceDefinition(in string name);
00277 
00279 
00284   void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file) 
00285     raises (SALOME::SALOME_Exception);
00286 
00288 
00293   void RemoveResource(in string resource_name, in boolean write, in string xml_file) 
00294     raises (SALOME::SALOME_Exception);
00295 };
00296 
00297 
00298 // For compatibility - will be erased on SALOME 6
00299 typedef sequence<string> MachineList;
00301 struct MachineParameters
00302 {
00304   string container_name;
00306   string hostname;
00308   CompoList componentList;
00310   MachineList computerList;
00312   string OS;
00314   long mem_mb;
00316   long cpu_clock;
00318   long nb_proc_per_node;
00320   long nb_node;
00322   boolean isMPI;
00324   string workingdir;
00326 
00330   string mode;
00332   string policy;
00333 
00335   string parallelLib;
00336   long nb_component_nodes;
00337 };
00338 };
00339   
00340 #endif