4 Executing a calculation scheme in console mode
5 ========================================================
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.
10 Steps to run a calculation scheme from the application directory:
12 1. run SALOME: ./salome -t
13 2. execute the YACS supervisor: ./salome shell -- driver schema.xml
14 3. stop every SALOME session: ./salome killall
16 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:
18 1. initialise the session: ./salome shell
19 2. execute the YACS supervisor: driver schema.xml
20 3. stop SALOME: shutdownSalome.py or killSalome.py
21 4. exit from the session: CTRL+D
23 The YACS supervisor in console (driver) mode accepts a few options to set parameters for its execution::
25 Usage: driver [OPTION...] graph.xml
26 driver -- a SALOME YACS graph executor
28 -d, --display=level Display dot files: 0=never to 3=very often
30 -e, --dump-on-error[=file] Stop on first error and dump state
31 -f, --dump-final[=file] dump final state
32 -g, --dump[=nbsec] dump state
33 -k, --kill-port=port Kill Salome application running on the specified
34 port if the driver process is killed (with SIGINT
36 -l, --load-state=file Load State from a previous partial execution
37 -r, --reset=level Reset the schema before execution: 0=nothing,
38 1=reset error nodes to ready state (default 0)
39 -s, --stop-on-error Stop on first error
40 -t, --shutdown=level Shutdown the schema: 0=no shutdown to 3=full
42 -v, --verbose Produce verbose output
43 -x, --save-xml-schema[=file] dump xml schema
44 -?, --help Give this help list
45 --usage Give a short usage message
46 -V, --version Print program version
48 The following gives a few typical uses of the driver.
52 During a standard execution, the supervisor reads the XML file that describes the scheme, executes it and then produces
53 an error report (see :ref:`errorreport`) if necessary::
57 Execution displaying states of nodes during execution
58 ----------------------------------------------------------------------
61 driver --display=1 schema.xml
64 Execution saving the final state of the scheme
65 ----------------------------------------------------------------------
68 driver --dump-final=mystate.xml schema.xml
70 Execution loading the initial state of the scheme
71 ----------------------------------------------------------------------
74 driver --load-state=mystate.xml schema.xml
78 How to configure schema shutdown
79 ---------------------------------------------
82 driver --shutdown=0 schema.xml
86 driver --shutdown=3 schema.xml
88 Restart a schema with reset of nodes in error
89 ----------------------------------------------------------------------
92 driver --reset=1 --load-state=mystate.xml schema.xml
94 Execute a scheme and save the state of execution every 30 seconds
95 ----------------------------------------------------------------------
98 driver -g30 -fmystate.xml schema.xml
101 How to manage several SALOME sessions
102 ----------------------------------------------------------------------
103 When you need to launch several SALOME session to execute several schemas in parallel, you have to
104 store the SALOME session number to be able to shutdown or kill one of the sessions but not all of them.
105 The session number can be stored in a file by using the --ns-port-log argument of the runAppli command.
107 Here is an example with 2 SALOME sessions:
109 1. Launch first SALOME session with execution of a schema::
111 <appli>/salome -t --ns-port-log=/tmp/session1.log
112 <appli>/salome shell -- driver schema1.xml
114 2. Launch second SALOME session with execution of another schema::
116 <appli>/salome -t --ns-port-log=/tmp/session2.log
117 <appli>/salome shell -- driver schema2.xml
119 3. Shutdown first session::
121 <appli>/salome kill `cat /tmp/session1.log`
123 4. Kill second session::
125 <appli>/salome kill `cat /tmp/session2.log`