3 Defining a calculation scheme in the XML format
4 =================================================
5 An XML file that describes a calculation scheme can contain the following information:
7 - definitions of data types
8 - definitions of containers
9 - definitions of elementary calculation nodes
10 - definitions of composite nodes
11 - definitions of connections between nodes
14 These definitions will be presented progressively. We will start with:
16 - the definition of data types
17 - the definition of a sub-set of elementary nodes
18 - the definition of non-datastream connections
19 - the definition of composite nodes
21 We will then add complements on:
23 - the definition of containers
24 - the definition of node properties
25 - the definition of datastream connections
26 - the definition of the remaining elementary nodes.
28 A calculation scheme is defined using the XML proc tag. The simplest calculation scheme is as follows:
35 It contains no definition and it does nothing.
37 Definition of data types
38 ---------------------------------
39 It is impossible to define basic types other than existing types. All basic types are predefined by YACS.
40 However, aliases can be defined. For example, an alias for the double type can be written:
44 <type name="mydble" kind="double"/>
46 we can then write mydble instead of double.
50 The simplest way of defining an object reference type is:
56 The name attribute of the objref tag gives the name of the new type.
57 The complete form to define this type would be:
61 <objref name="mesh" id="IDL:mesh:1.0/>
63 where id is the CORBA repository id of the corresponding SALOME object. This attribute has a default value
64 that is IDL:<type name>:1.0.
66 All that is necessary to define an object reference type derived from another type is to add the name of the basic type(s).
67 For example, for a derived mesh type, we can write:
71 <objref name="refinedmesh">
75 If there are several basic types, we will write:
79 <objref name="refinedmesh">
81 <base>unautretype</base>
84 As for CORBA, we can use namespaces to define types.
85 For example, if the SALOME mesh type is defined in the myns namespace, we will write:
89 <objref name="myns/mesh"/>
93 To define a double sequence, we will write:
97 <sequence name="myseqdble" content="double"/>
99 All attributes of the sequence tag are compulsory. The name attribute gives the name of the new type.
100 The content attribute gives the name of the type of elements in the sequence.
101 A sequence of sequences can be defined by:
105 <sequence name="myseqseqdble" content="myseqdble"/>
107 We can also define a sequence of object references by:
111 <sequence name="myseqmesh" content="refinedmesh"/>
115 A structure is defined using a struct tag with member sub-tags for the definition of structure members.
116 The following is an example definition:
121 <member name="x" type="double"/>
122 <member name="y" type="int"/>
123 <member name="s" type="string"/>
124 <member name="b" type="bool"/>
125 <member name="vd" type="dblevec"/>
128 The member tag has 2 compulsory attributes, firstly name that gives the member name and secondly type that gives its type.
129 The struct tag has a compulsory "name" attribute that gives the name of the type.
131 Definition of elementary calculation nodes
132 -----------------------------------------------
136 '''''''''''''''''''''
137 A Python script inline node is defined using the inline tag with the script sub-tag as in
138 the following example:
142 <inline name="node1" >
146 <outport name="p1" type="int"/>
149 The name attribute (compulsory) of the inline tag is the node name. The Python script is given using the code sub-tag. As many code
150 lines as necessary are added. A CDATA section can be used if the script contains unusual characters. This also makes it possible
151 to assure that only one code tag is used for a complete script.
164 The script calculates the variable p1 that is to be set as a node output variable. The output port “p1” of the node is defined
165 with the outport sub-tag. This tag has two compulsory attributes: name that gives the port name, and type that gives the supported
166 data type. This type must already be defined.
167 To add an input data port, the import tag will be used instead of the output tag.
169 An example node with input and output ports:
173 <inline name="node1" >
175 <code>p1=p1+10</code>
177 <inport name="p1" type="int"/>
178 <outport name="p1" type="int"/>
181 The node now receives p1 as the input variable, adds 10 to it and exports it as an output variable.
183 If you want to execute your script node on a remote container, you have to change the tag from **inline** to **remote**
184 and to add a tag **load** in the definition of the node as in the following example:
188 <remote name="node1" >
190 <code>p1=p1+10</code>
192 <load container="cont1" />
193 <inport name="p1" type="int"/>
194 <outport name="p1" type="int"/>
197 .. _xml_function_node:
200 ''''''''''''''''''''''''
201 A Python function node is defined using the inline tag and the function sub-tag as in the following example:
205 <inline name="node1" >
207 <code>def f(p1):</code>
208 <code> p1=p1+10</code>
209 <code> return p1</code>
211 <inport name="p1" type="int"/>
212 <outport name="p1" type="int"/>
215 The name attribute (compulsory) of the inline tag is the node name. The only difference from the Python script node is in
216 the execution part (function tag instead of the script tag). The function tag has a compulsory name attribute that gives
217 the name of the function to be executed. The body of the function is given with code tags as for the script.
219 If you want to execute your function node on a remote container, you have to change the tag from **inline** to **remote**
220 and to add a tag **load** in the definition of the node as in the following example:
224 <remote name="node1" >
226 <code>def f(p1):</code>
227 <code> p1=p1+10</code>
228 <code> return p1</code>
230 <load container="cont1" />
231 <inport name="p1" type="int"/>
232 <outport name="p1" type="int"/>
235 .. _xml_service_node:
238 ''''''''''''''''''''''''
239 As stated in :ref:`principes`, there are two ways of describing a SALOME service node.
241 The first definition form uses the service tag and the component and method sub-tags as in the following example:
245 <service name="node4" >
246 <component>AddComponent</component>
248 <inport name="x" type="double"/>
249 <inport name="y" type="double"/>
250 <outport name="FuncValue" type="double"/>
251 <outport name="z" type="double"/>
254 The compulsory name attribute of the service tag gives the node name. The component tag gives the name of the SALOME
255 component to be used and method gives the name of the service to be executed. The objective in this case is to execute
256 the AddComponent (Add component) service that is located in SALOME example components.
258 The second definition form uses the service tag and the node and method sub-tags as in the following example:
262 <service name="node5" >
264 <method>Setx</method>
265 <inport name="x" type="double"/>
268 The node tag references the previously defined node4 so as to use the same component instance for node4 and node5.
270 Definition of connections
271 -----------------------------
272 We will need to define a source node and/or a target node for all of the following concerning port connections and initialisations.
273 In all cases, the name that will be used is the relative node name, considering the connection definition context.
277 A control link is defined using the control tag as in the following example:
282 <fromnode>node1</fromnode>
283 <tonode>node2</tonode>
286 The fromnode sub-tag gives the name of the node that will be executed before the node with the name given by the tonode sub-tag.
290 A dataflow link is defined using the datalink tag as in the following example:
295 <fromnode>node1</fromnode> <fromport>p1</fromport>
296 <tonode>node2</tonode> <toport>p1</toport>
299 The fromnode and fromport sub-tags give the name of the node and the output data port that will be connected to the node
300 and to the port for which the names are given by the tonode and toport sub-tags. The above link example states that the output
301 variable p1 of node node1 will be sent to node node2 and used as an input variable p1.
305 A data link is defined using the same datalink tag, but adding the control attribute and setting the value equal to false.
310 <datalink control="false">
311 <fromnode>node1</fromnode> <fromport>p1</fromport>
312 <tonode>node2</tonode> <toport>p1</toport>
315 Therefore the above dataflow link can also be written as follows:
320 <fromnode>node1</fromnode>
321 <tonode>node2</tonode>
323 <datalink control="false">
324 <fromnode>node1</fromnode> <fromport>p1</fromport>
325 <tonode>node2</tonode> <toport>p1</toport>
330 Initialising an input data port
331 -----------------------------------------------
332 An input data port can be initialised with constants by using the parameter tag, and the tonode, toport and value sub-tags.
333 The toport tag gives the name of the input port of the node with the name tonode to be initialised.
334 The initialisation constant is given by the value tag.
335 The constant is encoded using the XML-RPC coding convention (http://www.xmlrpc.com/).
336 Example initialisation:
341 <tonode>node1</tonode> <toport>p1</toport>
342 <value><string>coucou</string></value>
345 Port p1 of node node1 is initialised with a character string type constant (“coucou”).
347 The following gives some examples of XML-RPC coding:
349 ============================ ==============================================
350 Constant XML-RPC coding
351 ============================ ==============================================
352 string "coucou" ``<string>coucou</string>``
353 double 23. ``<double>23</double>``
354 integer 0 ``<int>0</int>``
355 boolean true ``<boolean>1</boolean>``
356 file ``<objref>/tmp/forma01a.med</objref>``
357 list of integers .. code-block:: xml
360 <value><int>1</int> </value>
361 <value><int>0</int> </value>
363 structure (2 members) .. code-block:: xml
366 <member> <name>s</name>
367 <value><int>1</int> </value>
369 <member> <name>t</name>
370 <value><int>1</int> </value>
374 ============================ ==============================================
376 First example starting from previous elements
377 ------------------------------------------------------
378 A complete calculation scheme can be defined with definitions of nodes, connections and initialisations.
383 <inline name="node1" >
385 <code>p1=p1+10</code>
387 <inport name="p1" type="int"/>
388 <outport name="p1" type="int"/>
390 <inline name="node2" >
394 <inport name="p1" type="int"/>
395 <outport name="p1" type="int"/>
397 <service name="node4" >
398 <component>ECHO</component>
399 <method>echoDouble</method>
400 <inport name="p1" type="double"/>
401 <outport name="p1" type="double"/>
404 <fromnode>node1</fromnode> <tonode>node2</tonode>
407 <fromnode>node1</fromnode> <tonode>node4</tonode>
410 <fromnode>node1</fromnode> <fromport>p1</fromport>
411 <tonode>node2</tonode> <toport>p1</toport>
414 <fromnode>node1</fromnode> <fromport>p1</fromport>
415 <tonode>node4</tonode> <toport>p1</toport>
418 <tonode>node1</tonode> <toport>p1</toport>
419 <value><int>5</int></value>
423 The scheme includes 2 Python nodes (node1, node2) and one SALOME node (node4).
424 Nodes node2 and node4 can be executed in parallel as can be seen on the following diagram.
426 .. image:: images/ex1.png
429 Definition of composite nodes
430 -----------------------------------
431 The next step is to define composite nodes, either to modularise the scheme (Block) or to introduce control structures (Loop, Switch).
437 All the previous definition elements (except for data types) can be put into a Block node.
438 A Block can be created simply by using a bloc tag with a compulsory name attribute, the name of which will be the block name.
439 The next step is to add definitions in this tag to obtain a composite node that is a Block.
441 The following is an example of a Block that uses part of the above example:
446 <inline name="node1" >
448 <code>p1=p1+10</code>
450 <inport name="p1" type="int"/>
451 <outport name="p1" type="int"/>
453 <service name="node4" >
454 <component>ECHO</component>
455 <method>echoDouble</method>
456 <inport name="p1" type="double"/>
457 <outport name="p1" type="double"/>
460 <fromnode>node1</fromnode> <tonode>node4</tonode>
463 <fromnode>node1</fromnode> <fromport>p1</fromport>
464 <tonode>node4</tonode> <toport>p1</toport>
468 This block can now be connected to other nodes like a simple elementary node.
469 A few rules have to be respected:
471 - a control link crossing a block boundary cannot be created
472 - input and output data links crossing the boundary can be created provided that a context sensitive naming system is used (see :ref:`nommage`)
478 A Forloop is defined using a forloop tag. This tag has a compulsory name attribute, the name of which is the node name and an
479 optional nsteps attribute that gives the number of loop iterations to be executed. If this attribute is not specified, the node will
480 use the value given in its input port named nsteps. The forloop tag must contain the definition of one and only one internal node
481 that can be an elementary node or a composite node. Forloops can be nested on several levels, for example. If we would like to have
482 more than one calculation node in the ForLoop, a Block will have to be used as the internal node.
488 <forloop name="l1" nsteps="5">
489 <inline name="node2" >
491 <code>p1=p1+10</code>
493 <inport name="p1" type="int"/>
494 <outport name="p1" type="int"/>
498 This represents a loop that will be executed 5 times on a Python script node.
499 The rules to be respected to create links are the same as for the blocks. To make iterative calculations, it must be possible
500 to connect an output port of an internal node with an input port of this internal node. This is done using a data link that is
501 defined in the context of the Forloop node.
503 The following example applies to looping on port p1:
507 <forloop name="l1" nsteps="5">
508 <inline name="node2" >
510 <code>p1=p1+10</code>
512 <inport name="p1" type="int"/>
513 <outport name="p1" type="int"/>
515 <datalink control="false">
516 <fromnode>node2</fromnode> <fromport>p1</fromport>
517 <tonode>node2</tonode> <toport>p1</toport>
521 If the number of steps in the loop is calculated, the nsteps input port of the loop will be used as in the following example:
527 <code>nsteps=3</code>
529 <outport name="nsteps" type="int"/>
533 <inline name="node2" >
535 <code>p1=p1+10</code>
537 <inport name="p1" type="int"/>
538 <outport name="p1" type="int"/>
543 <fromnode>n</fromnode><fromport>nsteps</fromport>
544 <tonode>l1</tonode> <toport>nsteps</toport>
547 Finally, if the internal node needs to known the current step of the loop it can use the loop output port
554 A WhileLoop is defined using the while tag. It has a single compulsory attribute “name”, that carries the node name.
555 The input port with name “condition” must be connected for the loop to be valid.
557 The following is an example of a While loop that increments the variable p1 until it exceeds the value 40:
563 <inline name="node2" >
565 <code>p1=p1+10</code>
566 <code><![CDATA[condition=p1 < 40.]]> </code>
568 <inport name="p1" type="int"/>
569 <outport name="p1" type="int"/>
570 <outport name="condition" type="bool"/>
572 <datalink control="false">
573 <fromnode>node2</fromnode> <fromport>p1</fromport>
574 <tonode>node2</tonode> <toport>p1</toport>
578 <datalink control="false">
579 <fromnode>l1.b.node2</fromnode> <fromport>condition</fromport>
580 <tonode>l1</tonode> <toport>condition</toport>
583 <tonode>l1.b.node2</tonode> <toport>p1</toport>
584 <value><int>23</int> </value>
587 Obviously, nested while loops can be defined.
593 The ForEach loop is defined using the foreach tag. It has 2 compulsory attributes: name that bears the name of the ForEach
594 node and type that gives the type of elements in the collection on which the loop will iterate. A third optional attribute
595 nbranch is used to fix the number of parallel branches that the loop will manage. If this attribute is not supplied, the input
596 data port of the loop named "nbBranches" must be connected.
597 The foreach tag must contain the definition of one and only one internal node (elementary or composite).
599 The following is a minimal example of the ForEach loop:
603 <inline name="node0" >
605 <code>p1=[i*0.5 for i in range(10)]</code>
607 <outport name="p1" type="dblevec"/>
609 <foreach name="b1" nbranch="3" type="double" >
610 <inline name="node2" >
612 <code>def f(p1):</code>
613 <code> p1= p1+10.</code>
614 <code> print p1</code>
615 <code> return p1</code>
617 <inport name="p1" type="double"/>
618 <outport name="p1" type="double"/>
621 <inline name="node1" >
623 <code>print p1</code>
625 <inport name="p1" type="dblevec"/>
628 <fromnode>node0</fromnode><fromport>p1</fromport>
629 <tonode>b1</tonode> <toport>SmplsCollection</toport>
632 <fromnode>b1</fromnode><fromport>evalSamples</fromport>
633 <tonode>b1.node2</tonode> <toport>p1</toport>
636 <fromnode>b1.node2</fromnode><fromport>p1</fromport>
637 <tonode>node1</tonode> <toport>p1</toport>
640 A first Python script node constructs a list of doubles. This list will be used by the ForEach loop to iterate (connection
641 to the SmplsCollection input port). The internal node of the loop is a Python function node that adds 10 to the element that it processes.
642 Finally, the results are collected and received by the Python node node1 in the form of a list of doubles.
648 A Switch node is defined with the switch tag. It has a single compulsory name attribute that carries the name of the node.
649 Each case is defined with the case sub-tag. The default case is defined with the default sub-tag.
650 The case tag has a compulsory id attribute that must be an integer. The default tag has no attribute.
652 A minimal switch example:
658 <code>select=3</code>
660 <outport name="select" type="int"/>
666 <script><code>print p1</code></script>
667 <inport name="p1" type="double"/>
668 <outport name="p1" type="double"/>
673 <script><code>print p1</code></script>
674 <inport name="p1" type="double"/>
675 <outport name="p1" type="double"/>
680 <control> <fromnode>n</fromnode> <tonode>b1</tonode> </control>
681 <datalink> <fromnode>n</fromnode><fromport>select</fromport>
682 <tonode>b1</tonode> <toport>select</toport> </datalink>
684 <tonode>b1.p3_n2</tonode> <toport>p1</toport>
685 <value><double>54</double> </value>
688 <tonode>b1.default_n2</tonode> <toport>p1</toport>
689 <value><double>54</double> </value>
692 .. _xml_optimizerloop:
696 An OptimizerLoop node is defined with the **optimizer** tag. It has a compulsory name attribute that carries the name of the node.
697 It has two other compulsory attributes (**lib** and **entry**) that define the C++ or Python plugin (parameters with same names).
698 It can have the attribute **nbranch** or an input port **nbBranches** to define the number of branches of the loop.
699 The OptimizerLoop ports (**nbBranches**, **algoInit**, **evalSamples**, **evalResults** and **algoResults**) need not be defined as they
700 are already defined at the creation of the node.
702 A minimal OptimizerLoop example:
706 <optimizer name="b1" nbranch="1" lib="myalgo2.py" entry="async" >
707 <inline name="node2" >
709 <code><![CDATA[print "input node:",p1
713 <inport name="p1" type="double"/>
714 <outport name="p1" type="int"/>
718 <fromnode>b1</fromnode><fromport>evalSamples</fromport>
719 <tonode>b1.node2</tonode> <toport>p1</toport>
721 <datalink control="false" >
722 <fromnode>b1.node2</fromnode><fromport>p1</fromport>
723 <tonode>b1</tonode> <toport>evalResults</toport>
728 Definition of containers
729 --------------------------------
730 YACS containers must be defined immediately after data types have been defined and before calculation nodes are defined.
731 A container is defined using the container tag. This tag has a single compulsory attribute that is the container name.
732 Constraints on placement of the container are specified using properties defined with the property sub-tag.
733 This tag has two compulsory attributes, the name and the value, that give the name of the constraint and its value in the
734 form of a character string.
736 The following is an example of a container defined by the graphic user interface:
740 <container name="DefaultContainer">
741 <property name="container_name" value="FactoryServer"/>
742 <property name="cpu_clock" value="0"/>
743 <property name="hostname" value="localhost"/>
744 <property name="isMPI" value="false"/>
745 <property name="mem_mb" value="0"/>
746 <property name="nb_component_nodes" value="0"/>
747 <property name="nb_node" value="0"/>
748 <property name="nb_proc_per_node" value="0"/>
749 <property name="parallelLib" value=""/>
750 <property name="workingdir" value=""/>
753 Once containers have been defined, SALOME components can be placed on this container.
754 This information simply has to be added into the definition of the SALOME service node using the load sub-tag.
755 This tag has a single compulsory attribute named container that gives the name of the container on which the SALOME component will be located.
757 If the SALOME service defined above is to be placed on the DefaultContainer container, we will write:
761 <service name="node4" >
762 <component>AddComponent</component>
763 <load container="DefaultContainer"/>
765 <inport name="x" type="double"/>
766 <inport name="y" type="double"/>
767 <outport name="FuncValue" type="double"/>
768 <outport name="z" type="double"/>
772 -----------------------------
773 Properties can be defined for all elementary and composite nodes.
774 However, they will only really be useful for SALOME service nodes.
776 A property is defined by adding a property sub-tag in the definition of a node.
777 The property tag has 2 compulsory attributes, name and value, that carry the name of the property and its value in the form of a character string.
779 Example with a SALOME service node:
783 <service name="node4" >
784 <component>AddComponent</component>
786 <property name="VERBOSE" value="2" />
787 <inport name="x" type="double"/>
788 <inport name="y" type="double"/>
789 <outport name="FuncValue" type="double"/>
790 <outport name="z" type="double"/>
793 In the case of a SALOME service node, the property is transmitted to the component and by default is set as an environment variable.
795 .. _xml_active_study:
799 To execute a schema in the context of a SALOME study, you have to set the **DefaultStudyID** property of the schema.
801 Example to execute the schema in the study with studyId 5:
805 <proc name="myschema">
806 <property name="DefaultStudyID" value="5"/>
811 Datastream connections
812 ----------------------------
813 Datastream connections are only possible for SALOME service nodes, as we have seen in :ref:`principes`. Firstly, datastream ports
814 have to be defined in the service node. An input datastream port is defined with the instream subtag.
815 This tag has 2 compulsory attributes, firstly name that gives the port name and secondly type that gives the supported data
816 type (see :ref:`principes` for datastream types).
817 The outstream tag is used instead of the instream tag to define an output datastream port.
818 The property sub-tag is used with its two attributes name and value to define a property associated with the port.
819 See :ref:`calcium` for a list of possible properties.
821 The following gives an example definition of the SALOME service node with datastream ports. It is the DSCCODC component
822 that can be found in the DSCCODES module in the EXAMPLES base. Datastream ports are of the integer type with time dependence.
826 <service name="node1" >
827 <component>DSCCODC</component>
828 <method>prun</method>
829 <inport name="niter" type="int"/>
830 <instream name="ETP_EN" type="CALCIUM_integer">
831 <property name="DependencyType" value="TIME_DEPENDENCY"/>
833 <outstream name="STP_EN" type="CALCIUM_integer">
834 <property name="DependencyType" value="TIME_DEPENDENCY"/>
838 The stream tag is used to define datastream links. Fromnode and fromport sub-tags give the name of the node and the output
839 datastream port that will be connected to the node and to the port, the names of which are given by the tonode and toport sub-tags.
840 The parameters for a datastream link can be set with properties (see :ref:`calcium`).
841 A property is defined with the property sub-tag.
843 The following is a more complete example with parameters set for datastream links. There are two SALOME components with
844 integer type datastream ports with time dependency (TIME_DEPENDENCY).
845 The datastream connections use an explicit time scheme (TI_SCHEM).
849 <service name="node1" >
850 <component>DSCCODC</component>
851 <method>prun</method>
852 <inport name="niter" type="int"/>
853 <instream name="ETP_EN" type="CALCIUM_integer">
854 <property name="DependencyType" value="TIME_DEPENDENCY"/>
856 <outstream name="STP_EN" type="CALCIUM_integer">
857 <property name="DependencyType" value="TIME_DEPENDENCY"/>
861 <service name="node2" >
862 <component>DSCCODD</component>
863 <method>prun</method>
864 <inport name="niter" type="int"/>
865 <instream name="ETP_EN" type="CALCIUM_integer">
866 <property name="DependencyType" value="TIME_DEPENDENCY"/>
868 <outstream name="STP_EN" type="CALCIUM_integer">
869 <property name="DependencyType" value="TIME_DEPENDENCY"/>
874 <fromnode>node2</fromnode> <fromport>STP_EN</fromport>
875 <tonode>node1</tonode> <toport>ETP_EN</toport>
876 <property name="DateCalSchem" value="TI_SCHEM"/>
880 <fromnode>node1</fromnode> <fromport>STP_EN</fromport>
881 <tonode>node2</tonode> <toport>ETP_EN</toport>
882 <property name="DateCalSchem" value="TI_SCHEM"/>
885 Other elementary nodes
886 --------------------------------
888 '''''''''''''''''''''''
889 This type of node is defined with the sinline tag. It has a compulsory attribute name that carries the node name.
890 It is defined using the same sub-tags as for the Python function node: function for the Python code to be executed, inport
891 and outport to define its input and output data ports.
892 The placement on a container is defined using the load sub-tag as for the SALOME service node.
894 The following is an example of a call to the PYHELLO component from a SalomePython node:
898 <sinline name="node1" >
900 <code>import salome</code>
901 <code>salome.salome_init()</code>
902 <code>import PYHELLO_ORB</code>
903 <code>def f(p1):</code>
904 <code> print __container__from__YACS__</code>
905 <code> machine,container=__container__from__YACS__.split('/')</code>
906 <code> param={}</code>
907 <code> param['hostname']=machine</code>
908 <code> param['container_name']=container</code>
909 <code> compo=salome.lcc.LoadComponent(param, "PYHELLO")</code>
910 <code> print compo.makeBanner(p1)</code>
911 <code> print p1</code>
913 <load container="A"/>
914 <inport name="p1" type="string"/>
917 The PYHELLO component will be placed on container A. YACS selects the container. The result of the choice is accessible
918 in the python __container_from_YACS__ variable and is used by the node to load the component using the SALOME LifeCycle.
924 This type of node is defined with the datanode tag. It has a compulsory attribute name that carries the node name.
925 Node data are defined using the parameter sub-tag. This tag has two compulsory attributes, name and type, that give
926 the data name and its type respectively. The initial value of the data is supplied by the value sub-tag of the parameter tag
927 using the XML-RPC coding (see :ref:`initialisation`).
929 The following is an example of a DataIn node that defines two double type data (b and c) and a file type data (f):
934 <parameter name="f" type="file">
935 <value><objref>f.data</objref></value>
937 <parameter name="b" type="double" ><value><double>5.</double></value></parameter>
938 <parameter name="c" type="double" ><value><double>-1.</double></value></parameter>
945 This type of node is defined with the outnode tag. It has a compulsory attribute, name and an optional attribute, ref.
946 The name attribute carries the node name. The ref attribute gives the file name in which the values of results will be saved.
947 The parameter sub-tag is used to define results of the node. This tag has two compulsory attributes, name and type, that
948 give the result name and its type respectively, and one optional attribute, ref.
949 The ref attribute is only useful for file results. If it is defined, the result file will be copied into the file with the
950 name given by the attribute. Otherwise, the file will be a temporary file usually located in the /tmp directory (possibly on a remote machine).
952 The following is an example of a DataOut node that defines 5 results (a, b, c, d, f) of different types (double, int,
953 string, doubles vector, file) and writes the corresponding values in the g.data file.
954 The result file will be copied into the local file myfile:
958 <outnode name="out" ref="g.data">
959 <parameter name="a" type="double" />
960 <parameter name="b" type="int" />
961 <parameter name="c" type="string" />
962 <parameter name="d" type="dblevec" />
963 <parameter name="f" type="file" ref="myfile"/>
970 This type of node is defined as a DataIn node with the datanode tag. All that is necessary is to add the kind attribute
971 with the “study” value. The associated study is given by a property (property tag) named StudyID (the value of which is an integer).
973 The parameter sub-tag will be used to define the node data. This tag has two compulsory attributes, name and type, that give the
974 data name and type respectively. The ref attribute gives the input into the study in the form of a SALOME Entry, or a
975 path in the study tree structure.
977 The following is an example of a StudyIn node that defines 2 data (b and c) with types GEOM_Object and Boolean. It is assumed
978 that SALOME has loaded the study (with StudyID 1) into memory. Data b is referenced by a SALOME Entry.
979 The data c is referenced by a path in the study tree structure.
983 <datanode name="s" kind="study" >
984 <property name="StudyID" value="1" />
985 <parameter name="b" type="GEOM/GEOM_Object" ref="0:1:2:2"/>
986 <parameter name="c" type="bool" ref="/Geometry/Box_1"/>
993 This type of node is defined as a DataOut node with the outnode tag and the name attribute.
994 All that is necessary is to add the kind attribute with the value “study”.
995 The optional ref attribute gives the name of the file in which the study will be saved at the end of the calculation.
996 The associated study is given by a property (property tag) with name StudyID (the value of which is an integer).
998 The parameter sub-tag will be used to define the node results. This tag has two compulsory attributes, name and type, that
999 give the data name and type respectively. The ref attribute gives the entry into the study in the form of a SALOME Entry, or
1000 a path in the study tree structure.
1002 The following gives an example of the StudyOut node that defines 2 results (a and b) of the GEOM_Object type. The study used has
1003 the studyId 1. The complete study is saved in the study1.hdf file at the end of the calculation:
1007 <outnode name="o" kind="study" ref="stud1.hdf">
1008 <property name="StudyID" value="1"/>
1009 <parameter name="a" type="GEOM/GEOM_Object" ref="/Geometry/YacsFuse"/>
1010 <parameter name="b" type="GEOM/GEOM_Object" ref="0:1:1:6"/>