Salome HOME
Exclude 'CVS' directories from source files processing.
[modules/yacs.git] / doc / execxml.rst
1
2 .. _execxml:
3
4 Executing a calculation scheme in console mode 
5 ========================================================
6
7 A well-configured SALOME installation is necessary to execute a calculation scheme in the XML format in console mode.  
8 SALOME execution mode from a SALOME application will be used in the remainder of this document.
9
10 1.      run SALOME:  ./runAppli -t, for example from the application directory (it can be run from any other directory).
11 2.      execute the YACS supervisor:  ./runSession driver schema.xml
12 3.      stop SALOME:  ./runSession shutdownSalome.py for a clean stop or ./runSession killSalome.py for an immediate stop.
13
14 Steps 2 and 3 can be done from inside a SALOME session. YACS can be executed and SALOME can be stopped within this session as follows:
15
16 1.      initialise the session:  /.runSession
17 2.      execute the YACS supervisor:  driver schema.xml
18 3.      stop SALOME:  shutdownSalome.py or killSalome.py
19 4.      exit from the session:  CTRL+D
20
21 The YACS supervisor in console (driver) mode accepts a few options to set parameters for its execution::
22
23   Usage: driver [OPTION...] graph.xml
24   driver -- a SALOME YACS graph executor
25
26     -d, --display=level        Display dot files: 0=never to 3=very often
27                                (default 0)
28     -e, --dump-on-error[=file] Stop on first error and dump state
29     -f, --dump-final[=file]    dump final state
30     -l, --load-state=file      Load State from a previous partial execution
31     -r, --reset=level          Reset the schema before execution: 0=nothing,
32                                1=reset error nodes to ready state (default 0)
33     -s, --stop-on-error        Stop on first error
34     -t, --shutdown=level       Shutdown the schema: 0=no shutdown to 3=full
35                                shutdown (default 1)
36     -v, --verbose              Produce verbose output
37     -x, --save-xml-schema[=file]   dump xml schema
38     -?, --help                 Give this help list
39         --usage                Give a short usage message
40     -V, --version              Print program version
41
42 The following gives a few typical uses of the driver.
43
44 Standard execution
45 --------------------
46 During a standard execution, the supervisor reads the XML file that describes the scheme, executes it and then produces 
47 an error report (see :ref:`errorreport`) if necessary::
48
49   driver schema.xml
50
51 Execution displaying states of nodes during execution
52 ----------------------------------------------------------------------
53 ::
54
55   driver --display=1 schema.xml
56  
57
58 Execution saving the final state of the scheme
59 ----------------------------------------------------------------------
60 ::
61
62   driver --dump-final=mystate.xml schema.xml
63
64 Execution loading the initial state of the scheme
65 ----------------------------------------------------------------------
66 ::
67
68   driver --load-state=mystate.xml schema.xml
69
70 .. _xml_shutdown:
71
72 How to configure schema shutdown
73 ---------------------------------------------
74 No shutdown::
75
76   driver --shutdown=0 schema.xml
77
78 Full shutdown::
79
80   driver --shutdown=3 schema.xml
81
82 Restart a schema with reset of nodes in error
83 ----------------------------------------------------------------------
84 ::
85
86   driver --reset=1 --load-state=mystate.xml schema.xml
87
88 How to manage several SALOME sessions
89 ----------------------------------------------------------------------
90 When you need to launch several SALOME session to execute several schemas in parallel, you have to
91 store the SALOME session number to be able to shutdown or kill one of the sessions but not all of them.
92 The session number can be stored in a file by using the --ns-port-log argument of the runAppli command.
93
94 Here is an example with 2 SALOME sessions:
95
96 1. Launch first SALOME session with execution of a schema::
97
98       <appli>/runAppli -t --ns-port-log=session1.log
99       <appli>/runSession waitContainers.py FactoryServer
100       <appli>/runSession driver schema1.xml
101
102 2. Launch second SALOME session with execution of another schema::
103
104       <appli>/runAppli -t --ns-port-log=session2.log
105       <appli>/runSession waitContainers.py FactoryServer
106       <appli>/runSession driver schema2.xml
107
108 3. Shutdown first session::
109
110       <appli>/runSession -p `cat session1.log`  shutdownSalome.py
111
112 4. Kill second session::
113
114       <appli>/bin/salome/killSalomeWithPort.py `cat session2.log`
115
116