]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Merge V9_dev branch into master
authorrnv <rnv@opencascade.com>
Thu, 7 Jun 2018 12:54:04 +0000 (15:54 +0300)
committerrnv <rnv@opencascade.com>
Thu, 14 Jun 2018 11:58:32 +0000 (14:58 +0300)
27 files changed:
CMakeLists.txt
doc/conf.py.in
doc/resource.rst
doc/schemapy.rst
doc/templates/layout.html [new file with mode: 0644]
src/engine/AbstractPoint.hxx
src/engine/BagPoint.cxx
src/engine/BagPoint.hxx
src/engine/Bloc_impl.cxx
src/engine/ComplexWeight.hxx
src/engine/ElementaryPoint.cxx
src/engine/ElementaryPoint.hxx
src/engine/ForkBlocPoint.cxx
src/engine/ForkBlocPoint.hxx
src/engine/LinkedBlocPoint.cxx
src/engine/LinkedBlocPoint.hxx
src/engine/PlayGround.cxx
src/engine/PointVisitor.hxx [new file with mode: 0644]
src/engine/SetOfPoints.cxx
src/engine/SetOfPoints.hxx
src/engine_swig/engtypemaps.i
src/engine_swig/pilot.i
src/evalyfx/YACSEvalYFXPattern.cxx
src/evalyfx_swig/evalyfx.i
src/evalyfx_swig/test3.py
src/salomegui/resources/SalomeApp.xml.in
src/ydfx_gui/SalomeResourceModel.cxx

index 4a9cad35258f2497fefe56a675f1e20d163f09ee..f865debfad8371f3d707828b625f3e9b521ea3e3 100644 (file)
@@ -33,7 +33,7 @@ ENDIF(WIN32)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index c0d7d0f0b267983621b58040ddddcdd5316c3e1e..e032e175310a3db381c62480eca66c69cc2102c9 100644 (file)
@@ -28,7 +28,7 @@ extensions = ['sphinx.ext.autodoc']
 #extensions = ['rst2pdf.pdfbuilder']
 
 # Add any paths that contain templates here, relative to this directory.
-templates_path = [os.path.join('@CMAKE_CURRENT_SOURCE_DIR@','_templates')]
+templates_path = [os.path.join('@CMAKE_CURRENT_SOURCE_DIR@','templates')]
 
 # The suffix of source filenames.
 source_suffix = '.rst'
index 8a40e38cc1e4c1683426b8719ff896b160c02dc4..06b2ae3d467908c54e3c2df78546f53e8bbede5d 100644 (file)
@@ -1,13 +1,13 @@
 .. _resource:
 
-*******************************************************
+**************************************************
 Concurrent branches and multiple machine execution
-*******************************************************
+**************************************************
 
 .. _concurrent:
 
 Execution of concurrent branches
-===================================
+================================
 YACS can execute calculation nodes of a scheme simultaneously.  
 However, simultaneous execution of a large number of nodes can saturate the system.  
 The maximum number of simultaneous executions can be controlled by fixing the maximum number of threads used with the 
@@ -23,7 +23,7 @@ default value is 1048576 (1MB).
 .. _multi:
 
 Execution on multiple machines
-===================================
+==============================
 YACS can execute the nodes of a scheme on several machines where SALOME is
 already installed.
 Each machine is a resource which has to be declared in the resources catalog
@@ -33,3 +33,55 @@ Every node is executed by a container.
 Containers use a set of constraints and rules for choosing the resource where
 the node will be executed (see :ref:`containers`).
 
