Salome HOME
Roll back for the keepgoing feature.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 16 Mar 2017 15:45:08 +0000 (16:45 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 16 Mar 2017 15:45:08 +0000 (16:45 +0100)
14 files changed:
src/engine/Bloc.cxx
src/engine/Bloc.hxx
src/engine/ComposedNode.cxx
src/engine/ComposedNode.hxx
src/engine/DynParaLoop.cxx
src/engine/DynParaLoop.hxx
src/engine/Executor.cxx
src/engine/ForEachLoop.cxx
src/engine/ForEachLoop.hxx
src/engine/OptimizerLoop.cxx
src/engine/OptimizerLoop.hxx
src/engine/Scheduler.hxx
src/yacsloader/LoadState.hxx
src/yacsloader_swig/loader.i

index 514d88ff023fec5c495cb3a981e6aaa029e2c2d0..7d5e7b0450360a06e3ab9b2a15e73dd3ae827418 100644 (file)
@@ -403,7 +403,7 @@ YACS::Event Bloc::updateStateOnFinishedEventFrom(Node *node)
  * \param node : node that has emitted the event
  * \return the event to notify to bloc's father
  */
-YACS::Event Bloc::updateStateOnFailedEventFrom(Node *node)
+YACS::Event Bloc::updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
 {
   node->exForwardFailed();
   if(areAllSubNodesFinished())
index 23ceabdad66c6693a3ff4215d556ba787c946181..3cfec917263b5eab4445c9a4d2530a135dca5d40 100644 (file)
@@ -69,7 +69,7 @@ namespace YACS
       void checkNoCyclePassingThrough(Node *node) throw(Exception);
       std::vector< std::pair<OutGate *, InGate *> > getSetOfInternalCFLinks() const;
       YACS::Event updateStateOnFinishedEventFrom(Node *node);
-      YACS::Event updateStateOnFailedEventFrom(Node *node);
+      YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);
       void initComputation() const;
       void performCFComputationsOnlyOneLevel(LinkInfo& info) const;
       void performCFComputations(LinkInfo& info) const;
index bbc28e56d2a11630054e0ee33b8ac66a566cbeb7..e27e72da6f26f18cdf03653757558aea777090da 100644 (file)
@@ -241,7 +241,8 @@ std::vector<Task *> ComposedNode::getNextTasks(bool& isMore)
  * Calls ComposedNode::updateStateFrom to update state from task to root node
  */
 void ComposedNode::notifyFrom(const Task *sender, //* I : task emitting event
-                              YACS::Event event   //* I : event emitted
+                              YACS::Event event,  //* I : event emitted
+                              const Executor *execInst
                               )
 {
   DEBTRACE("ComposedNode::notifyFrom " << event);
@@ -251,12 +252,12 @@ void ComposedNode::notifyFrom(const Task *sender, //* I : task emitting event
   ComposedNode *curLevelNode=taskTyped->_father;
   if(!curLevelNode)//Specific case of loop when 0 turn is specified without any enclosing bloc.
     return ;
-  curEvent=curLevelNode->updateStateFrom(lminus1LevelNode,curEvent);
+  curEvent=curLevelNode->updateStateFrom(lminus1LevelNode,curEvent,execInst);
   while(curEvent!=YACS::NOEVENT && curLevelNode!=this)
     {
       lminus1LevelNode=curLevelNode;
       curLevelNode=curLevelNode->_father;
-      curEvent=curLevelNode->updateStateFrom(lminus1LevelNode,curEvent);
+      curEvent=curLevelNode->updateStateFrom(lminus1LevelNode,curEvent,execInst);
     }
 }
 
@@ -1375,7 +1376,8 @@ OutputDataStreamPort *ComposedNode::getOutputDataStreamPort(const std::string& n
  * Called by ComposedNode::notifyFrom
  */
 YACS::Event ComposedNode::updateStateFrom(Node *node,        //* I : node emitting event
-                                          YACS::Event event  //* I : event emitted
+                                          YACS::Event event, //* I : event emitted
+                                          const Executor *execInst
                                           )
 {
   DEBTRACE("updateStateFrom: " << node->getName() << " " << event);
@@ -1390,7 +1392,7 @@ YACS::Event ComposedNode::updateStateFrom(Node *node,        //* I : node emitti
           return updateStateOnFinishedEventFrom(node);
           break;
         case YACS::ABORT:
-          return updateStateOnFailedEventFrom(node);
+          return updateStateOnFailedEventFrom(node,execInst);
           break;
         default:
           return YACS::NOEVENT;//TODO unexpected type of event
@@ -1432,7 +1434,7 @@ YACS::Event ComposedNode::updateStateOnStartEventFrom(Node *node)
 }
 
 //! Method used to notify the node that a child node has failed
-YACS::Event ComposedNode::updateStateOnFailedEventFrom(Node *node)
+YACS::Event ComposedNode::updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
 {
    setState(YACS::FAILED);
    return YACS::ABORT;
index 82685ef6fa154f02a140196e4af25505bd7f85a8..013950a7ff1a7d558c5ed69dd39cac381c5efb96 100644 (file)
@@ -64,7 +64,7 @@ namespace YACS
       DeploymentTree checkDeploymentTree(bool deep) const throw(Exception);
       std::vector<Task *> getNextTasks(bool& isMore);
       virtual bool isPlacementPredictableB4Run() const = 0;
-      void notifyFrom(const Task *sender, YACS::Event event);
+      void notifyFrom(const Task *sender, YACS::Event event, const Executor *execInst);
       bool edAddLink(OutPort *start, InPort *end) throw(Exception);
       virtual bool edAddDFLink(OutPort *start, InPort *end) throw(Exception);
       //Node* DISOWNnode is a SWIG notation to indicate that the ownership of the node is transfered to C++
@@ -136,10 +136,10 @@ namespace YACS
       static bool splitNamesBySep(const std::string& globalName, const char separator[],
                                   std::string& firstPart, std::string& lastPart, bool priority) throw(Exception);
       virtual Node *getChildByShortName(const std::string& name) const throw(Exception) = 0;
-      YACS::Event updateStateFrom(Node *node, YACS::Event event);//update the state of this. Precondition : node->_father == this
+      YACS::Event updateStateFrom(Node *node, YACS::Event event, const Executor *execInst);//update the state of this. Precondition : node->_father == this
       virtual YACS::Event updateStateOnStartEventFrom(Node *node);//transition 3 doc P.R
       virtual YACS::Event updateStateOnFinishedEventFrom(Node *node) = 0;//transition 9 doc P.R.
-      virtual YACS::Event updateStateOnFailedEventFrom(Node *node);//transition 9 doc P.R.
+      virtual YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);//transition 9 doc P.R.
       virtual void checkLinkPossibility(OutPort *start, const std::list<ComposedNode *>& pointsOfViewStart,
                                         InPort *end, const std::list<ComposedNode *>& pointsOfViewEnd) throw(Exception);
       virtual void buildDelegateOf(InPort * & port, OutPort *initialStart, const std::list<ComposedNode *>& pointsOfView);
index 996e6625ccbf518cd0631cb0fb1172eb9dfe54a6..cca32828ba0ac1aaf2709accbc8a631a5895b0a8 100644 (file)
@@ -696,7 +696,7 @@ void DynParaLoop::forwardExecStateToOriginalBody(Node *execNode)
  *  \param node : the child node that has failed
  *  \return the state change
  */
-YACS::Event DynParaLoop::updateStateOnFailedEventFrom(Node *node)
+YACS::Event DynParaLoop::updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
 {
   DEBTRACE("DynParaLoop::updateStateOnFailedEventFrom " << node->getName());
   setState(YACS::FAILED);
index 7160e761b5322015696f1fe2f382ab5382e4206b..c00a5e8c599b312701831277f9c09bbcbeafe25e 100644 (file)
@@ -124,7 +124,7 @@ namespace YACS
       TypeOfNode getIdentityOfNotifyerNode(const Node *node, unsigned& id);
       InputPort *getDynInputPortByAbsName(int branchNb, const std::string& name, bool initNodeAdmitted);
       virtual void forwardExecStateToOriginalBody(Node *execNode);
-      virtual YACS::Event updateStateOnFailedEventFrom(Node *node);
+      virtual YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);
       std::vector<Node *> cloneAndPlaceNodesCoherently(const std::vector<Node *> & origNodes);
       Node * checkConsistencyAndSetNode(Node* &nodeToReplace, Node* DISOWNnode);
       Node * removeNode(Node* &nodeToRemove);
index 3fe2336838fb1fc092aa15dcefaf35996609829a..c5e7c7b45e71cd4ae6e6c5d21ee318fe42f46c29 100644 (file)
@@ -829,7 +829,7 @@ void Executor::loadTask(Task *task, const Executor *execInst)
   traceExec(task, "state:TOLOAD", ComputePlacement(task));
   {//Critical section
     YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
-    _mainSched->notifyFrom(task,YACS::START);
+    _mainSched->notifyFrom(task,YACS::START,execInst);
   }//End of critical section
   try
     {
@@ -844,7 +844,7 @@ void Executor::loadTask(Task *task, const Executor *execInst)
       {//Critical section
         YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
         task->aborted();
-        _mainSched->notifyFrom(task,YACS::ABORT);
+        _mainSched->notifyFrom(task,YACS::ABORT,execInst);
         traceExec(task, "state:"+Node::getStateName(task->getState()), ComputePlacement(task));
       }//End of critical section
     }
@@ -854,7 +854,7 @@ void Executor::loadTask(Task *task, const Executor *execInst)
       {//Critical section
         YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
         task->aborted();
-        _mainSched->notifyFrom(task,YACS::ABORT);
+        _mainSched->notifyFrom(task,YACS::ABORT,execInst);
         traceExec(task, "state:"+Node::getStateName(task->getState()), ComputePlacement(task));
       }//End of critical section
     }
@@ -927,7 +927,7 @@ void Executor::launchTasks(const std::vector<Task *>& tasks)
           {//Critical section
             YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
             (*iter)->aborted();
-            _mainSched->notifyFrom(*iter,YACS::ABORT);
+            _mainSched->notifyFrom(*iter,YACS::ABORT,this);
           }//End of critical section
         }
       catch(...) 
@@ -946,7 +946,7 @@ void Executor::launchTasks(const std::vector<Task *>& tasks)
           {//Critical section
             YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
             (*iter)->aborted();
-            _mainSched->notifyFrom(*iter,YACS::ABORT);
+            _mainSched->notifyFrom(*iter,YACS::ABORT,this);
           }//End of critical section
         }
       if((*iter)->getState() == YACS::ERROR)
@@ -972,7 +972,7 @@ void Executor::launchTasks(const std::vector<Task *>& tasks)
               {//Critical section
                 YACS::BASES::AutoLocker<YACS::BASES::Mutex> alck(&_mutexForSchedulerUpdate);
                 t->aborted();
-                _mainSched->notifyFrom(t,YACS::ABORT);
+                _mainSched->notifyFrom(t,YACS::ABORT,this);
               }//End of critical section
               traceExec(t, "state:"+Node::getStateName(t->getState()),ComputePlacement(*iter));
             }
