Salome HOME
bos #26458 Versioning of sources via git commit id (sha1)
[modules/yacs.git] / doc / schemapy.rst
index c4d4598ea859ebf6ed5c34321d6e2d6ac1f6a686..f9454197ef8e239b0b6dd0e31f2ae0213eba68d9 100644 (file)
@@ -256,6 +256,9 @@ and to assign a container (see :ref:`py_container` to define a container) to the
   n.setExecutionMode("remote")
   n.setContainer(cont1)
 
+The default option for the execution mode is **local** where the node will run
+on the same container as the scheme executor.
+
 .. _pyfunc:
 
 Python function node
@@ -281,6 +284,9 @@ and to assign a container (see :ref:`py_container` to define a container) to the
   n2.setExecutionMode("remote")
   n2.setContainer(cont1)
 
+The default option for the execution mode is **local** where the node will run
+on the same container as the scheme executor.
+
 .. _pyservice:
 
 SALOME service node
@@ -605,19 +611,15 @@ is defined by the class async in the python module myalgo2.py::
 
 Definition of containers
 ''''''''''''''''''''''''''''
-A container is defined using the runtime createContainer method and it is then given a name using its setName method.  
-The next step is to assign constraints to it by adding properties.  
-The following is an example creation of a container named “A”::
 
-  c1=r.createContainer()
-  c1.setName("A")
+This example shows how to add a container to a scheme::
+
+  c1=p.createContainer("MyContainer")
 
 A property is added to a container using its setProperty method that uses 2 arguments (character strings).  
 The first is the property name.  The second is its value.  
-The following is an example of this container “A” with constraints::
+The following is an example of how to set constraints on the container::
 
-  c1=r.createContainer()
-  c1.setName("A")
   c1.setProperty("container_name","FactoryServer")
   c1.setProperty("hostname","localhost")
   c1.setProperty("mem_mb","1000")
@@ -626,10 +628,27 @@ Once the containers have been defined, SALOME components can be placed on this c
 of a SALOME service node is to obtain the component instance of this service node using the getComponent method for this node.  
 The previously defined container is then assigned to this component instance using the setContainer method of the component instance.
 
-If it is required to place the SALOME service defined above (node “node3”) on container “A”, we will write::
+If it is required to place the SALOME service defined above (node “node3”) on
+“MyContainer”, we will write::
 
   n3.getComponent().setContainer(c1)
 
+It is also possible to place python nodes on containers, but the code is a
+little different (see :ref:`pyscript`)::
+
+  n1.setExecutionMode("remote")
+  n1.setContainer(c1)
+
+Since SALOME v7.5, there is a new type of container:
+*Homogeneous Pool of SALOME containers* (HP container).
+It is possible to create this type of container this way::
+
+   my_hp_cont=r.createContainer("MyHPCont","HPSalome")
+
+- "MyHPCont" : name of the container. Same result as my_hp_cont.setName("MyHPCont").
+- "HPSalome" : type of container. Possible values are "HPSalome" (for a HP container)
+  or "Salome" (for a classic container).
+
 Node properties
 '''''''''''''''''''''''''''
 A property is added to an elementary or composite node (or is modified) using its setProperty method that has two 
@@ -761,19 +780,17 @@ The result file will be copied into the local file myfile::
 StudyIn node
 ++++++++++++++
 A StudyIn node is defined using the runtime createInDataNode method.  It uses two arguments, the first of which must be “study” 
-and the second the node name.  The associated study is specified by adding the “StudyID” property to the node using 
-its setProperty method.  Node data are defined by adding output data ports using the edAddOutputPOrt method, transferring 
+and the second the node name.  Node data are defined by adding output data ports using the edAddOutputPOrt method, transferring 
 the name of the data and its type as arguments.  The data is initialised with the reference in the study, using the setData method 
 for the port thus created, transferring a character string to it containing either the SALOME Entry or the path in the study 
 tree structure.
 
 The following is an example of the StudyIn node that defines 2 GEOM_Object type data (a and b).  The study is assumed to be 
-loaded into memory by SALOME as StudyID 1.  Data a is referenced by one SALOME Entry.  Data b is referenced by a path in the 
+loaded into memory by SALOME.  Data a is referenced by one SALOME Entry.  Data b is referenced by a path in the 
 study tree structure::
 
   n=r.createInDataNode("study","study1")
   p.edAddChild(n)
-  n.setProperty("StudyID","1")
   pout=n.edAddOutputPort('a',tgeom)
   pout.setData("0:1:1:1")
   pout=n.edAddOutputPort('b',tgeom)
@@ -784,21 +801,19 @@ study tree structure::
 StudyOut node
 ++++++++++++++
 A StudyOut node is defined using the runtime createOutDataNode method.  It uses two arguments, the first of 
-which must be “study” and the second the node name.  The associated study is specified by adding 
-the “StudyID” property to the node using its setProperty method.  The name of the file in which the study will be 
+which must be “study” and the second the node name. The name of the file in which the study will be 
 saved is specified using the node SetRef method with the file name as an argument.  
 The node results are defined by adding input data ports to it using the edAddInputPort method, transferring the data name 
 and type as arguments.  The setData method for the port is used to associate the entry into the study to the result, transferring 
 a character string to it that contains either the SALOME Entry or the path in the study tree structure.
 
 The following contains an example of the StudyOut node that defines two GEOM_Object type results (a and b).  
-The studyId of the study used is 1.  Result a is referenced by a SALOME Entry.  The result b is referenced by a path.  
+Result a is referenced by a SALOME Entry.  The result b is referenced by a path.  
 The complete study is saved in the study1.hdf file at the end of the calculation::
 
   n=r.createOutDataNode("study","study2")
   n.setRef("study1.hdf")
   p.edAddChild(n)
-  n.setProperty("StudyID","1")
   pout=n.edAddInputPort('a',tgeom)
   pout.setData("0:1:2:1")
   pout=n.edAddInputPort('b',tgeom)