+
+.. _multi_HP:
+
+Execution on multiple machines with mutliples HP container types
+================================================================
+
+For a complex graph using multiples HP containers it can be really difficult to determine the best values 
+of pool sizes for each HP container type and the numbers of branchs of the ForEach loops. In order to let Yacs resolves 
+this problem by itself, one can use the Playground feature: ::
+
+   pilot.PlayGround()
+   machineCatalog=[('is2541',8),] # [('machine name', 'nb cores on machine'), ...]
+   pg.setData(machineCatalog)
+   p.fitToPlayGround(pg)
+
+Principle
+---------
+The graph is analyzed and recursively, for all fork, the current domain is equitably divided into sub-domains 
+(one for each sub-branch). A domain of a branch corresponds to the cores from the machine catalog which will be used 
+for the execution of the nodes of this branch. This division in sub-domains assures that one core will be used by at 
+most one container at once, even if it can be used by different HP containers type during the whole execution of a graph.
+
+Once all the domains have been set, the numbers of branchs of the ForEach loops are calculated in order to use the whole domain associated in runtime.
+
+Note: If a branch does not contain any ForEach loop, the size of its domain is reduced to the minimal size.  
+
+Graph with multiples ForEach Loop executed in parallel
+------------------------------------------------------
+In some cases it can be better to dispatch unfairly the computing power between the ForEach Loops. In order to do so it is possible to allocate 
+a weight to the nodes of the graph: ::
+
+   elem_node.setWeight(30.) # means execution time of the node is 30s
+   for_each_loop.setWeight(500.) # means execution time of the whole for each is 500s (exemple: 10 iterations and 50s each)
+   ...
+   p.fitToPlayGround(pg)
+   
+Assuming that the weight corresponds to the execution time of each node during a sequential execution, the algorithm automatically determines, at all fork, 
+the best way to divide the domain into sub-domains in order to minimize the execution time of whole graph.
+
+Explanation: When the computing power allocated to a branch is multiplied by a factor ‘a’, thus weights of all ForEach nodes of this branch 
+are divided by the same factor. Using this the algorithm searchs the best sharing between all branchs at a fork in order the minimize the following 
+parameter: max(for all branchs at the fork: weight of the branch).
+
+Note: 
+
+- If at least one node of a branch does not have a weight, the weight of the branch cannot be calculated and thus its domain receives 1/n of the computing power (n being the number of branchs containing at least one ForEach Loop at this fork point).
+- The weight does not have a unit. Any can be used.
+- The calculation of the weight of a whole branch is not recursive. It is the sum of the weight of all its elementary and ForEach nodes (but as seen previously the sharing is done recursively).
+
+
+
index fa2ded1fcef66b832cfd26c64403156fb9507366..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,17 @@ 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::
diff --git a/doc/templates/layout.html b/doc/templates/layout.html
new file mode 100644 (file)
index 0000000..bb9325f
--- /dev/null
@@ -0,0 +1,11 @@
+{% extends "!layout.html" %}
+
+{%- block sidebarlogo %}
+{{ super() }}
+{%-
+include "searchbox.html"
+%}
+<p/>
+{%- endblock %}
+{%- block sidebarsearch %}
+{%- endblock %}
\ No newline at end of file
index 2aceabfdfd03ac02505746ab48b4693c50293dc4..e75f07739ada0e4f0cb2e5ae583a52ad2421a68f 100644 (file)
@@ -39,6 +39,7 @@ namespace YACS
     class BlocPoint;
     class ComposedNode;
     class ForkBlocPoint;
+    class PointVisitor;
     class LinkedBlocPoint;
     
     class YACSLIBENGINE_EXPORT AbstractPoint
@@ -70,6 +71,7 @@ namespace YACS
       virtual void getWeightRegardingDPL(ComplexWeight *weight) = 0;
       virtual void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const = 0;
       virtual std::string getRepr() const = 0;
+      virtual void accept(PointVisitor *pv) = 0;
       virtual ~AbstractPoint();
     public:
       static bool IsGatherB4Ext(Node *node);
index 2492813dfefd7c27bfbbce2256bcbc05b15b52cb..c27ba442670f930b01b0ebf101fb7ad640573cf0 100644 (file)
@@ -64,6 +64,16 @@ AbstractPoint *BagPoint::getUniqueAndReleaseIt()
   return ret;
 }
 