@@ -1225,7 +1225,7 @@ void *Executor::functionForTaskExecution(void *arg)
             task->aborted();
           }
         execInst->traceExec(task, "state:"+Node::getStateName(task->getState()),placement);
-        sched->notifyFrom(task,ev);
+        sched->notifyFrom(task,ev,execInst);
       }
     catch(Exception& ex)
       {
index d722b03694575259500acf8d700dd8d62c3befda..838bfb338fb4c6e00c5b4bc58598214db93a10a0 100644 (file)
@@ -882,14 +882,13 @@ YACS::Event ForEachLoop::updateStateForFinalizeNodeOnFinishedEventFrom(Node *nod
     return YACS::NOEVENT;
 }
 
-YACS::Event ForEachLoop::updateStateOnFailedEventFrom(Node *node)
+YACS::Event ForEachLoop::updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
 {
   unsigned int id;
   DynParaLoop::TypeOfNode ton(getIdentityOfNotifyerNode(node,id));
-  // TODO: deal with keepgoing
-  // if(ton!=WORK_NODE || !execInst->getKeepGoingProperty())
-  if(ton!=WORK_NODE )
-    return DynParaLoop::updateStateOnFailedEventFrom(node);
+  // TODO: deal with keepgoing without the dependency to Executor
+  if(ton!=WORK_NODE || !execInst->getKeepGoingProperty())
+    return DynParaLoop::updateStateOnFailedEventFrom(node,execInst);
   else
     {
       _failedCounter++;
index 0f3690fb06d157d0981f70e48b6f47cc48d55a2b..54aa83aae4a5936818183c7e784a87a9f5ba8862 100644 (file)
@@ -216,7 +216,7 @@ namespace YACS
       YACS::Event updateStateForInitNodeOnFinishedEventFrom(Node *node, unsigned int id);
       YACS::Event updateStateForWorkNodeOnFinishedEventFrom(Node *node, unsigned int id, bool isNormalFinish);
       YACS::Event updateStateForFinalizeNodeOnFinishedEventFrom(Node *node, unsigned int id);
-      YACS::Event updateStateOnFailedEventFrom(Node *node);
+      YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);
       void buildDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort *finalTarget, const std::list<ComposedNode *>& pointsOfView);
       void getDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort *finalTarget, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
       void releaseDelegateOf(OutPort *portDwn, OutPort *portUp, InPort *finalTarget, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
index eeca9c74f419148959318ea31d3ca627d1668dc1..91b35f29cdb80175d820a14c8cd7730f10865039 100644 (file)
@@ -456,7 +456,7 @@ YACS::Event OptimizerLoop::finalize()
  *  \param node : the child node that has failed
  *  \return the state change
  */
-YACS::Event OptimizerLoop::updateStateOnFailedEventFrom(Node *node)
+YACS::Event OptimizerLoop::updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
 {
   DEBTRACE("OptimizerLoop::updateStateOnFailedEventFrom " << node->getName());
   _alg->setError(string("Error during the execution of YACS node ") + node->getName() +
@@ -464,7 +464,7 @@ YACS::Event OptimizerLoop::updateStateOnFailedEventFrom(Node *node)
   _alg->finishProxy();
   _myPool.destroyAll();
   DEBTRACE("OptimizerLoop::updateStateOnFailedEventFrom: returned from error notification.");
-  return DynParaLoop::updateStateOnFailedEventFrom(node);
+  return DynParaLoop::updateStateOnFailedEventFrom(node,execInst);
 }
 
 void OptimizerLoop::checkNoCyclePassingThrough(Node *node) throw(YACS::Exception)
index 75c2cf37d3a7f5e69c8be078c879fae5cd5ce855..a5a23cc6818e3bfe9c6dc35fca8f43a04ab735db 100644 (file)
@@ -107,7 +107,7 @@ namespace YACS
       YACS::Event finalize();
 
     protected:
-      virtual YACS::Event updateStateOnFailedEventFrom(Node *node);
+      virtual YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);
       void buildDelegateOf(InPort * & port, OutPort *initialStart, const std::list<ComposedNode *>& pointsOfView);
       void buildDelegateOf(std::pair<OutPort *, OutPort *>& port, InPort *finalTarget, const std::list<ComposedNode *>& pointsOfView);
       void checkControlDependancy(OutPort *start, InPort *end, bool cross,
index 68d9755878541207e719905c72c2933cb973442e..d6ee7a1dac11d92d49e7ee3b471678ee23f78ae5 100644 (file)
@@ -31,6 +31,7 @@ namespace YACS
   namespace ENGINE
   {
     class Task;
+    class Executor;
     
     class Scheduler
     {
@@ -42,7 +43,7 @@ namespace YACS
       virtual std::string getTaskName(Task *task) const = 0;
       virtual std::vector<Task *> getNextTasks(bool& isMore) = 0;
       virtual void selectRunnableTasks(std::vector<Task *>& tasks) = 0;
-      virtual void notifyFrom(const Task *sender, YACS::Event event) = 0;
+      virtual void notifyFrom(const Task *sender, YACS::Event event, const Executor *execInst) = 0;
       //Placement methods
       virtual DeploymentTree getDeploymentTree() const = 0;
       virtual bool isPlacementPredictableB4Run() const = 0;
index 6102e0b3f72407f3fc770a1919f019da7cf17c81..1e74f2889002f855fc5dd9462366f95288c32daa 100644 (file)
@@ -102,6 +102,7 @@ namespace YACS
       static std::map<std::string, YACS::StatesForNode> _nodeStates;
     };
 
+#ifndef SWIG
     class YACSLOADER_EXPORT graphParser: public stateParser
     {
     public:
@@ -212,7 +213,7 @@ namespace YACS
     private:
       loopPortParser* _sampleFather;
     };
-
+#endif
   }
 }
 #endif
index 13dd1bcd9c0bfa5e061813d14d01fd3ad41e9055..4f41b4ad19388381cc3ff7b327dd5e7698d786a5 100644 (file)
@@ -67,5 +67,5 @@
 %include "YACSloaderExport.hxx"
 %include "parsers.hxx"
 %import "xmlParserBase.hxx"
-//%include "LoadState.hxx"
+%include "LoadState.hxx"