Salome HOME
Add batch parameter wckey to SALOME Launcher
[modules/yacs.git] / idl / SALOME_Launcher.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_LAUNCHER_IDL_
24 #define _SALOME_LAUNCHER_IDL_
25
26 #include "SALOME_Exception.idl"
27 #include "SALOME_ResourcesManager.idl"
28
29 /*! \file SALOME_Launcher.idl \brief interfaces for %SALOME Launcher service
30 */
31
32 module Engines
33 {
34
35 //! files list
36 typedef sequence<string> FilesList;
37
38 //! A generic parameter
39 struct Parameter
40 {
41   string name;
42   string value;
43 };
44 //! Generic parameter list
45 typedef sequence<Engines::Parameter> ParameterList;
46
47 struct JobParameters
48 {
49   string job_name;
50   //! Job Type - Could be equal to "command" or "yacs_file" or "python_salome"
51   string job_type;
52
53   // Common values
54   string job_file;
55   string env_file; 
56   FilesList in_files;
57   FilesList out_files;
58   string work_directory;
59   string local_directory;
60   string result_directory;
61
62   /*! Time for the batch (has to be like this : hh:mm) - Could be empty, in
63        this case, default value of the selected resource will be used.
64   */
65   string maximum_duration; 
66
67   // Memory is expressed in megabytes -> mem_mb
68   // Number of Processors -> nb_proc
69   ResourceParameters resource_required;
70
71   /*!
72     Name of the batch queue choosed - optional
73   */
74   string queue;
75   
76   //! Specifies if the job must run in exclusive mode (without sharing nodes with other jobs)
77   boolean exclusive;
78
79   //! Specifies the memory limit per cpu (exclusive with resource_required.mem_mb)
80   unsigned long mem_per_cpu;
81
82   //! Workload Characterization Key - mandatory on some clusters
83   string wckey;
84
85   /*!
86     Specific parameters for each type of job - optional
87   */
88   Engines::ParameterList specific_parameters;
89
90   // Parameters for COORM
91   string launcher_file;
92   string launcher_args;
93 };
94
95 struct JobDescription
96 {
97   long job_id;
98   Engines::JobParameters job_parameters;
99 };
100 typedef sequence<Engines::JobDescription> JobsList;
101
102 interface SalomeLauncherObserver
103 {
104   void notify(in string event_name, in string event_data);
105 };
106
107 /*! \brief Interface of the %salomelauncher
108     This interface is used for interaction with the unique instance
109     of SalomeLauncher
110 */
111 interface SalomeLauncher
112 {
113   // Main methods
114   long   createJob    (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception);
115   void   launchJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
116   string getJobState  (in long job_id)                           raises (SALOME::SALOME_Exception);
117   string getAssignedHostnames  (in long job_id)                  raises (SALOME::SALOME_Exception); // Get names or ids of hosts assigned to the job
118   void   getJobResults(in long job_id, in string directory)      raises (SALOME::SALOME_Exception);
119   boolean getJobDumpState(in long job_id, in string directory)   raises (SALOME::SALOME_Exception);
120   void   stopJob      (in long job_id)                           raises (SALOME::SALOME_Exception);
121   void   removeJob    (in long job_id)                           raises (SALOME::SALOME_Exception);
122
123   // Useful methods
124   long    createJobWithFile(in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception);
125   boolean testBatch        (in ResourceParameters params)                raises (SALOME::SALOME_Exception);
126
127   // SALOME kernel service methods
128   void Shutdown();
129   long getPID();
130
131   // Observer and introspection methods
132   void addObserver(in Engines::SalomeLauncherObserver observer);
133   void removeObserver(in Engines::SalomeLauncherObserver observer);
134   Engines::JobsList getJobsList();
135   Engines::JobParameters getJobParameters(in long job_id) raises (SALOME::SALOME_Exception);
136
137   // Save and load methods
138   void loadJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
139   void saveJobs(in string jobs_file) raises (SALOME::SALOME_Exception);
140
141 };
142
143 };
144   
145 #endif