From d29a74a6f13c329e9dbc22d5980197769e4af1a0 Mon Sep 17 00:00:00 2001 From: rahuel Date: Thu, 13 Jan 2005 15:34:37 +0000 Subject: [PATCH] Traces --- src/GraphBase/DataFlowBase_StreamNode.cxx | 24 +++++++--- src/GraphEditor/DataFlowEditor_OutNode.cxx | 2 +- .../DataFlowExecutor_InNodeThreads.cxx | 44 +++++++++---------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/GraphBase/DataFlowBase_StreamNode.cxx b/src/GraphBase/DataFlowBase_StreamNode.cxx index 6a35486..b3048d7 100644 --- a/src/GraphBase/DataFlowBase_StreamNode.cxx +++ b/src/GraphBase/DataFlowBase_StreamNode.cxx @@ -232,10 +232,14 @@ bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode , << ToNode->_LinkedFromNodesSize << " " << Name() << " removed from " << " linkedFromnodes of " << ToNode->Name() << endl ; int i ; - for ( i = fromindex ; i < ToNode->_LinkedFromNodesSize ; i++ ) { - ToNode->_LinkedFromNodes[ i ] = ToNode->_LinkedFromNodes[ i+1 ] ; - ToNode->_LinkedFromInPortsNumber[ i ] = ToNode->_LinkedFromInPortsNumber[ i+1 ] ; - ToNode->SetLinkedFromNodeIndex( ToNode->_LinkedFromNodes[ i ]->Name() , i ) ; + for ( i = 0 ; i < ToNode->_LinkedFromNodesSize ; i++ ) { + if ( i >= fromindex ) { + ToNode->_LinkedFromNodes[ i ] = ToNode->_LinkedFromNodes[ i+1 ] ; + ToNode->_LinkedFromInPortsNumber[ i ] = ToNode->_LinkedFromInPortsNumber[ i+1 ] ; + ToNode->SetLinkedFromNodeIndex( ToNode->_LinkedFromNodes[ i ]->Name() , i ) ; + } + cdebug << "StreamNode::RemoveLinkedFromNode" << i << " " + << ToNode->_LinkedFromNodes[ i ]->Name() << endl ; } ToNode->DelLinkedFromNodeIndex( Name() ) ; ToNode->_LinkedFromNodes.resize( ToNode->_LinkedFromNodesSize+1 ) ; @@ -243,10 +247,14 @@ bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode , } } else if ( DoLinkedFromNode ) { - cdebug << "StreamNode::RemoveLinkedFromNode index Error " << ToNode->Name() << " --> " << Name() << " : " << fromindex + cdebug << "StreamNode::RemoveLinkedFromNode index Error " << ToNode->Name() << " --> " + << Name() << " : " << fromindex << " _LinkedFromNodesSize " << ToNode->_LinkedFromNodesSize << endl ; } else { + cdebug << "StreamNode::RemoveLinkedFromNode index " << ToNode->Name() << " --> " << Name() + << " : " << fromindex + << " _LinkedFromNodesSize " << ToNode->_LinkedFromNodesSize << endl ; fromindex = 0 ; // No error in EndSwitchNodes } @@ -257,7 +265,7 @@ bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode , aMapOfLinkedNodesIterator1 != _MapOfLinkedNodes.end() ; aMapOfLinkedNodesIterator1++ ) { cdebug << "_MapOfLinkedNodes" << ii++ << " of " << Name() << " : " << aMapOfLinkedNodesIterator1->first << " --> " << aMapOfLinkedNodesIterator1->second - << endl ; + << " " << _LinkedNodes[ aMapOfLinkedNodesIterator1->second - 1 ]->Name() << endl ; } #endif #if 1 @@ -267,7 +275,9 @@ bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode , aMapOfLinkedFromNodesIterator1 != ToNode->_MapOfLinkedFromNodes.end() ; aMapOfLinkedFromNodesIterator1++ ) { cdebug << "_MapOfLinkedFromNodes" << iifrom++ << " of " << ToNode->Name() << " : " << aMapOfLinkedFromNodesIterator1->first << " --> " - << aMapOfLinkedFromNodesIterator1->second << endl ; + << aMapOfLinkedFromNodesIterator1->second << " " + << ToNode->_LinkedFromNodes[ aMapOfLinkedFromNodesIterator1->second - 1 ]->Name() + << endl ; } #endif cdebug_out << "StreamNode::RemoveLinkedNode between " << Name() << " and " << ToNode->Name() diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index fafc114..e0dfda4 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -552,7 +552,7 @@ bool GraphEditor::OutNode::SavePy( const char* filename ) { IsValid() ; test = SavePY( f , true ); f << endl << Graph()->Name() << " = Def" << Graph()->Name() << "()" << endl ; - cdebug_out << "GraphEditor::OutNode::SavePy" << endl; + cdebug_out << "GraphEditor::OutNode::SavePy " << test << endl; return test; } diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index 653a59b..0192a5d 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -1890,14 +1890,14 @@ int GraphExecutor::InNode::Successed_SuccessAction() { DoneAction() ; if ( IsMacroNode() ) { - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " LinkedNodes->SomeDataReady already done" + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " LinkedNodes->SomeDataReady already done" << endl ; return 1; } if ( IsGOTONode() || ( IsEndLoopNode() && GetNodeInLoop()->GetOutPort()->BoolValue() ) ) { - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " SetWaitingStates " << endl ; const GraphBase::OutPort * aGateOutPort ; if ( IsGOTONode() ) { @@ -1907,14 +1907,14 @@ int GraphExecutor::InNode::Successed_SuccessAction() { aGateOutPort = GetNodeOutLoop() ; } if ( aGateOutPort->InPortsSize() != 1 ) { - cdebug << ThreadNo() << " Successed_SuccessAction aGateOutPort->InPortsSize " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction aGateOutPort->InPortsSize " << aGateOutPort->InPortsSize() << " != 1 ERROR " << Name() << endl ; } GraphExecutor::InNode * aLabelNode = NULL ; for ( i = 0 ; i < aGateOutPort->InPortsSize() ; i++ ) { const GraphBase::InPort * anInPort = aGateOutPort->InPorts( i ) ; aLabelNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode " << aLabelNode->Name() << " from port " << anInPort->PortName() << endl ; aLabelNode->SetWaitingStates( this ) ; // JR 07.01.2005 Debug : Open the Gate of the coupledNode closed by SetWaitingStates @@ -1946,7 +1946,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } if ( aBusParamChangeInPort ) { aBusParamChangeInPort->ChangeOutPort( aBusParamOutPort ) ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " ChangeOutPort to HeadNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " ChangeOutPort to HeadNode " << aLabelNode->Name() << "(" << aBusParamChangeInPort->PortName() << ") from port " << aBusParamOutPort->PortName() << endl ; } @@ -1960,7 +1960,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( firsttoNode == NULL && aLabelNode->ThreadNo() == pthread_self() ) { firsttoNode = aLabelNode ; - cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " << aLabelNode->Name() << endl ; } else if ( firstzeroNode == NULL && @@ -1969,7 +1969,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } else { SomeDataNodes.push_back( aLabelNode ) ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " << aLabelNode->Name() << " " << SomeDataNodes.size() << endl ; } @@ -1994,7 +1994,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( firsttoNode == NULL && aLabelNode->ThreadNo() == pthread_self() ) { firsttoNode = aLabelNode ; - cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " << aLabelNode->Name() << endl ; } else if ( firstzeroNode == NULL && @@ -2003,7 +2003,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } else { SomeDataNodes.push_back( aLabelNode ) ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " << aLabelNode->Name() << " " << SomeDataNodes.size() << endl ; } @@ -2011,7 +2011,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } } else { - cdebug << ThreadNo() << " ERROR in Successed_SuccessAction of " << Name() + cdebug << pthread_self() << "/" << ThreadNo() << " ERROR in Successed_SuccessAction of " << Name() << " NO port " << aGateOutPort->PortName() << " in " << aLabelNode->Name() << endl; } @@ -2033,7 +2033,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { GraphBase::ComputingNode * aComputingNode ; aComputingNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ; toNode = (GraphExecutor::InNode *) aComputingNode->GetInNode() ; - cdebug << ThreadNo() << " Successed_SuccessAction of " << Name() + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction of " << Name() << " [" << i << "] " << LinkedNodes( i )->Name() << " toNode " << toNode << " IgnoreForEndLoop " << IgnoreForEndLoop ; if ( toNode ) { @@ -2090,14 +2090,14 @@ int GraphExecutor::InNode::Successed_SuccessAction() { toNode->GetChangeNodeInPort( j )->InitialOutPort() ; } } - cdebug << ThreadNo() << " Successed_SuccessAction " << toNode->Name() << "->SendSomeDataReady( " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << toNode->Name() << "->SendSomeDataReady( " << Name() << " )" << endl ; res = toNode->SendSomeDataReady( Name() ) ; if ( res ) { if ( firsttoNode == NULL && toNode->ThreadNo() == pthread_self() ) { firsttoNode = toNode ; - cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " << toNode->Name() << endl ; } else if ( firstzeroNode == NULL && @@ -2106,7 +2106,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } else { SomeDataNodes.push_back( toNode ) ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " << toNode->Name() << " " << SomeDataNodes.size() << endl ; } } @@ -2116,17 +2116,17 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( firsttoNode == NULL && firstzeroNode ) { firsttoNode = firstzeroNode ; - cdebug << ThreadNo() + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode = firstzeroNode " << endl ; } else if ( firsttoNode && firstzeroNode ) { SomeDataNodes.push_back( firstzeroNode ) ; - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode " + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode " << firstzeroNode->Name() << " " << SomeDataNodes.size() << endl ; } else { - cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode << " firstzeroNode " << firstzeroNode << endl ; } @@ -2917,7 +2917,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , OrSwitch = OrSwitch | anOutPort->BoolValue() ; } } - cdebug << "OrSwitch " << OrSwitch ; + cdebug << "OutParametersSet OrSwitch " << OrSwitch ; } else { cdebug << " Param " ; @@ -3032,15 +3032,15 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , } if ( aGateOutPort && IsSwitchNode() ) { if ( OrSwitch ) { -// cdebug << ThreadNo() << " " << "Out0 " << Name() << " Close of " -// << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; + cdebug << ThreadNo() << " " << "Out0 " << Name() << " Close of " + << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; long l = 0; OutParametersList[0].Value <<= l ; aGateOutPort->Value( OutParametersList[0].Value ) ; } else { -// cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of " -// << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; + cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of " + << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; long l = 1; OutParametersList[0].Value <<= l ; aGateOutPort->Value( OutParametersList[0].Value ) ; -- 2.39.2