+void BagPoint::accept(PointVisitor *pv)
+{
+  if(_nodes.size()!=1)
+    throw YACS::Exception("BagPoint::accept : simplification has failed !");
+  AbstractPoint *ret(*_nodes.begin());
+  if(!ret)
+    throw YACS::Exception("BagPoint::accept : Ooops !");
+  ret->accept(pv);
+}
+
 Node *BagPoint::getFirstNode()
 {
   return getUnique()->getFirstNode();
index 9e97acd25b72ca8c89c25da834410f75b0679317..b45cece9b597c578d2821a5894486a574b8d91a8 100644 (file)
@@ -41,6 +41,7 @@ namespace YACS
       void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const;
       std::string getRepr() const;
       AbstractPoint *getUniqueAndReleaseIt();
+      void accept(PointVisitor *pv) override;
     public:
       int size() const { return (int)_nodes.size(); }
       void replaceInMe(BlocPoint *aSet);
index 1a5ed1f72c64e6c63ec572843fee2514e7bc60d9..00ceff892bdf201b308e96d74709a7b4bef31347 100644 (file)
@@ -91,6 +91,8 @@ void Bloc::fitToPlayGround(const PlayGround *pg)
   for(std::list<ForEachLoop *>::const_iterator it=vis._fes.begin();it!=vis._fes.end();it++)
     (*it)->edGetNbOfBranchesPort()->edInit(1);
   this->removeRecursivelyRedundantCL();
+  if (this->getMaxLevelOfParallelism() > pg->getNumberOfCoresAvailable())
+    throw YACS::Exception("Bloc::fitToPlayGround : Not enough cores available to run the calculation !");
   this->partitionRegardingDPL(pd,zeMap);
   this->accept(&vis);
   for(std::list<ForEachLoop *>::const_iterator it=vis._fes.begin();it!=vis._fes.end();it++)
index 872fe0f458ce79b23268e8845dad0b9b5eb97a8e..e8bb55c32534723c6fbb2520f4baf742ca263025 100644 (file)
@@ -52,7 +52,7 @@ namespace YACS
       ComplexWeight& addWeight(const ComplexWeight *other);
     protected:
       bool _bootWeight;
-      // _loopWeight: vect<pair(weight,nbcorePerIteration)>, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight
+      // _loopWeight: vect<pair(weight,nbcorePerIteration)>, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight (means no loop inside)
       std::vector<std::pair<double,int> > _loopWeight; 
       double _elementaryWeight;
     private:
index 7d161b9c2952cf7ec2a2813a8049d944a56409a3..72dd58c3531b0a0394ecbce56af6156effe8c95a 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include "ElementaryPoint.hxx"
+#include "PointVisitor.hxx"
 #include "Node.hxx"
 
 using namespace YACS::ENGINE;
@@ -73,3 +74,9 @@ std::string ElementaryPoint::getRepr() const
 {
   return _node->getName();
 }
+
+void ElementaryPoint::accept(PointVisitor *pv)
+{
+  pv->beginElementaryPoint(this);
+  pv->endElementaryPoint(this);
+}
index f5ac56538e2d397ee3bb1b13fc18da4b492859b6..559a92c99739b189c91a9aca3e6085b060d71d83 100644 (file)
@@ -46,6 +46,7 @@ namespace YACS
       void getWeightRegardingDPL(ComplexWeight *weight);
       void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const;
       std::string getRepr() const;
+      void accept(PointVisitor *pv) override;
       virtual ~ElementaryPoint();
     };
   }
index 8b8768f1c3813308fd7424a86e096a3b2bac9dd7..5234cecf379046f35e8b55a4450c369f6683d635 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include "ForkBlocPoint.hxx"
+#include "PointVisitor.hxx"
 #include "Exception.hxx"
 
 #include <algorithm>
@@ -109,3 +110,11 @@ std::string ForkBlocPoint::getRepr() const
   ret+="]";
   return ret;
 }
+
+void ForkBlocPoint::accept(PointVisitor *pv)
+{
+  pv->beginForkBlocPoint(this);
+  for(auto it:_nodes)
+    it->accept(pv);
+  pv->endForkBlocPoint(this);
+}
index 2c347caf21aebb1620b028247fd926ef89f418e3..067155d808bce7e0eec98b8c459f0d95ce653d4d 100644 (file)
@@ -37,6 +37,7 @@ namespace YACS
       void getWeightRegardingDPL(ComplexWeight *weight);
       void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const;
       std::string getRepr() const;
+      void accept(PointVisitor *pv) override;
       virtual ~ForkBlocPoint();
     };
   }
index b4d2e7f2f116193d763a731d33de19a433b20565..e9c32e8f5b69c8606a37dda1cfed25e0b5331e5f 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include "LinkedBlocPoint.hxx"
+#include "PointVisitor.hxx"
 #include "Exception.hxx"
 
 using namespace YACS::ENGINE;
@@ -79,6 +80,14 @@ std::string LinkedBlocPoint::getRepr() const
   return ret;
 }
 
+void LinkedBlocPoint::accept(PointVisitor *pv)
+{
+  pv->beginLinkedBlocPoint(this);
+  for(auto it:_nodes)
+    it->accept(pv);
+  pv->endLinkedBlocPoint(this);
+}
+
 LinkedBlocPoint::~LinkedBlocPoint()
 {
 }
