Salome HOME
Merge from V6_main 01/04/2013
[modules/smesh.git] / src / Tools / padder / meshjob / idl / MESHJOB.idl
1 // Copyright (C) 2011-2013  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
20 // Authors : Guillaume Boulant (EDF) - 31/01/2011
21
22 #ifndef _MESHJOB_IDL_
23 #define _MESHJOB_IDL_
24
25 #include "SALOME_Exception.idl"
26 #include "SALOME_Component.idl"
27
28 //
29 // This interface is used for mesh job submission from within the
30 // SALOME plugin for PADDER.
31 //
32 module MESHJOB
33 {
34
35   //
36   // Structure to transmit the parameters requiered for the job to run
37   // the executable program on the target resource. See configure
38   // service.
39   //
40   struct ConfigParameter {
41     string resname; // The name of the SALOME resource to be used
42     string binpath; // The path of the executable program on this resource
43     string envpath; // The path of the environment file on this resource
44   };
45
46   //
47   // This set of specification defines the data structure used to
48   // initialize a job on a specific resource, then supervise the job
49   // and finally retrieve the result data.
50   //
51
52   // This defines the set of temporary folders used by the jobmanager
53   // when executing a job (may depends on the job).
54   struct MeshJobPaths
55   {
56     string local_inputdir;
57     string local_resultdir;
58     string remote_workdir;
59   };
60
61   // This defines the possible types for a job parameter
62   enum FileType {MED_CONCRETE, MED_STEELBAR};
63
64   // This defines a single parameter for the job initialization (a med file)
65   struct MeshJobParameter
66   {
67     string file_name;
68     FileType file_type;
69     string group_name;
70   };
71   
72   // This defines a set of parameters for the job initialization
73   typedef sequence<MESHJOB::MeshJobParameter> MeshJobParameterList;
74
75   // This defines the result data of a job 
76   struct MeshJobResults
77   {
78     string results_dirname;
79     string outputmesh_filename;
80     boolean status;
81   };
82
83   // This defines the possible states of a job
84   enum MeshJobState {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR};
85
86   //
87   // This interface defines the computation services of the component
88   //
89
90   interface MeshJobManager: Engines::EngineComponent
91   {
92
93      /*! Add a resource configuration, identified by the string
94          configId and characterized by the parameters in
95          configParameter */
96     boolean configure(in string configId, in MESHJOB::ConfigParameter configParameter)
97       raises (SALOME::SALOME_Exception);
98
99     /*! Initialize a smesh computation job and return the job identifier */
100     long    initialize(in MESHJOB::MeshJobParameterList meshJobParameterList, in string configId)
101       raises (SALOME::SALOME_Exception);
102
103     /*! Submit the job execution and return true if submission is OK */
104     boolean start(in long jobId)
105       raises (SALOME::SALOME_Exception);
106
107     /*! Request the launch manager for the state of the specified job */
108     string getState(in long jobId)
109       raises (SALOME::SALOME_Exception);
110
111     /*! Request the launch manager for downloading the results */
112     MeshJobResults finalize(in long jobid)
113       raises (SALOME::SALOME_Exception);
114
115     /*! Clean all data associated to this job and remove the job from the launch manager */
116     boolean clean(in long jobId)
117       raises (SALOME::SALOME_Exception);
118
119     /*! Returns the set of temporary folders used by the job instance */
120     MeshJobPaths getPaths(in long jobId)
121       raises (SALOME::SALOME_Exception);
122
123     /*! Returns the last error message (for user display) */
124     string getLastErrorMessage();
125   };
126
127 };
128
129 #endif // _MESHJOB_IDL_