Salome HOME
bos #26458 Versioning of sources via git commit id (sha1)
[modules/yacs.git] / doc / execution.rst
1
2
3 .. _execution:
4
5 Execution of a schema
6 =====================
7
8
9
10 In the frames of one YACS GUI session, YACS module allows the user to operate with several study documents (one per desktop). Each study 
11 may contain some schemas, but only one YACS engine instance exists per study.
12
13 .. _execute_schema:
14
15 Execute a schema
16 ----------------
17 The user can execute a schema in different modes. Each of these modes can be chosen from :ref:`yacs_menu` of the YACS GUI in schema run mode. They are
18
19
20
21
22 + **Without stop Mode** - execute a schema in a normal way,
23
24 .. _breakpoints_mode:
25
26 + **Breakpoints Mode** - execution of a schema is paused on each breakpoint,
27
28
29 + **Step by step Mode** - execute a schema step-by-step (i.e. node by node).
30
31
32
33
34
35 It's worth mentioning that for breakpoints mode it is suitable to use nodes' check boxes in the schema Tree View for run mode in order
36 to set a breakpoint on a node.
37
38 **Stop on error** option from :ref:`execution_toolbar` or from YACS main menu :ref:`yacs_menu` finishes execution of a schema if any error occurs. 
39 It's useful if a schema has some parallel chains of nodes which can be executed simultaneously, and the user wants to break execution process 
40 of the whole schema if only one of chains raise an error.
41
42 .. _start_resume:
43
44 In order to start/resume execution of a schema it is needed to choose **Start/Resume execution** item from YACS main menu :ref:`yacs_menu` or click 
45 corresponding button on :ref:`execution_toolbar`. This same command resumes schemas' execution, if it was paused earlier.
46
47 .. _pause_abort_reset:
48
49 The user can pause execution of a schema with help of **Suspend execution** item from YACS main menu :ref:`yacs_menu` or corresponding button 
50 on :ref:`execution_toolbar`. By analogy, **Abort execution** and **Restart execution** commands can be activated either from YACS
51 main menu or Execution toolbar. **Abort execution** command kills execution of a schema, and
52 **Restart execution** command restart execution after having reset nodes terminated with error to initial state.
53
54 In the frames of YACS GUI a preliminary step of checking schemas' validity before creating a schema run is performed. The user is 
55 informed by the system about all problems detected by this operation.
56
57
58
59 .. image:: images/functionality_list_79.jpg
60   :align: center
61
62 .. centered::
63   **An example result of checking schemas' validity before create a schema run**
64
65
66 If a preliminary check is successfully done, schema run is created and then the user can start its execution in the chosen mode. Schema run 
67 is exported to an XML file and passed to YACS CORBA engine and executed there.
68
69 For visual representation of execution state the following means are provided by YACS module.
70
71
72
73
74 + **State of a node** - each state has its own color code at any moment of the execution. During the execution the background color of 
75   the nodes' status is changed according to its execution status. In the YACS module for SALOME this color code is predefined. 
76   The user has the possibility to specify it in the user preferences (see :ref:`set_user_preferences` section).
77
78
79 + **Values of ports** are shown during the execution process either on ports inside Tree view or on nodes' property page.
80
81
82 More than that, schema Tree View in run mode shows information about the current execution state of the whole schema and the current 
83 execution state of each node.
84
85
86
87 .. image:: images/functionality_list_80.jpg
88   :align: center
89
90 .. centered::
91   **The state of run Tree View during schemas' execution**
92
93
94 The selection of object in the run Tree View activates Input Panel with schema or node property page depending on the type of selected object.
95
96
97
98 .. image:: images/functionality_list_81.jpg
99   :align: center
100
101
102 .. centered::
103   **Schema property page in run mode**
104
105
106
107
108 .. image:: images/functionality_list_82.jpg
109   :align: center
110
111 .. centered::
112   **Inline node property page in run mode**
113
114
115 The user can get a detailed information about errors (if any) occured during the execution process from list box on the schema run property page.
116
117 The user can get errors on one node by using the **Node Error Details** command from its context menu.
118
119 .. image:: images/functionality_list_82a.jpg
120   :align: center
121
122 .. centered::
123   **Error Details in an Inline node (zero division error)**
124
125 The **Node Error Report** command from the context menu gives the same information plus the status of the node.
126
127 For SALOME nodes, the **Node Container Log** command shows the associated container log as the node is executed in a remote process (container).
128
129 Lastly, the **YACS container log** command from the schema context menu shows the log of the YACS server where the user can find information
130 to solve problems encountered during the execution.
131
132 .. image:: images/functionality_list_82b.jpg
133   :align: center
134
135 .. centered::
136   **YACS container log**
137
138 .. _save_restore_execution_state:
139
140 Save/Restore execution state
141 ----------------------------
142 If the current study contains an executable schema and the schema is in paused or stopped state, the user can save the current execution 
143 state of the schema for its further usage.
144
145 The user can save an execution state of the schema by choosing the **Save State** command from the YACS main menu :ref:`yacs_menu` or from 
146 the :ref:`execution_toolbar`. As a result of this operation, the dialog box similar to the standard SALOME GUI "Save file" dialog box 
147 is shown by YACS module. The user should select an XML file to save schemas execution state into and the current execution state of the 
148 schema is saved into the selected XML file.
149
150 Here is an example of XML file structure storing the current state of schemas' execution.
151
152 ::
153
154
155  <?xml version='1.0'?>
156  <graphState>
157   <node type='elementaryNode'>
158     <name>poly_7</name>
159     <state>READY</state>
160     <inputPort>
161       <name>x</name>
162       <value><double>0.5</double></value>
163     </inputPort>
164   </node>
165   <node type='elementaryNode'>
166     <name><b>init</b></name>
167     <state><b>DONE</b></state>
168   </node>
169   <node type='elementaryNode'>
170     <name><b>Legendre.loopIter.deuxIter.iter1</b></name>
171     <state><b>DONE</b></state>
172     <inputPort>
173       <name>Pnm1</name>
174       <value><double>-0.4375</double></value>
175     </inputPort>
176     <inputPort>
177       <name>Pnm2</name>
178       <value><double>-0.289062</double></value>
179     </inputPort>
180     <inputPort>
181       <name>x</name>
182       <value><double>0.5</double></value>
183     </inputPort>
184     <inputPort>
185       <name>n</name>
186       <value><int>4</int></value>
187     </inputPort>
188   </node>
189   <node type='elementaryNode'>
190     <name><b>Legendre.loopIter.deuxIter.iter2</b></name>
191     <state><b>TOACTIVATE</b></state>
192     <inputPort>
193       <name>Pnm1</name>
194       <value><double>-0.289062</double></value>
195     </inputPort>
196     <inputPort>
197       <name>Pnm2</name>
198       <value><double>-0.4375</double></value>
199     </inputPort>
200     <inputPort>
201       <name>x</name>
202       <value><double>0.5</double></value>
203     </inputPort>
204     <inputPort>
205       <name>n</name>
206       <value><int>5</int></value>
207     <inputPort>
208   </node>
209   <node type='bloc'>
210     <name><b>Legendre.loopIter.deuxIter</b></name>
211     <state><b>ACTIVATED</b></state>
212   </node>
213   <node type='forLoop'>
214     <name><b>Legendre.loopIter</b></name>
215     <state><b>ACTIVATED</b></state>
216     <nbdone>1</nbdone>
217     <nsteps>3</nsteps>
218   </node>
219   <node type='elementaryNode'>
220     <name><b>Legendre.iter_1</b></name>
221     <state><b>DONE</b></state>
222     <inputPort>
223       <name>x</name>
224       <value><double>0.5</double></value>
225     </inputPort>
226   </node>
227   <node type='elementaryNode'>
228     <name><b>Legendre.iter_0</b></name>
229     <state><b>DONE</b></state>
230   </node>
231   <node type='bloc'>
232     <name><b>Legendre</b></name>
233     <state><b>ACTIVATED</b></state>
234   </node>
235   <node type='proc'>
236     <name><b>proc</b></name>
237     <state><b>ACTIVATED</b></state>
238   </node>
239  </graphState>
240
241 XML file contains states of all schema nodes and the state of the whole schema.
242
243 If during saving the execution state into the XML file, problems with access rights or free space on a disk drive occur, YACS module 
244 cancels saving of the execution state and shows an error message.
245
246 To continue the execution later from saved state the user can restore execution state for the selected schema from an XML file with 
247 help from the :ref:`execution_toolbar`.
248
249 By default the **Save State** and **Load execution state** commands are applicable to the active schema.
250
251 .. _shutdown:
252
253 Schema shutdown
254 --------------------
255 In GUI, shutdown must be explicitly requested by the user by using the context menu of the schema (**Shutdown Proc** entry).
256
257 .. image:: images/functionality_list_82c.jpg
258   :align: center
259
260 The shutdown level can be changed in the schema property page with the shutdown level combobox.
261
262 .. image:: images/functionality_list_64a.jpg
263   :align: center
264
265 .. _create_new_edition:
266
267 Create new edition
268 ------------------
269 In the run mode YACS GUI for SALOME provides the user with the possibility to create a copy of executed schema in order to do some 
270 modifications in it. This functionality is avalable with help of **Edit Again** command from YACS main menu :ref:`yacs_menu` in run mode of 
271 a schema or from corresponding button on the :ref:`execution_toolbar` in the same mode.
272
273 In such a case the user can done any modifications in the edition copy of the current schema run and after some corrections create a 
274 new run schema object corresponding to the modified version of the schema. It can be considered as a cyclic process of execution 
275 and correction of a schema.
276
277