index 3491ed40712fdf281faef1d4299b50f27bf015a3..d0f5f20ac1144d7afd02fbbe1ceedb0dd982ee67 100644 (file)
@@ -39,6 +39,7 @@ namespace YACS
       void getWeightRegardingDPL(ComplexWeight *weight);
       void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const;
       std::string getRepr() const;
+      void accept(PointVisitor *pv) override;
       virtual ~LinkedBlocPoint();
     };
   }
index f28047937e3d563cc4a8445909fbc500ded85041..883a8b6d1fe230efd1b212e7107aa0cb59580848 100644 (file)
@@ -266,7 +266,7 @@ std::vector< std::vector<int> > PlayGround::splitIntoParts(const std::vector<int
         }
       else if (!(*it).first->hasValidLoopWeight())
         {
-          nbOfCoresAllocated[i]=(int)((double)totalSpace/(double)(sz)); // branch with undefined weight
+          nbOfCoresAllocated[i]=std::max((int)((double)totalSpace/(double)(sz)), nbCoresPerShot[i]); // branch with undefined weight, takes his part proportionnally to the number of branchs
         }
       else
         {
diff --git a/src/engine/PointVisitor.hxx b/src/engine/PointVisitor.hxx
new file mode 100644 (file)
index 0000000..9d9b17f
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright (C) 2015-2016  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "YACSlibEngineExport.hxx"
+
+namespace YACS
+{
+  namespace ENGINE
+  {
+    class ElementaryPoint;
+    class LinkedBlocPoint;
+    class ForkBlocPoint;
+    
+    class YACSLIBENGINE_EXPORT PointVisitor
+    {
+    public:
+      virtual void beginForkBlocPoint(ForkBlocPoint *pt) = 0;
+      virtual void endForkBlocPoint(ForkBlocPoint *pt) = 0;
+      virtual void beginLinkedBlocPoint(LinkedBlocPoint *pt) = 0;
+      virtual void endLinkedBlocPoint(LinkedBlocPoint *pt) = 0;
+      virtual void beginElementaryPoint(ElementaryPoint *pt) = 0;
+      virtual void endElementaryPoint(ElementaryPoint *pt) = 0;
+    };
+  }
+}
index 76f892577b9db0403fa5aaf0eae719728446d1d6..f7b229088c175397c334c071ac65b6ffd7974b7a 100644 (file)
@@ -101,3 +101,8 @@ AbstractPoint *SetOfPoints::getUniqueAndReleaseIt() const
 {
   return _bp->getUniqueAndReleaseIt();
 }
+
+void SetOfPoints::accept(PointVisitor *pv)
+{
+  _bp->accept(pv);
+}
index bc29934b0d56dbc94af04bbcb9c9113394237854..11e07eeef2d765255f0e666162c30e1afee96831 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "YACSlibEngineExport.hxx"
 #include "PlayGround.hxx"
+#include "PointVisitor.hxx"
 #include "AutoRefCnt.hxx"
 
 #include <map>
@@ -50,6 +51,7 @@ namespace YACS
       void getWeightRegardingDPL(ComplexWeight *weight);
       void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap) const;
       AbstractPoint *getUniqueAndReleaseIt() const;
+      void accept(PointVisitor *pv);
     private:
       BagPoint *_bp;
     };
index 0771a1c7eedd893b1011b732dd869ed38b0abaae..39279352f4db1d07af9c39abb51e876b91d771c1 100644 (file)
@@ -477,6 +477,28 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
     }
 }
 
+%typemap(in) const std::list<YACS::ENGINE::Node *>& 
+{
+  if(!PyList_Check($input))
+    {
+      PyErr_SetString(PyExc_TypeError,"not a list");
+      return NULL;
+    }
+  $1=new std::list<YACS::ENGINE::Node *>;
+  int size(PyList_Size($input));
+  for(int i=0;i<size;i++)
+    {
+      PyObject *o=PyList_GetItem($input,i);
+      YACS::ENGINE::Node *temp(nullptr);
+      if((SWIG_ConvertPtr(o,(void **)&temp, $descriptor(YACS::ENGINE::Node*),0)) == -1)
+        {
+          PyErr_SetString(PyExc_TypeError,"not a YACS::ENGINE::TypeCode*");
+          return nullptr;
+        }
+      $1->push_back(temp);
+    }
+}
+
 %typemap(out) YACS::ENGINE::Node*
 {
   $result=convertNode($1,$owner);
@@ -655,6 +677,22 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
   }
 }
 
+%typemap(out) std::vector< std::list<YACS::ENGINE::Node *> >
+{
+  std::vector< std::list<YACS::ENGINE::Node *> >::const_iterator it;
+  $result = PyList_New($1.size());
+  int i(0);
+  for (it = $1.begin(); it != $1.end(); ++it, ++i)
+    {
+      const std::list<YACS::ENGINE::Node *>& elt(*it);
+      PyObject *tmp(PyList_New(elt.size()));
+      int j(0);
+      for (auto it2=elt.begin() ; it2!= elt.end() ; ++it2, ++j)
+        PyList_SetItem(tmp,j,convertNode(*it2));
+      PyList_SetItem($result,i,tmp);
+    }
+}
+
 #endif
 
 // ----------------------------------------------------------------------------
index fbd2572d73221dfb66ec071146e82e29bd609bb1..642fb3518fc696bd23e95a5ee67d8fb415e65f6e 100644 (file)
 #include "ComponentInstance.hxx"
 #include "DataNode.hxx"
 #include "PlayGround.hxx"
+#include "SetOfPoints.hxx"
+#include "PointVisitor.hxx"
+#include "ForkBlocPoint.hxx"
+#include "LinkedBlocPoint.hxx"
+#include "ElementaryPoint.hxx"
   
 using namespace YACS::ENGINE;
 
@@ -525,3 +530,118 @@ EXCEPTION(YACS::ENGINE::ExecutorSwig::waitPause)
     self->assignPassedResults(passedIds,passedOutputsCpp,nameOfOutputs);
   }
 }
+
+namespace YACS
+{
+  namespace ENGINE
+  {
+    class AbstractPoint
+    {
+    protected:
+      virtual ~AbstractPoint();
+      AbstractPoint();
+      AbstractPoint(const AbstractPoint&);
+    };
+
+    class ElementaryPoint : public AbstractPoint
+    {
+    public:
+      Node *getFirstNode();
+    private:
+      ~ElementaryPoint();
+      ElementaryPoint();
+      ElementaryPoint(const ElementaryPoint&);
+    };
+
+    class BlocPoint : public AbstractPoint
+    {
+    protected:
+      ~BlocPoint();
+      BlocPoint();
+      BlocPoint(const BlocPoint&);
+    };
+
+    class LinkedBlocPoint : public BlocPoint
+    {
+    private:
+      ~LinkedBlocPoint();
+      LinkedBlocPoint();
+      LinkedBlocPoint(const LinkedBlocPoint&);
+    };
+
+    class ForkBlocPoint : public BlocPoint
+    {
+    private:
+      ~ForkBlocPoint();
+      ForkBlocPoint();
+      ForkBlocPoint(const ForkBlocPoint&);
+    };
+    
+    class SetOfPoints
+    {
+    public:
+      SetOfPoints(const std::list<Node *>& nodes);
+      ~SetOfPoints();
+      void simplify();
+      std::string getRepr() const;
+      %extend
+      {
+      void accept(PyObject *pv)
+      {
+        class MyPointVisitor : public YACS::ENGINE::PointVisitor
+        {
+        public:
+          MyPointVisitor(PyObject *py):_py(py) { }
+          void beginForkBlocPoint(ForkBlocPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ForkBlocPoint,0));
+            PyObject *meth(PyString_FromString("beginForkBlocPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+          void endForkBlocPoint(ForkBlocPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ForkBlocPoint,0));
+            PyObject *meth(PyString_FromString("endForkBlocPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+          void beginLinkedBlocPoint(LinkedBlocPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__LinkedBlocPoint,0));
+            PyObject *meth(PyString_FromString("beginLinkedBlocPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+          void endLinkedBlocPoint(LinkedBlocPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__LinkedBlocPoint,0));
+            PyObject *meth(PyString_FromString("endLinkedBlocPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+          void beginElementaryPoint(ElementaryPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ElementaryPoint,0));//$descriptor(YACS::ENGINE::ElementaryPoint *)
+            PyObject *meth(PyString_FromString("beginElementaryPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+          void endElementaryPoint(ElementaryPoint *pt)
+          {
+            PyObject *ptPy(SWIG_NewPointerObj((void*)pt,SWIGTYPE_p_YACS__ENGINE__ElementaryPoint,0));
+            PyObject *meth(PyString_FromString("endElementaryPoint"));
+            PyObject *ret(PyObject_CallMethodObjArgs(_py,meth,ptPy,nullptr));
+            Py_XDECREF(ret); Py_XDECREF(meth); Py_XDECREF(ptPy);
+          }
+        private:
+          PyObject *_py;
+        };
+        MyPointVisitor mpv(pv);
+        self->accept(&mpv);
+        }
+      }
+    };
+  }
+}
+
index 2dba76814e942a1d7c8e182c8e0ebb57a56873ec..0b4b7ddeff03246eeded5bcce9215fe92b5f7607 100644 (file)
@@ -911,7 +911,7 @@ void YACSEvalYFXGraphGenCluster::generateGraph()
     void addOutputVar(const std::string& name) { n2Script<< name << ", "; }
     void assignOutput(YACS::ENGINE::InlineNode *node) {
       n2Script << "]\nwith open(\"" << _jobName << "\",\"w\") as f:" << std::endl;
-      n2Script << "  f.write(str(zeRes))" << std::endl;
+      n2Script << "  f.write(repr(zeRes))" << std::endl;
       node->setScript(n2Script.str());
     }
   private:
index 6796ada923dc5815e2b5da6d8dbfaa1c822e871c..df126350dec1ab6fa5b976332bf6ec47c7a789dc 100644 (file)
@@ -393,6 +393,7 @@ public:
   YACSEvalSession();
   ~YACSEvalSession();
   void launch();
+  void launchUsingCurrentSession();
   bool isLaunched() const;
   bool isAttached() const;
   bool isAlreadyPyThreadSaved() const;
index 73092faab4a84f56caa13fdee0a1e8ecb0da566d..c54ab2cdf11ae942011d89ab3c64ffc7a0e4c88e 100644 (file)
@@ -66,7 +66,7 @@ efx.lockPortsForEvaluation(inps,outps)
 rss=efx.giveResources()
 rss[0][0].setWantedMachine("athos")
 cp=rss.getAddParamsForCluster() ; cp.setRemoteWorkingDir(os.path.join("/scratch",getpass.getuser(),"TMP3")) ; cp.setLocalWorkingDir(os.path.join(os.path.expanduser("~"),"TMP52"))
-cp.setWCKey("P11U50:CARBONES") ; cp.setNbProcs(5) ; cp.setMaxDuration("00:05")
+cp.setWCKey("P11U5:CARBONES") ; cp.setNbProcs(5) ; cp.setMaxDuration("00:05")
 assert(not rss.isInteractive())
 a,b=efx.run(session)
 print(("************",a,b))
index 3dd1fafffa10cf868414cf7453822fc9b78536f7..0d302ab6fcf539043f309b2543db98fc28bc6d8b 100644 (file)
@@ -31,9 +31,8 @@
     <parameter name="YACS" value="%YACS_ROOT_DIR%/share/salome/resources/yacs"/>
   </section>
   <section name="yacs_help">
-    <parameter name="sub_menu"     value="%1 module"/>
-    <parameter name="User's Guide" value="%YACS_ROOT_DIR%/share/doc/salome/gui/YACS/index.html"/>
-    <parameter name="Developer's Guide" value="%YACS_ROOT_DIR%/share/doc/salome/tui/YACS/index.html"/>
+    <parameter name="User's Guide/YACS module" value="%YACS_ROOT_DIR%/share/doc/salome/gui/YACS/index.html"/>
+    <parameter name="Developer's Guide/YACS module" value="%YACS_ROOT_DIR%/share/doc/salome/tui/YACS/index.html"/>
   </section>
   <section name="YACS" >
     <!-- Module preferences -->
index dc2bcdbb5746c9b2d630c43d870d9df7a5f57a3d..7162df50a9d844d96638088ebedea757d0422418 100644 (file)
@@ -10,7 +10,7 @@ SalomeResourceModel::SalomeResourceModel()
   _nbProcs(1),
   _hours(0),
   _minutes(5),
-  _wcKey("P11U50:CARBONES"),
+  _wcKey("P11U5:CARBONES"),
   _localDirectory("/tmp"),
   _remoteDirectory("/tmp"),
   _parallelizeStatus(true),