Version: 6.3.1

idl/SALOME_ContainerManager.idl

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  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 };
00150 
00152 exception NotFound {};
00153 
00154 struct JobParameters
00155 {
00156   string job_name;
00158   string job_type;
00159 
00160   // Common values
00161   string job_file;
00162   string env_file; 
00163   FilesList in_files;
00164   FilesList out_files;
00165   string work_directory;
00166   string local_directory;
00167   string result_directory;
00168 
00172   string maximum_duration; 
00173 
00174   // Memory is expressed in megabytes -> mem_mb
00175   // Number of Processors -> nb_proc
00176   ResourceParameters resource_required;
00177 
00181   string queue;
00182 
00186   Engines::ParameterList specific_parameters;
00187 };
00188 
00189 struct JobDescription
00190 {
00191   long job_id;
00192   Engines::JobParameters job_parameters;
00193 };
00194 typedef sequence<Engines::JobDescription> JobsList;
00195 
00196 interface SalomeLauncherObserver
00197 {
00198   void notify(in string event_name, in string event_data);
00199 };
00200 
00205 interface SalomeLauncher
00206 {
00207   // Main methods
00208   long   createJob    (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
00209   void   launchJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
00210   string getJobState  (in long job_id)                           raises (SALOME::SALOME_Exception);
00211   void   getJobResults(in long job_id, in string directory)      raises (SALOME::SALOME_Exception);
00212   boolean getJobDumpState(in long job_id, in string directory)   raises (SALOME::SALOME_Exception);
00213   void   removeJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
00214 
00215   // Useful methods
00216   long    createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
00217   boolean testBatch        (in ResourceParameters params)                raises (SALOME::SALOME_Exception);
00218 
00219   // SALOME kernel service methods
00220   void Shutdown();
00221   long getPID();
00222 
00223   // Observer and introspection methods
00224   void addObserver(in Engines::SalomeLauncherObserver observer);
00225   void removeObserver(in Engines::SalomeLauncherObserver observer);
00226   Engines::JobsList getJobsList();
00227   Engines::JobParameters getJobParameters(in long job_id) raises (SALOME::SALOME_Exception);
00228 
00229   // Save and load methods
00230   void loadJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
00231   void saveJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
00232 
00233 };
00234   
00239 interface ContainerManager
00240 {
00244   Container GiveContainer(in ContainerParameters params) raises (SALOME::SALOME_Exception);
00245 
00247   void ShutdownContainers();
00248 } ;
00249   
00254 interface ResourcesManager
00255 {
00257   string FindFirst(in ResourceList possibleResources);
00258 
00260   string Find(in string policy, in ResourceList possibleResources);
00261 
00263 
00266   ResourceList GetFittingResources(in ResourceParameters params) raises (SALOME::SALOME_Exception);
00267 
00269   ResourceDefinition GetResourceDefinition(in string name);
00270 
00272 
00277   void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file) 
00278     raises (SALOME::SALOME_Exception);
00279 
00281 
00286   void RemoveResource(in string resource_name, in boolean write, in string xml_file) 
00287     raises (SALOME::SALOME_Exception);
00288 };
00289 
00290 
00291 // For compatibility - will be erased on SALOME 6
00292 typedef sequence<string> MachineList;
00294 struct MachineParameters
00295 {
00297   string container_name;
00299   string hostname;
00301   CompoList componentList;
00303   MachineList computerList;
00305   string OS;
00307   long mem_mb;
00309   long cpu_clock;
00311   long nb_proc_per_node;
00313   long nb_node;
00315   boolean isMPI;
00317   string workingdir;
00319 
00323   string mode;
00325   string policy;
00326 
00328   string parallelLib;
00329   long nb_component_nodes;
00330 };
00331 };
00332   
00333 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS