-// Copyright (C) 2006-2015 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022 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
#include "OutputDataStreamPort.hxx"
#include "ElementaryNode.hxx"
#include "Visitor.hxx"
+#include "ForkBlocPoint.hxx"
#include "SetOfPoints.hxx"
+#include "PlayGround.hxx"
#include <queue>
#include <iostream>
* If node name already used in bloc, throw exception.
* Publish inputPorts in current bloc and ancestors.
*/
-bool Bloc::edAddChild(Node *node) throw(YACS::Exception)
+bool Bloc::edAddChild(Node *node)
{
if(isNodeAlreadyAggregated(node))
{
* @exception If 'node' is NOT the son of 'this'.
*/
-void Bloc::edRemoveChild(Node *node) throw(YACS::Exception)
+void Bloc::edRemoveChild(Node *node)
{
StaticDefinedComposedNode::edRemoveChild(node);
list<Node *>::iterator iter=find(_setOfNode.begin(),_setOfNode.end(),node);
return ret;
}
-Node *Bloc::getChildByShortName(const std::string& name) const throw(YACS::Exception)
+Node *Bloc::getChildByShortName(const std::string& name) const
{
for (list<Node *>::const_iterator iter = _setOfNode.begin(); iter != _setOfNode.end(); iter++)
if ((*iter)->getName() == name)
* \b WARNING : When using this method 'node' has to be checked in order to be part of direct children of 'this'.
*
*/
-void Bloc::checkNoCyclePassingThrough(Node *node) throw(YACS::Exception)
+void Bloc::checkNoCyclePassingThrough(Node *node)
{
set<Node *> currentNodesToTest;
//don't insert node to test in set.
* \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())
* for all concurrent branches in \a this.
*/
int Bloc::getMaxLevelOfParallelism() const
+{
+ std::list< AbstractPoint * > pts(analyzeParallelism());
+ ForkBlocPoint fbp(pts,NULL);
+ return fbp.getMaxLevelOfParallelism();
+}
+
+std::list< AbstractPoint * > Bloc::analyzeParallelism() const
{
std::vector< std::list<Node *> > r(splitIntoIndependantGraph());
- int ret(0);
+ std::list< AbstractPoint * > pts;
for(std::vector< std::list<Node *> >::const_iterator it=r.begin();it!=r.end();it++)
{
SetOfPoints sop(*it);
sop.simplify();
- ret+=sop.getMaxLevelOfParallelism();
+ pts.push_back(sop.getUniqueAndReleaseIt());
}
- return ret;
+ return pts;
+}
+
+void Bloc::getWeightRegardingDPL(ComplexWeight *weight)
+{
+ std::list< AbstractPoint * > pts(analyzeParallelism());
+ ForkBlocPoint fbp(pts,NULL);
+ fbp.getWeightRegardingDPL(weight);
}
void Bloc::removeRecursivelyRedundantCL()
destructCFComputations(info);
}
+void Bloc::partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap)
+{
+ if(!pd)
+ throw Exception("Bloc::partitionRegardingDPL : NULL pointer !");
+ std::list< AbstractPoint * > pts(analyzeParallelism());
+ ForkBlocPoint fbp(pts,NULL);
+ fbp.partitionRegardingDPL(pd,zeMap);
+}
+
void Bloc::performCFComputationsOnlyOneLevel(LinkInfo& info) const
{
delete _fwLinks;//Normally useless