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 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.
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:
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
21 The YACS supervisor in console (driver) mode accepts a few options to set parameters for its execution::
23 Usage: driver [OPTION...] graph.xml
24 driver -- a SALOME YACS graph executor
26 -d, --display=level Display dot files: 0=never to 3=very often
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
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
42 The following gives a few typical uses of the driver.
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::
51 Execution displaying states of nodes during execution
52 ----------------------------------------------------------------------
55 driver --display=1 schema.xml
58 Execution saving the final state of the scheme
59 ----------------------------------------------------------------------
62 driver --dump-final=mystate.xml schema.xml
64 Execution loading the initial state of the scheme
65 ----------------------------------------------------------------------
68 driver --load-state=mystate.xml schema.xml
72 How to configure schema shutdown
73 ---------------------------------------------
76 driver --shutdown=0 schema.xml
80 driver --shutdown=3 schema.xml
82 Restart a schema with reset of nodes in error
83 ----------------------------------------------------------------------
86 driver --reset=1 --load-state=mystate.xml schema.xml
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.
94 Here is an example with 2 SALOME sessions:
96 1. Launch first SALOME session with execution of a schema::
98 <appli>/runAppli -t --ns-port-log=session1.log
99 <appli>/runSession waitContainers.py FactoryServer
100 <appli>/runSession driver schema1.xml
102 2. Launch second SALOME session with execution of another schema::
104 <appli>/runAppli -t --ns-port-log=session2.log
105 <appli>/runSession waitContainers.py FactoryServer
106 <appli>/runSession driver schema2.xml
108 3. Shutdown first session::
110 <appli>/runSession -p `cat session1.log` shutdownSalome.py
112 4. Kill second session::
114 <appli>/bin/salome/killSalomeWithPort.py `cat session2.log`