X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FDynParaLoop.hxx;h=8eddfceaa739c2250b82b5baadf3df5512cb602e;hb=22868d035fb80bab64e0231d8dfffdf7afc240c3;hp=2ce21b66c89571d717c151fbcb2082a12cbd5a26;hpb=9bb3fa34063d1902683819bf72c7881dcca7ad57;p=modules%2Fyacs.git diff --git a/src/engine/DynParaLoop.hxx b/src/engine/DynParaLoop.hxx index 2ce21b66c..8eddfceaa 100644 --- a/src/engine/DynParaLoop.hxx +++ b/src/engine/DynParaLoop.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2014 CEA/DEN, EDF R&D +// Copyright (C) 2006-2023 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 @@ -25,6 +25,9 @@ #include "AnyInputPort.hxx" #include "AnyOutputPort.hxx" #include "OutputPort.hxx" +#include "NbBranches.hxx" + +#include namespace YACS { @@ -49,19 +52,22 @@ namespace YACS Node *_finalizeNode; unsigned _nbOfEltConsumed; std::vector _execIds; - AnyInputPort _nbOfBranches; + //NbBranches _nbOfBranches2; + std::unique_ptr _nbOfBranches; AnyOutputPort _splittedPort; std::vector _execNodes; std::vector _execInitNodes; std::vector _execFinalizeNodes; int _initializingCounter; int _unfinishedCounter; + int _failedCounter; + ComplexWeight _weight; + double _loopWeight; protected: static const char NAME_OF_SPLITTED_SEQ_OUT[]; static const char OLD_NAME_OF_SPLITTED_SEQ_OUT[]; - static const char NAME_OF_NUMBER_OF_BRANCHES[]; protected: - DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted); + DynParaLoop(const std::string& name, TypeCode *typeOfDataSplitted, std::unique_ptr&& branchManager); virtual ~DynParaLoop(); DynParaLoop(const DynParaLoop& other, ComposedNode *father, bool editionOnly); public: @@ -72,37 +78,45 @@ namespace YACS Node *edSetNode(Node *DISOWNnode); Node *edSetInitNode(Node *DISOWNnode); Node *edSetFinalizeNode(Node *DISOWNnode); - virtual bool edAddDFLink(OutPort *start, InPort *end) throw(Exception); + virtual bool edAddDFLink(OutPort *start, InPort *end) ; void init(bool start=true); - InputPort *edGetNbOfBranchesPort() { return &_nbOfBranches; } + InputPort *edGetNbOfBranchesPort() { return _nbOfBranches->getPort(); } int getNumberOfInputPorts() const; int getNumberOfOutputPorts() const; unsigned getNumberOfEltsConsumed() const { return _nbOfEltConsumed; } + int getBranchIDOfNode(Node *node) const; std::list getSetOfOutputPort() const; std::list getLocalOutputPorts() const; OutputPort *edGetSamplePort() { return &_splittedPort; } - OutPort *getOutPort(const std::string& name) const throw(Exception); - InputPort *getInputPort(const std::string& name) const throw(Exception); - OutputPort *getOutputPort(const std::string& name) const throw(Exception); + OutPort *getOutPort(const std::string& name) const ; + InputPort *getInputPort(const std::string& name) const ; + OutputPort *getOutputPort(const std::string& name) const ; //! For the moment false is returned : impovement about it coming soon. bool isPlacementPredictableB4Run() const; - void edRemoveChild(Node *node) throw(Exception); - virtual bool edAddChild(Node *DISOWNnode) throw(Exception); + void edRemoveChild(Node *node) ; + bool isLoop() const override { return true; } + virtual bool edAddChild(Node *DISOWNnode) ; std::list edGetDirectDescendants() const; std::list getSetOfInputPort() const; std::list getLocalInputPorts() const; - unsigned getNumberOfBranchesCreatedDyn() const throw(Exception); - Node *getChildByShortName(const std::string& name) const throw(Exception); - Node *getChildByNameExec(const std::string& name, unsigned id) const throw(Exception); + unsigned getNumberOfBranchesCreatedDyn() const ; + Node *getChildByShortName(const std::string& name) const ; + Node *getChildByNameExec(const std::string& name, unsigned id) const ; std::vector getNodes() const { return _execNodes; } // need to use in GUI part for adding observers for clone nodes + ComplexWeight * getWeight(); + void setWeight(double loopWeight); + void getWeightRegardingDPL(ComplexWeight *weight) {weight->addWeight(getWeight());} bool isMultiplicitySpecified(unsigned& value) const; void forceMultiplicity(unsigned value); - virtual void checkBasicConsistency() const throw(Exception); + virtual void checkBasicConsistency() const ; virtual std::string getErrorReport(); void accept(Visitor *visitor); Node * getInitNode(); Node * getExecNode(); Node * getFinalizeNode(); + int getMaxLevelOfParallelism() const; + void partitionRegardingDPL(const PartDefinition *pd, std::map >& zeMap); + virtual void cleanDynGraph(); protected: void buildDelegateOf(InPort * & port, OutPort *initialStart, const std::list& pointsOfView); void buildDelegateOf(std::pair& port, InPort *finalTarget, const std::list& pointsOfView); @@ -112,14 +126,15 @@ namespace YACS std::vector& fwCross, std::map< ComposedNode *, std::list < OutPort *>, SortHierarc >& bw, LinkInfo& info) const; + virtual void checkLinkPossibility(OutPort *start, const std::list& pointsOfViewStart, + InPort *end, const std::list& pointsOfViewEnd) ; protected: - void cleanDynGraph(); void prepareInputsFromOutOfScope(int branchNb); void putValueOnBranch(Any *val, unsigned branchId, bool first); 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 cloneAndPlaceNodesCoherently(const std::vector & origNodes); Node * checkConsistencyAndSetNode(Node* &nodeToReplace, Node* DISOWNnode); Node * removeNode(Node* &nodeToRemove);