Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / src / Tools / padder / meshjob / idl / MESHJOB.idl
1 // Copyright (C) 2011-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Authors : Guillaume Boulant (EDF) - 31/01/2011
20
21 #ifndef _MESHJOB_IDL_
22 #define _MESHJOB_IDL_
23
24 #include "SALOME_Exception.idl"
25 #include "SALOME_Component.idl"
26
27 //
28 // This interface is used for mesh job submission from within the
29 // SALOME plugin for PADDER.
30 //
31 module MESHJOB
32 {
33
34   //
35   // Structure to transmit the parameters requiered for the job to run
36   // the executable program on the target resource. See configure
37   // service.
38   //
39   struct ConfigParameter {
40     string resname; // The name of the SALOME resource to be used
41     string binpath; // The path of the executable program on this resource
42     string envpath; // The path of the environment file on this resource
43   };
44
45   //
46   // This set of specification defines the data structure used to
47   // initialize a job on a specific resource, then supervise the job
48   // and finally retrieve the result data.
49   //
50
51   // This defines the set of temporary folders used by the jobmanager
52   // when executing a job (may depends on the job).
53   struct MeshJobPaths
54   {
55     string local_inputdir;
56     string local_resultdir;
57     string remote_workdir;
58   };
59
60   // This defines the possible types for a job parameter
61   enum FileType {MED_CONCRETE, MED_STEELBAR};
62
63   // This defines a single parameter for the job initialization (a med file)
64   struct MeshJobParameter
65   {
66     string file_name;
67     FileType file_type;
68     string group_name;
69   };
70   
71   // This defines a set of parameters for the job initialization
72   typedef sequence<MESHJOB::MeshJobParameter> MeshJobParameterList;
73
74   // This defines the result data of a job 
75   struct MeshJobResults
76   {
77     string results_dirname;
78     string outputmesh_filename;
79     string status;
80   };
81
82   // This defines the possible states of a job
83   enum MeshJobState {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR};
84
85   //
86   // This interface defines the computation services of the component
87   //
88
89   interface MeshJobManager: Engines::EngineComponent
90   {
91
92      /*! Add a resource configuration, identified by the string
93          configId and characterized by the parameters in
94          configParameter */
95     boolean configure(in string configId, in MESHJOB::ConfigParameter configParameter)
96       raises (SALOME::SALOME_Exception);
97
98     /*! Initialize a smesh computation job and return the job identifier */
99     long    initialize(in MESHJOB::MeshJobParameterList meshJobParameterList, in string configId)
100       raises (SALOME::SALOME_Exception);
101
102     /*! Submit the job execution and return true if submission is OK */
103     boolean start(in long jobId)
104       raises (SALOME::SALOME_Exception);
105
106     /*! Request the launch manager for the state of the specified job */
107     string getState(in long jobId)
108       raises (SALOME::SALOME_Exception);
109
110     /*! Request the launch manager for downloading the results */
111     MeshJobResults finalize(in long jobid)
112       raises (SALOME::SALOME_Exception);
113
114     /*! Clean all data associated to this job and remove the job from the launch manager */
115     boolean clean(in long jobId)
116       raises (SALOME::SALOME_Exception);
117
118     /*! Returns the set of temporary folders used by the job instance */
119     MeshJobPaths getPaths(in long jobId)
120       raises (SALOME::SALOME_Exception);
121
122   };
123
124 };
125
126 #endif // _MESHJOB_IDL_