From 53cecc2c473d60a8eabe93b9304fe740d437dc01 Mon Sep 17 00:00:00 2001 From: rahuel Date: Wed, 9 Mar 2005 09:17:26 +0000 Subject: [PATCH] Memory Leaks Traces State --> PortState and Done --> PortDone ===> Lisibility Comments Switch execution management clarification and debug Many Debugs : see the comments for details --- .../DataFlowExecutor_InNodeThreads.cxx | 717 ++++++++++++------ 1 file changed, 481 insertions(+), 236 deletions(-) diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index b33fa38..e44f375 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -74,11 +74,11 @@ static void UpperCase(std::string& rstr) int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) { _CurrentEvent = (GraphExecutor::NodeEvent ) anEvent ; - cdebug << pthread_self() << "/" << ThreadNo() << " -->SendEvent Node " << Name() - << " ControlState : " - << Automaton()->ControlStateName( ControlState() ) - << " Event : " << Automaton()->EventName( anEvent ) - << " State : " << Automaton()->StateName( State() ) << " _RewindStack " << _RewindStack << endl; + cdebug_in << pthread_self() << "/" << ThreadNo() << " -->SendEvent Node " << Name() + << " ControlState : " + << Automaton()->ControlStateName( ControlState() ) + << " Event : " << Automaton()->EventName( anEvent ) + << " State : " << Automaton()->StateName( State() ) << " _RewindStack " << _RewindStack << endl; _OldState = State() ; _NextState = Automaton()->NextState( _OldState , anEvent ) ; @@ -108,23 +108,12 @@ int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) { << " CreateNewThread " << CreateNewThread() << endl << " _RewindStack " << _RewindStack << endl ; -#if 0 - //cout << pthread_self() << "/" << ThreadNo() << " SendedEvent Node " << Name() - << endl << " ControlState : " - << Automaton()->ControlStateName( ControlState() ) << endl - << " OldState : " << Automaton()->StateName( _OldState ) << endl - << " Event : " << Automaton()->EventName( anEvent ) << endl - << " NextState : " << Automaton()->StateName( _NextState ) << endl - << " Action : " << Automaton()->ActionName( _NextAction ) << endl - << " CreateNewThread " << CreateNewThread() << endl ; -#endif - int sts = executeAction() ; - cdebug << pthread_self() << "/" << ThreadNo() << " <--- SendEvent Node " << Name() - << " Event : " << Automaton()->EventName( anEvent ) - << " State : " << Automaton()->StateName( State() ) - << endl; +// cdebug_out << pthread_self() << "/" << ThreadNo() << " <--- SendEvent Node " << Name() +// << " Event : " << Automaton()->EventName( anEvent ) +// << " State : " << Automaton()->StateName( State() ) +// << endl; return sts ; @@ -527,6 +516,7 @@ int GraphExecutor::InNode::executeAction() { << CreateNewThread() << " " << Automaton()->ActionName( _NextAction ) << "(" << Name() << ")" << endl; CreateNewThread( true ) ; + _OutNode->IncrCreatedThreads() ; ThreadNo( 0 ) ; } if ( CreateNewThread() ) { @@ -549,7 +539,8 @@ int GraphExecutor::InNode::executeAction() { << PTHREAD_THREADS_MAX << " pthread_create status : " ; if ( pthread_sts == EAGAIN ) { cdebug << "EAGAIN(" << pthread_sts << ")" << endl ; - cdebug << "It seems to me that with gdb we are limited to 256 threads because of defunct" << endl ; + cdebug << _OutNode->CreatedThreads() << " was created (and exited)" << endl ; + cdebug << "It seems to me that with gdb we are limited to 256 threads" << endl ; } else { cdebug << pthread_sts << endl ; @@ -771,8 +762,8 @@ int GraphExecutor::InNode::ExecuteAction() { return 0 ; } } - cdebug_out << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction " - << nextactionname << endl ; +// cdebug_out << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction " +// << nextactionname << endl ; return sts ; } @@ -800,39 +791,49 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { bool SwitchFinished = false ; if ( IsLoopNode() ) { - GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ; + GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ; // DoLoop Port if ( anOutLoopPort && anOutLoopPort->BoolValue() ) { LoopBeginning = true ; // Beginning of Loop } } if ( IsEndLoopNode() ) { - GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ; + GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ; // DoLoop Port if ( anOutLoopPort && !anOutLoopPort->BoolValue() ) { LoopFinished = true ; // End of Loop } } - if ( IsEndSwitchNode() ) { - GraphBase::OutPort * anOutGateSwitchPort = GetChangeNodeInGate()->GetOutPort() ; + if ( IsEndSwitchNode() && strcmp( GOTONode()->CoupledNode()->Name() , DataFromNode() ) ) { + GraphBase::OutPort * anOutGateSwitchPort = GetChangeNodeInGate()->GetOutPort() ; // Default Port +//JR 09.02.2005 : SomeDataReady is not from the SwitchNode if ( anOutGateSwitchPort && !anOutGateSwitchPort->BoolValue() ) { +//JR 09.02.2005 : the OutPort of the SwitchNode connected to the default port is closed ===> +// Here after we consider that that DefaultPort is Ready (even if it's value is false) SwitchFinished = true ; // End of Switch } } +#define SomeDataReadyTrace 0 +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " LoopFinished " << LoopFinished << " LoopBeginning " << LoopBeginning << " SwitchFinished " << SwitchFinished << endl ; +#endif for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) { GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ; GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ; - cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " << anInPort->PortName() << " " << anInPort->State() << " " << anInPort->PortStatus() << endl ; + cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " << anInPort->PortName() << " " << anInPort->PortState() << " " << anInPort->PortStatus() << endl ; if ( anInPort->IsGate() && anOutPort == NULL ) { InReady += 1 ; - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " ControlPort inactive." << endl ; +#endif } -// That InPort get its value from an other node +// That InPort get its value from an other node : the node of anOutPort linked to that anInPort is +// different from the sender of SomeDataReady (DataFromNode) else if ( strcmp( DataFromNode() , anOutPort->NodeName() ) ) { - if ( anInPort->State() == SUPERV::ReadyState ) { + if ( anInPort->PortState() == SUPERV::ReadyState ) { InReady += 1 ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -843,10 +844,12 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else if ( IsLoopNode() && anInPort->IsDataConnected() ) { - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; InReady += 1 ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -857,10 +860,12 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else if ( LoopFinished ) { - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; InReady += 1 ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -871,10 +876,12 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else if ( anInPort->IsGate() && SwitchFinished ) { - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; InReady += 1 ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -885,15 +892,19 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else if ( anInPort->IsGate() && _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() )->IsGOTONode() ) { // GateOutPort of GOTONodes are always opened - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; InReady += 1 ; - CORBA::Any * anAny = new CORBA::Any() ; - *anAny <<= (long ) 1 ; +//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ; + CORBA::Any anAny = CORBA::Any() ; +//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 1 ; + anAny <<= (long ) 1 ; _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() )->GetChangeNodeOutGate()->Value( anAny ) ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -904,24 +915,28 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else { +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Was NOT Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") " << " " << Automaton()->StateName( State() ) << " DataConnected " << anInPort->IsDataConnected() << " LoopBeginning " << LoopBeginning << endl ; +#endif } } -// That InPort get its value from the sending node +// That InPort get its value from the sending node (DataFromNode) else if ( anInPort->IsGate() ) { const CORBA::Any * theValue = anOutPort->Value() ; long GateOpened ; (*theValue) >>= GateOpened ; if ( GateOpened != 0 ) { InReady += 1 ; - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " Gate is Opened from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -932,9 +947,11 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else if ( LoopFinished ) { - anInPort->State( SUPERV::ReadyState ) ; + anInPort->PortState( SUPERV::ReadyState ) ; +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " GATE IS CLOSED from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -945,8 +962,10 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } else { +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " << anInPort->PortName() << " GATE IS CLOSED from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() @@ -957,13 +976,16 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif } } - else if ( anOutPort->Done() ) { + else if ( anOutPort->PortDone() ) { InReady += 1 ; - anInPort->State( SUPERV::ReadyState ) ; - cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " " - << anInPort->PortName() << " " << anInPort->PortStatus() << " is Done from Node " + anInPort->PortState( SUPERV::ReadyState ) ; +#if SomeDataReadyTrace + cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " + << anInPort->PortName() << " " << anInPort->PortStatus() << " " + << Automaton()->StateName( anInPort->PortState() ) << " is Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") " << anOutPort->PortStatus() << " " ; #ifdef _DEBUG_ @@ -972,6 +994,7 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } #endif cdebug << endl ; +#endif // MacroNode : give immediately the value to the corresponding graph if ( IsMacroNode() ) { cout << "SomeDataReadyAction " << GraphMacroNode() << " " << GraphMacroNode()->Name() @@ -984,11 +1007,13 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { } } else { +#if SomeDataReadyTrace cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << "( " << anInPort->PortName() << ") " << anInPort->PortStatus() << " is NOT Done from Node " << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") " - << anOutPort->PortStatus() << " " ; + << anOutPort->PortStatus() << " " << endl ; +#endif } } @@ -1018,15 +1043,19 @@ int GraphExecutor::InNode::DataUndef_AllDataReadyAction() { // << " CreateNewThreadIf " << CreateNewThreadIf() << " IsLockedDataWait " // << IsLockedDataWait() ; if ( IsLockedDataWait() ) { - cdebug << "DataUndef_AllDataReadyAction() WOULD DEAD-LOCK" << endl ; + cdebug << "DataUndef_AllDataReadyAction() " << Name() << "WOULD DEAD-LOCK" << endl ; return 0 ; // ==> DataUndef_AllDataReadyAction() after UnLockDataWait() } -// cdebug << endl ; + cdebug << "InNode::DataUndef_AllDataReadyAction CreateNewThread( CreateNewThreadIf() ) " + << CreateNewThreadIf() << endl ; CreateNewThread( CreateNewThreadIf() ) ; if ( !CreateNewThread() ) { // cdebug << "Thread " << ThreadNo() << "-->" << pthread_self() << endl ; ThreadNo( pthread_self() ) ; } + else { + _OutNode->IncrCreatedThreads() ; + } _OutNode->PushEvent( this , GraphExecutor::AllDataReadyEvent , GraphExecutor::DataReadyState ) ; ReadyAction() ; @@ -1122,7 +1151,6 @@ int GraphExecutor::InNode::DataReady_StopAction() { #include int GraphExecutor::InNode::DataReady_ExecuteAction() { - int i; // cdebug << pthread_self() << "/" << ThreadNo() << " --> DataReady_ExecuteAction " // << Name() << endl; @@ -1173,7 +1201,8 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { // << Computer() ; // _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ; Err = !_OutNode->Graph()->StartComponent( ThreadNo() , Computer() , - my_strdup( ComponentName() ) , +//JR 17.02.2005 Memory Leak my_strdup( ComponentName() ) , + ComponentName() , myContainer , myObjComponent ) ; ObjInterface( false ) ; SetContainer( myContainer ) ; @@ -1197,9 +1226,9 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { ControlState() == SUPERV::ToKillDoneState || ControlState() == SUPERV::ToStopState ) { cdebug << ThreadNo() << "StartComponent Error or ToKillState" << endl ; - MESSAGE(pthread_self() << "Executor::InNode::DataReady_ExecuteAction of " << Name() - << " ControlState " << Automaton()->ControlStateName( ControlState() ) - << " BEFORE execution ThreadNo " << ThreadNo() ) ; +// MESSAGE(pthread_self() << "Executor::InNode::DataReady_ExecuteAction of " << Name() +// << " ControlState " << Automaton()->ControlStateName( ControlState() ) +// << " BEFORE execution ThreadNo " << ThreadNo() ) ; Err = true ; } else { @@ -1211,6 +1240,8 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { // ostringstream astr ; // astr << "Graph " << _OutNode->Graph()->Name() << " Run of Node " << Name() ; // _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ; +#if 0 + int i; cdebug << ThreadNo() << " Run( '" << ServiceName() << "'" ; for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) { cdebug << " , " << InParametersList[ i ].Name << "[kind" @@ -1226,6 +1257,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << (*InLineNode()->PythonFunction()).length() ; } cdebug << ")" << endl ; +#endif if ( IsOneOfInLineNodes() ) { bool StsPyDynInvoke = true; @@ -1257,9 +1289,9 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { // if ( GetNodeInLoop()->GetOutPort()->BoolValue() && if ( _InitLoop ) { if ( strlen( InLineNode()->PyFuncName() ) ) { // InLoop Port = true ==> Init() - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode PyDynInvoke '" << InLineNode()->PyFuncName() - << "' InitLoop " << LoopNode()->PyRunMethod() << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode PyDynInvoke '" << InLineNode()->PyFuncName() +// << "' InitLoop " << LoopNode()->PyRunMethod() << endl ; StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() , InLineNode()->PyFuncName() , &InParametersList[1] , ServiceInParameter().length() , @@ -1270,18 +1302,18 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { CopyOutIn = true ; } else { - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode NO PyDynInvoke Void PyFuncName InitLoop" << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode NO PyDynInvoke Void PyFuncName InitLoop" << endl ; } - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode _InitLoop Reset after Init() Python Function" << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode _InitLoop Reset after Init() Python Function" << endl ; _InitLoop = false ; } else if ( LoopNode()->PyNextMethod() && strlen( LoopNode()->PyNextName() ) ){ // InLoop Port = false ==> Next() - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode PyDynInvoke '" << LoopNode()->PyNextName() - << "' " << LoopNode()->PyNextMethod() << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyNextName() +// << "' " << LoopNode()->PyNextMethod() << endl ; StsPyDynInvoke = PyDynInvoke( LoopNode()->PyNextMethod() , LoopNode()->PyNextName() , &InParametersList[1] , ServiceInParameter().length() , @@ -1292,21 +1324,21 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { CopyOutIn = true ; } else { - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode NO PyDynInvoke Void PyFuncName NextLoop" << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode NO PyDynInvoke Void PyFuncName NextLoop" << endl ; } if ( StsPyDynInvoke ) { if ( CopyOutIn ) { - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() - << "' Copy of " << ServiceInParameter().length() - << " OutParameters" << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() +// << "' Copy of " << ServiceInParameter().length() +// << " OutParameters" << endl ; int i ; // Start at 1 : Do not copy InLoop ( InLoop == true <==> Init ; InLoop == false <==> Next ) for ( i = 1 ; i <= (int ) ServiceInParameter().length() ; i++ ) { InParametersList[i].Value = OutParametersList[i].Value ; InParametersList[i].Name = OutParametersList[i].Name ; -//#if 0 +#if 0 switch ( InParametersList[i].Value.type()->kind() ) { case CORBA::tk_string : char * t; @@ -1315,12 +1347,26 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << InParametersList[i].Name.c_str() << " Value(string) " << t << endl ; break ; - case CORBA::tk_double : - double d; - InParametersList[i].Value >>= d; + case CORBA::tk_boolean: + bool b ; + InParametersList[i].Value >>= (CORBA::Any::to_boolean ) b; cdebug << "ArgOut->In" << i << " : " << InParametersList[i].Name.c_str() - << " Value(double) " << d << endl ; + << " Value(boolean) " << b << endl ; + break ; + case CORBA::tk_char: + unsigned char c ; + InParametersList[i].Value >>= (CORBA::Any::to_char ) c; + cdebug << "ArgOut->In" << i << " : " + << InParametersList[i].Name.c_str() + << " Value(char) " << c << endl ; + break ; + case CORBA::tk_short: + short s ; + InParametersList[i].Value >>= s; + cdebug << "ArgOut->In" << i << " : " + << InParametersList[i].Name.c_str() + << " Value(short) " << s << endl ; break ; case CORBA::tk_long : long l; @@ -1329,6 +1375,20 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << InParametersList[i].Name.c_str() << " Value(long) " << l << endl ; break ; + case CORBA::tk_float : + float f; + InParametersList[i].Value >>= f; + cdebug << "ArgOut->In" << i << " : " + << InParametersList[i].Name.c_str() + << " Value(float) " << f << endl ; + break ; + case CORBA::tk_double : + double d; + InParametersList[i].Value >>= d; + cdebug << "ArgOut->In" << i << " : " + << InParametersList[i].Name.c_str() + << " Value(double) " << d << endl ; + break ; case CORBA::tk_objref : CORBA::Object_ptr obj ; char * retstr ; @@ -1350,13 +1410,13 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << InParametersList[i].Name.c_str() << " Value(other) ERROR" << endl ; } -//#endif +#endif } } if ( LoopNode()->PyMoreMethod() && strlen( LoopNode()->PyMoreName() ) ) { - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() - << "' " << LoopNode()->PyMoreMethod() << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() +// << "' " << LoopNode()->PyMoreMethod() << endl ; StsPyDynInvoke = PyDynInvoke( LoopNode()->PyMoreMethod() , LoopNode()->PyMoreName() , &InParametersList[1] , ServiceInParameter().length() , @@ -1366,9 +1426,9 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { } } else { - cdebug << ThreadNo() << " !ObjInterface " << Name() - << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() - << "' No MoreMethod" << endl ; +// cdebug << ThreadNo() << " !ObjInterface " << Name() +// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName() +// << "' No MoreMethod" << endl ; CopyInOut = true ; } } @@ -1450,15 +1510,15 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { argin0 = 1 ; // after DoLoop if ( IsLoopNode() ) { // More() is void // OutParametersList[0].Value = InParametersList[0].Value ; // DoLoop - cdebug << Name() << " Not Beginning of loop and non void EndLoop : DoLoop = EndLoop(DoLoop)" - << endl ; +// cdebug << Name() << " Not Beginning of loop and non void EndLoop : DoLoop = EndLoop(DoLoop)" +// << endl ; GraphExecutor::InNode * anEndLoopNode = (GraphExecutor::InNode * ) CoupledNode()->GetInNode() ; OutParametersList[0].Value = *anEndLoopNode->GetNodeOutLoop()->Value() ; // DoLoop = EndLoop(DoLoop) } } for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) { OutParametersList[argout0 + i].Value = InParametersList[argin0 + i].Value ; -//#if 0 +#if 0 switch ( InParametersList[argin0 + i].Value.type()->kind() ) { case CORBA::tk_string : cdebug << "ArgOut->In" << argin0 + i << " : " @@ -1466,10 +1526,22 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << " Value(string) " << OutParametersList[argout0 + i].Name.c_str() << endl ; break ; - case CORBA::tk_double : + case CORBA::tk_boolean: cdebug << "ArgOut->In" << argin0 + i << " : " << InParametersList[argin0 + i].Name.c_str() - << " Value(double) " + << " Value(boolean) " + << OutParametersList[argout0 + i].Name.c_str() << endl ; + break ; + case CORBA::tk_char: + cdebug << "ArgOut->In" << argin0 + i << " : " + << InParametersList[argin0 + i].Name.c_str() + << " Value(char) " + << OutParametersList[argout0 + i].Name.c_str() << endl ; + break ; + case CORBA::tk_short: + cdebug << "ArgOut->In" << argin0 + i << " : " + << InParametersList[argin0 + i].Name.c_str() + << " Value(short) " << OutParametersList[argout0 + i].Name.c_str() << endl ; break ; case CORBA::tk_long : @@ -1478,6 +1550,12 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << " Value(long) " << OutParametersList[argout0 + i ].Name.c_str() << endl ; break ; + case CORBA::tk_double : + cdebug << "ArgOut->In" << argin0 + i << " : " + << InParametersList[argin0 + i].Name.c_str() + << " Value(double) " + << OutParametersList[argout0 + i].Name.c_str() << endl ; + break ; case CORBA::tk_objref : cdebug << "ArgOut->In" << argin0 + i << " : " << InParametersList[argin0 + i].Name.c_str() @@ -1490,7 +1568,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { << " Value(other) ERROR " << OutParametersList[argout0 + i].Name.c_str() << endl ; } -//#endif +#endif } } if ( !StsPyDynInvoke ) { @@ -1738,9 +1816,9 @@ int GraphExecutor::InNode::Executing_SuccessAction() { // cdebug << ThreadNo() << " --> Executing_SuccessAction " << Name() << endl; _OutNode->PushEvent( this , GraphExecutor::SuccessedExecutingEvent , GraphExecutor::SuccessedState ) ; - MESSAGE(pthread_self() << "Executor::InNode::Executing_SuccessAction of " << Name() - << " ControlState " << Automaton()->ControlStateName( ControlState() ) - << " AFTER execution ThreadNo " << ThreadNo() ) ; +// MESSAGE(pthread_self() << "Executor::InNode::Executing_SuccessAction of " << Name() +// << " ControlState " << Automaton()->ControlStateName( ControlState() ) +// << " AFTER execution ThreadNo " << ThreadNo() ) ; SUPERV::ControlState aControl = ControlState() ; switch ( aControl ) { case SUPERV::VoidState : { @@ -1826,50 +1904,58 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) { int j ; bool docdebug = false ; State( GraphExecutor::DataWaitingState ) ; +// cdebug << "SetWaitingStates " << Name() << " " << Automaton()->StateName( State() ) << endl ; for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) { GraphBase::InPort * anInPort = GetChangeNodeInPort( i ) ; - cdebug << "SetWaitingStates InPort " << Name() << "( " << anInPort->PortName() << " ) " - << anInPort->PortStatus() << " " << anInPort->State() << endl ; +// cdebug << "SetWaitingStates InPort " << Name() << "( " << anInPort->PortName() << " ) " +// << anInPort->PortStatus() << " " << anInPort->State() << endl ; // JR Debug 07.01.2005 : Close the Gates instead of open !!! if ( anInPort->IsGate() ) { // Loop : Close the doors GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ; if ( anOutPort ) { - CORBA::Any * anAny = new CORBA::Any() ; +//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ; + CORBA::Any anAny = CORBA::Any() ; // *anAny <<= (long ) 1 ; - *anAny <<= (long ) 0 ; +//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 0 ; + anAny <<= (long ) 0 ; anOutPort->Value( anAny ) ; - anInPort->State( SUPERV::WaitingState ) ; + anInPort->PortState( SUPERV::WaitingState ) ; +// delete anAny ; } } - else if ( anInPort->State() != SUPERV::WaitingState && + else if ( anInPort->PortState() != SUPERV::WaitingState && !anInPort->IsDataConnected() ) { if ( !docdebug ) { - cdebug << ThreadNo() - << " --> GraphExecutor::InNodeThreads::SetWaitingStates " << Name() << endl; +// cdebug << ThreadNo() +// << " --> GraphExecutor::InNodeThreads::SetWaitingStates " << Name() << endl; docdebug = true ; } if ( !anInPort->IsDataStream() ) { - anInPort->State( SUPERV::WaitingState ) ; + anInPort->PortState( SUPERV::WaitingState ) ; } } - cdebug << " --> " << Name() << "( " << anInPort->PortName() << " ) " - << anInPort->PortStatus() << " " << anInPort->State() << endl ; +// cdebug << " --> " << Name() << "( " << anInPort->PortName() << " ) " +// << anInPort->PortStatus() << " " << anInPort->State() << endl ; } for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) { GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ; +//JR 07.03.2005 Debug : Reset of Done flag in OutPorts !... : + if ( !anOutPort->IsDataStream() ) { + anOutPort->PortDone( false ) ; + } for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) { if ( !( IsGOTONode() && anOutPort->IsGate() ) && !( IsEndLoopNode() && ( anOutPort->IsGate() || anOutPort->IsLoop() ) ) && !anOutPort->IsDataStream() && !anOutPort->ChangeInPorts( j )->IsDataStream() && !anOutPort->ChangeInPorts( j )->IsExternConnected() ) { - cdebug << ThreadNo() - << " InNodeThreads::SetWaitingStates OutPort " - << Name() << "/" << anOutPort->ChangeInPorts( j )->NodeName() << "( " - << anOutPort->PortName() << " " << anOutPort->PortStatus() << " ) --> InPort " - << anOutPort->ChangeInPorts( j )->NodeName() << "( " - << anOutPort->ChangeInPorts( j )->PortName() << " " - << anOutPort->ChangeInPorts( j )->PortStatus() << " )" << endl; +// cdebug << ThreadNo() +// << " InNodeThreads::SetWaitingStates OutPort " +// << Name() << "/" << anOutPort->ChangeInPorts( j )->NodeName() << "( " +// << anOutPort->PortName() << " " << anOutPort->PortStatus() << " ) --> InPort " +// << anOutPort->ChangeInPorts( j )->NodeName() << "( " +// << anOutPort->ChangeInPorts( j )->PortName() << " " +// << anOutPort->ChangeInPorts( j )->PortStatus() << " )" << endl; GraphBase::ComputingNode * aToNode ; aToNode = _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() ) ; // JR 12.01.2005 : the OutPort linked to the InPort of a EndSwitchNode was changed so final @@ -1878,12 +1964,12 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) { strcmp( anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() , Name() ) ) { // After EndLoopNode or GOTONode the Input Ports of LoopNode or LabelNode have their values from // EndLoopNode or GOTONode. But if there is several nested loops we should re-establish. - cdebug << ThreadNo() - << " InNodeThreads::SetWaitingStates Node " << Name() << " " - << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << "( " - << anOutPort->ChangeInPorts( j )->GetOutPort()->PortName() << " ) != " - << Name() << " : Restored to " << anOutPort->NodeName() << "( " - << anOutPort->PortName() << " )" << endl ; +// cdebug << ThreadNo() +// << " InNodeThreads::SetWaitingStates Node " << Name() << " " +// << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << "( " +// << anOutPort->ChangeInPorts( j )->GetOutPort()->PortName() << " ) != " +// << Name() << " : Restored to " << anOutPort->NodeName() << "( " +// << anOutPort->PortName() << " )" << endl ; anOutPort->ChangeInPorts( j )->ChangeOutPort( anOutPort ) ; } GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) aToNode->GetInNode() ; @@ -1914,10 +2000,11 @@ int GraphExecutor::InNode::Successed_SuccessAction() { return 1; } +//JR 09.02.2005 : That complicated part of the code manages LOOPS and GOTO if ( IsGOTONode() || ( IsEndLoopNode() && GetNodeInLoop()->GetOutPort()->BoolValue() ) ) { - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() - << " SetWaitingStates " << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() +// << " SetWaitingStates " << endl ; const GraphBase::OutPort * aGateOutPort ; if ( IsGOTONode() ) { aGateOutPort = GetNodeOutGate() ; @@ -1933,23 +2020,26 @@ int GraphExecutor::InNode::Successed_SuccessAction() { for ( i = 0 ; i < aGateOutPort->InPortsSize() ; i++ ) { const GraphBase::InPort * anInPort = aGateOutPort->InPorts( i ) ; aLabelNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode " - << aLabelNode->Name() << " from port " << anInPort->PortName() << endl ; +// 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 GraphBase::OutPort * anOutPort = aLabelNode->GetChangeNodeInGate()->GetOutPort() ; if ( anOutPort ) { - CORBA::Any * anAny = new CORBA::Any() ; - *anAny <<= (long ) 1 ; +//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ; + CORBA::Any anAny = CORBA::Any() ; +//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 1 ; + anAny <<= (long ) 1 ; anOutPort->Value( anAny ) ; - aLabelNode->GetChangeNodeInGate()->State( SUPERV::ReadyState ) ; + aLabelNode->GetChangeNodeInGate()->PortState( SUPERV::ReadyState ) ; +// delete anAny ; } for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) { const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ; if ( anInPort->GetOutPort() ) { - cdebug << aLabelNode->Name() << "(" << anInPort->PortName() << ") value : " - << anInPort->GetOutPort()->NodeName() << "(" << anInPort->GetOutPort()->PortName() << ")" - << endl ; +// cdebug << aLabelNode->Name() << "(" << anInPort->PortName() << ") value : " +// << anInPort->GetOutPort()->NodeName() << "(" << anInPort->GetOutPort()->PortName() << ")" +// << endl ; } } for ( j = 0 ; j < GetNodeOutPortsSize() ; j++ ) { @@ -1979,8 +2069,8 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( firsttoNode == NULL && aLabelNode->ThreadNo() == pthread_self() ) { firsttoNode = aLabelNode ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " - << aLabelNode->Name() << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " +// << aLabelNode->Name() << endl ; } else if ( firstzeroNode == NULL && aLabelNode->ThreadNo() == 0 ) { @@ -1988,24 +2078,25 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } else { SomeDataNodes.push_back( aLabelNode ) ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " - << aLabelNode->Name() << " " << SomeDataNodes.size() - << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " +// << aLabelNode->Name() << " " << SomeDataNodes.size() +// << endl ; } } - for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) { - const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ; - if ( anInPort->GetOutPort() ) { - cdebug << aLabelNode->Name() << "(" << anInPort->PortName() << ") value : " - << anInPort->GetOutPort()->NodeName() << "(" << anInPort->GetOutPort()->PortName() << ")" - << endl ; - } - } +// for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) { +// const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ; +// if ( anInPort->GetOutPort() ) { +// cdebug << aLabelNode->Name() << "(" << anInPort->PortName() << ") value : " +// << anInPort->GetOutPort()->NodeName() << "(" << anInPort->GetOutPort()->PortName() << ")" +// << endl ; +// } +// } const GraphBase::InPort * aGateInPort = aLabelNode->GetNodeInGate() ; if ( aGateInPort ) { if ( aGateInPort->GetOutPort() ) { - aGateInPort->GetOutPort()->Value( aGateOutPort->Value() ) ; +//JR 21.02.2005 Debug Memory leak : aGateInPort->GetOutPort()->Value( aGateOutPort->Value() ) ; + aGateInPort->GetOutPort()->Value( *aGateOutPort->Value() ) ; } if ( !aLabelNode->IsLockedDataWait() ) { res = aLabelNode->SendSomeDataReady( Name() ) ; @@ -2013,8 +2104,8 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( firsttoNode == NULL && aLabelNode->ThreadNo() == pthread_self() ) { firsttoNode = aLabelNode ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " - << aLabelNode->Name() << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " +// << aLabelNode->Name() << endl ; } else if ( firstzeroNode == NULL && aLabelNode->ThreadNo() == 0 ) { @@ -2022,9 +2113,9 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } else { SomeDataNodes.push_back( aLabelNode ) ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " - << aLabelNode->Name() << " " << SomeDataNodes.size() - << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " +// << aLabelNode->Name() << " " << SomeDataNodes.size() +// << endl ; } } } @@ -2037,6 +2128,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } } +// JR 09.02.2005 : this is not a EndLoop or a GOTO : else { cdebug << ThreadNo() << " Successed_SuccessAction of " << Name() << " with " << LinkedNodesSize() << " linked nodes :" ; @@ -2048,25 +2140,31 @@ int GraphExecutor::InNode::Successed_SuccessAction() { } cdebug << endl; for ( i = 0 ; i < LinkedNodesSize() ; i++ ) { +// If this is a LoopNode and if DoLoopPort == false, we go directly to the EndOfLoopNode and +// we do not activate Nodes within the loop bool IgnoreForEndLoop = false ; +// If this is a SwitchNode and if DefaultOutPort == true, we may activate Nodes within Switch +// or we may activate directly the EnSwitch +// BUT the NotSwitchBranch(es) are NOT activated : + bool IgnoreForDefaultSwitch = false ; GraphBase::ComputingNode * aComputingNode ; aComputingNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ; toNode = (GraphExecutor::InNode *) aComputingNode->GetInNode() ; cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction of " << Name() - << " [" << i << "] " << LinkedNodes( i )->Name() << " toNode " << toNode << " IgnoreForEndLoop " - << IgnoreForEndLoop ; + << " [" << i << "] " << LinkedNodes( i )->Name() << " toNode " << toNode + << " IgnoreForEndLoop " << IgnoreForEndLoop ; if ( toNode ) { cdebug << " " << toNode->Kind() << endl ; } if ( toNode && !toNode->IsDataFlowNode() ) { if ( IsComputingNode() && toNode->IsInLineNode() ) { GraphBase::InPort * toGateInPort = toNode->GetChangeNodeInGate() ; - toGateInPort->State( SUPERV::ReadyState ) ; + toGateInPort->PortState( SUPERV::ReadyState ) ; GraphBase::OutPort * GateOutPort = toGateInPort->GetOutPort() ; if ( GateOutPort ) { GateOutPort->PortStatus( DataConnected ); - GateOutPort->State( SUPERV::ReadyState ) ; - GateOutPort->Done( true ) ; + GateOutPort->PortState( SUPERV::ReadyState ) ; + GateOutPort->PortDone( true ) ; } } } @@ -2079,13 +2177,17 @@ int GraphExecutor::InNode::Successed_SuccessAction() { else { // toNode is the EndLoopNode GraphBase::InPort * toLoopInPort ; toLoopInPort = toNode->GetChangeNodeInLoop() ; - if ( toLoopInPort->State() != SUPERV::ReadyState ) { - toLoopInPort->State( SUPERV::ReadyState ) ; + if ( toLoopInPort->PortState() != SUPERV::ReadyState ) { + toLoopInPort->PortState( SUPERV::ReadyState ) ; } } } } else if ( toNode && IsSwitchNode() ) { + const GraphBase::OutPort * anOutGatePort = GetNodeOutGate() ; + if ( anOutGatePort->BoolValue() && anOutGatePort->InPortsSize() ) { // DefaultPort is activated + IgnoreForDefaultSwitch = true ; + } } else if ( toNode && toNode->IsInLineNode() ) { int j ; @@ -2096,67 +2198,160 @@ int GraphExecutor::InNode::Successed_SuccessAction() { if ( toNode && !IgnoreForEndLoop ) { if ( toNode && toNode->IsLoopNode() ) { GraphBase::InPort * toLoopInPort = toNode->GetChangeNodeInLoop() ; - toLoopInPort->State( SUPERV::ReadyState ) ; + toLoopInPort->PortState( SUPERV::ReadyState ) ; GraphBase::OutPort * LoopOutPort = toLoopInPort->GetOutPort() ; LoopOutPort->PortStatus( DataConnected ); - LoopOutPort->State( SUPERV::ReadyState ) ; - LoopOutPort->Done( true ) ; - CORBA::Any * anAny = new CORBA::Any() ; // InitLoop - *anAny <<= (long ) 1 ; + LoopOutPort->PortState( SUPERV::ReadyState ) ; + LoopOutPort->PortDone( true ) ; +//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ; // InitLoop + CORBA::Any anAny = CORBA::Any() ; // InitLoop +//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 1 ; + anAny <<= (long ) 1 ; LoopOutPort->Value( anAny ) ; +// delete anAny ; int j ; for ( j = 0 ; j < toNode->GetNodeInPortsSize() ; j++ ) { toNode->GetChangeNodeInPort( j )->InitialOutPort() ; } } - 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 << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode " - << toNode->Name() << endl ; - } - else if ( firstzeroNode == NULL && - toNode->ThreadNo() == 0 ) { - firstzeroNode = toNode ; +// If the DefaultPort of that SwitchNode is connected to the DefaultPort od the EndSwitchNode +// the NotSwitchBranch(es) are NOT activated : +// If the DefaultPort of that SwitchNode is connected to SwitchBranch(es) +// the NotSwitchBranch(es) are NOT activated : + bool activatetoNode = true ; + if ( IgnoreForDefaultSwitch ) { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction search " + << toNode->Name() << " among linked nodes to DefaultPort of " << Name() << endl ; + activatetoNode = false ; + const GraphBase::OutPort * anOutGatePort = GetNodeOutGate() ; + const GraphBase::InPort * anInPort = NULL ; + int j ; + for ( j = 0 ; j < anOutGatePort->InPortsSize() ; j++ ) { + anInPort = anOutGatePort->InPorts( j ) ; + const GraphBase::ComputingNode * aNode ; + aNode = _OutNode->Graph()->GetGraphNode( anInPort->NodeName() ) ; + if ( aNode ) { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction try " + << aNode << " " << aNode->Name() << " == " << toNode << " " << toNode->Name() + << endl ; + } + if ( aNode && (const GraphBase::ComputingNode * ) toNode->ComputingNode() == aNode ) { +// toNode is connected to the DefaultPort of that SwitchNode : + activatetoNode = true ; + break ; + } } - else { - SomeDataNodes.push_back( toNode ) ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push " - << toNode->Name() << " " << SomeDataNodes.size() << endl ; +// if ( activatetoNode ) { +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction found " +// << toNode->Name() << " among linked nodes to DefaultPort of " << Name() +// << endl ; +// } +// else { +// cdebug << pthread_self() << "/" << ThreadNo() +// << " Successed_SuccessAction does NOT found " +// << toNode->Name() << " among linked nodes to DefaultPort of " << Name() +// << endl ; +// } + } + if ( activatetoNode ) { +// 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 << pthread_self() << "/" << ThreadNo() +// << " Successed_SuccessAction firsttoNode " << toNode->Name() << endl ; + } + else if ( firstzeroNode == NULL && + toNode->ThreadNo() == 0 ) { + firstzeroNode = toNode ; + } + else { + SomeDataNodes.push_back( toNode ) ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " +// << Name() << " push " +// << toNode->Name() << " " << SomeDataNodes.size() << endl ; + } } } } } } +//JR 10.02.2005 : Debug at the end of execution of a SwitchNode : +// Here after we may start execution of only one SwitchBranch or of the Default +// But with activation of only one SwitchBranch we may activate several nodes of that SwitchBranch and +// we may activate several nodes of NotSwitchBranch ( a NotSwitchBranch is a Branch of the Switch +// where GatePorts of Nodes are not connected ; that Branches are always executed for each of SwitchBranch +// BUT are not executed when Default is activated). +// So the bug is that all input ports of the corresponding EndSwitchNode must have the status NOTDONE ! +// (Only if Default OutPort is closed and Default InPort is closed) + if ( IsSwitchNode() ) { + GraphBase::InLineNode * anEndSwitchNode = GOTONode()->CoupledNode() ; + if ( !GetNodeOutGate()->BoolValue() && anEndSwitchNode->GetNodeInGate()->GetOutPort() && + !anEndSwitchNode->GetNodeInGate()->GetOutPort()->BoolValue() ) { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << anEndSwitchNode->Name() + << " reset of InPort()->OutPort()->Done flag in EndSwitch" << endl ; + int i ; + for ( i = 0 ; i < anEndSwitchNode->GetNodeInPortsSize() ; i++ ) { + GraphBase::OutPort * anOutPort = anEndSwitchNode->GetChangeNodeInPort( i )->GetOutPort() ; +//JR 08.03.2005 Debug : update of state only if not a StreamPort + if ( anOutPort && strcmp( anOutPort->NodeName() , Name() ) && + !anOutPort->IsDataStream() ) { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " + << anEndSwitchNode->Name() << " InPort " + << anEndSwitchNode->GetChangeNodeInPort( i )->PortName() << " NOTDONE from " + << anOutPort->NodeName() << " " << anOutPort->PortName() << endl ; + anEndSwitchNode->GetChangeNodeInPort( i )->PortState( SUPERV::WaitingState ) ; + anEndSwitchNode->GetChangeNodeInPort( i )->GetOutPort()->PortDone( false ) ; + } + else { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " + << anEndSwitchNode->Name() << " InPort " + << anEndSwitchNode->GetChangeNodeInPort( i )->PortName() << " NOT Changed : directly from " + << anOutPort->NodeName() << " " << anOutPort->PortName() << endl ; + } + } + } + else { + cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() + << " " << Kind() << " OutGate->Value " << GetNodeOutGate()->BoolValue() + << " NO reset of InPort()->OutPort()->Done flag in EndSwitch" << endl ; + } + } + +// firsttoNode : node that has the same ThreadNo() as the current node and that have to be activated +// firstzeroNode : node that has a null ThreadNo() and that have to be activated if ( firsttoNode == NULL && firstzeroNode ) { firsttoNode = firstzeroNode ; - cdebug << pthread_self() << "/" << ThreadNo() - << " Successed_SuccessAction firsttoNode = firstzeroNode " - << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() +// << " Successed_SuccessAction firsttoNode = firstzeroNode " << firsttoNode->Name() +// << endl ; } else if ( firsttoNode && firstzeroNode ) { SomeDataNodes.push_back( firstzeroNode ) ; - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode " - << firstzeroNode->Name() << " " << SomeDataNodes.size() << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode " +// << firstzeroNode->Name() << " " << SomeDataNodes.size() << endl ; + firstzeroNode = NULL ; } else { - cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode - << " firstzeroNode " << firstzeroNode << endl ; +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode +// << " firstzeroNode " << firstzeroNode << endl ; } while ( SomeDataNodes.size() ) { GraphExecutor::InNode *aNode = SomeDataNodes.front() ; SomeDataNodes.pop_front() ; // cdebug << pthread_self() << "/" << ThreadNo() -// << " Successed_SuccessAction pop " +// << " Successed_SuccessAction pop size " // << SomeDataNodes.size() << " " << aNode->Name() << endl ; if ( aNode->State() == GraphExecutor::DataReadyState ) { +// cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction pop CreateNewThreadIf( true )" +// << endl ; aNode->CreateNewThreadIf( true ) ; + _OutNode->IncrCreatedThreads() ; aNode->UnLockDataWait() ; res = aNode->DataUndef_AllDataReadyAction() ; } @@ -2223,8 +2418,8 @@ int GraphExecutor::InNode::Successed_SuccessAction() { bool GraphExecutor::InNode::SendSomeDataReady( char * FromNodeName ) { bool RetVal = false ; if ( IsDataFlowNode() ) { - cdebug << ThreadNo() << "InNode::SendSomeDataReady ----> " << Name() - << " send Result to graph " << Name() << endl; +// cdebug << ThreadNo() << "InNode::SendSomeDataReady ----> " << Name() +// << " send Result to graph " << Name() << endl; } else { // cdebug << pthread_self() << "/" << ThreadNo() << " ----> " << FromNodeName @@ -2368,7 +2563,7 @@ int GraphExecutor::InNode::SuspendedSuccessed_ReStartAction() { GraphExecutor::ReStartedState ) ; int i ; for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) { - GetChangeNodeInPort( i )->State( SUPERV::ReadyState ) ; + GetChangeNodeInPort( i )->PortState( SUPERV::ReadyState ) ; } SendEvent( ExecuteEvent ) ; cdebug << ThreadNo() << " SuspendedSuccessed_ReStartAction " << Name() << endl; @@ -2381,7 +2576,7 @@ int GraphExecutor::InNode::SuspendedErrored_ReStartAction() { GraphExecutor::ReStartedState ) ; int i ; for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) { - GetChangeNodeInPort( i )->State( SUPERV::ReadyState ) ; + GetChangeNodeInPort( i )->PortState( SUPERV::ReadyState ) ; } SendEvent( ExecuteEvent ) ; cdebug << ThreadNo() << " SuspendedErrored_ReStartAction " << Name() << endl; @@ -2432,7 +2627,7 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , int nInParams , ServicesAnyData * InParametersList ) { int i ; - cdebug << ThreadNo() << " InParametersSet " << Name() << endl ; + cdebug << pthread_self() << "/" << ThreadNo() << " InParametersSet " << Name() << endl ; for ( i = 0 ; i < nInParams ; i++ ) { ServicesAnyData D = InParametersList[i]; GraphBase::InPort * anInPort = GetChangeNodeInPort(i) ; @@ -2442,23 +2637,29 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , << anInPort->GetServicesParameter().Parametertype << " is inactive. " << anInPort->Kind() << endl ; } - else if ( anInPort->State() == SUPERV::ReadyState ) { + else if ( anInPort->PortState() == SUPERV::ReadyState ) { if ( anInPort->IsGate() ) { - CORBA::Any * anAny = new CORBA::Any() ; - *anAny <<= (long ) 0 ; +//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ; + CORBA::Any anAny = CORBA::Any() ; +//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 0 ; + anAny <<= (long ) 0 ; theOutPort->Value( anAny ) ; +// delete anAny ; } if ( !anInPort->IsDataStream() && !anInPort->IsDataConnected() ) { - anInPort->State( SUPERV::WaitingState ) ; + anInPort->PortState( SUPERV::WaitingState ) ; } - D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ; +//JR 18.02.2005 Debug Memory leak : delete does not destroy that string ... +// D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ; + D.Name = anInPort->PortName() ; cdebug << ThreadNo() << " ArgIn" << i << " " << anInPort->Kind() - << " " << anInPort->State() ; - cdebug << " " << D.Name << " " << anInPort->GetServicesParameter().Parametertype << " : " ; + << " " << anInPort->PortState() ; + cdebug << " " << D.Name << " " << anInPort->GetServicesParameter().Parametertype << " : " << endl ; D.Value = *theOutPort->Value() ; // CORBA::Any - string _Type = CORBA::string_dup( anInPort->GetServicesParameter().Parametertype ) ; - const char * Type = _Type.c_str() ; +//JR 18.02.2005 Debug Memory leak : string _Type = CORBA::string_dup( anInPort->GetServicesParameter().Parametertype ) ; +// const char * Type = _Type.c_str() ; + const char * Type = anInPort->GetServicesParameter().Parametertype ; switch ( D.Value.type()->kind() ) { // { string , long , double , objref } case CORBA::tk_string: char * t; @@ -2710,8 +2911,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , } else { cdebug << ThreadNo() << " In" << i << " : wrong state ERROR State " - << anInPort->State() << " NameState " - << Automaton()->StateName( anInPort->State() ) << " PortName " + << anInPort->PortState() << " NameState " + << Automaton()->StateName( anInPort->PortState() ) << " PortName " << anInPort->PortName() << " Parametername " << anInPort->GetServicesParameter().Parametername << endl ; Err = true ; @@ -2722,16 +2923,19 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , void GraphExecutor::InNode::InOutParametersSet( int nOutParams , ServicesAnyData * OutParametersList ) { + cdebug << pthread_self() << "/" << ThreadNo() << " InOutParametersSet " << Name() << endl ; int i ; for ( i = 0 ; i < nOutParams ; i++ ) { ServicesAnyData D = OutParametersList[i] ; - D.Name = GetChangeNodeOutPort(i)->GetServicesParameter().Parametername; - string _Type = CORBA::string_dup(GetChangeNodeOutPort(i)->GetServicesParameter().Parametertype) ; - const char * Type = _Type.c_str() ; - bool OutDone = GetChangeNodeOutPort(i)->Done() ; - cdebug << ThreadNo() << " ArgOut" << i << " " << D.Name << " Done(" - << OutDone << ") " << Type << " : " << endl ; +//JR 18.02.2005 Debug Memory leak : delete does not destroy that string ... +// D.Name = CORBA::string_dup(GetChangeNodeOutPort(i)->GetServicesParameter().Parametername); + D.Name = GetChangeNodeOutPort(i)->PortName() ; +//JR 18.02.2005 Debug Memory leak : string _Type = CORBA::string_dup(GetChangeNodeOutPort(i)->GetServicesParameter().Parametertype) ; + const char * Type = GetChangeNodeOutPort(i)->GetServicesParameter().Parametertype ; + bool OutDone = GetChangeNodeOutPort(i)->PortDone() ; + cdebug << ThreadNo() << " ArgOut" << i << " " << D.Name << " PortDone( " << OutDone << " ) Type : " + << Type << endl ; if ( !strcmp( Type , "string" ) ) { D.Value <<= (char *) NULL ; } @@ -2761,7 +2965,7 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams , else { D.Value <<= CORBA::Object::_nil() ; } -//#if 0 +#if 0 switch (D.Value.type()->kind()) { // { string , long , double , objref } case CORBA::tk_string: char * t; @@ -2813,32 +3017,33 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams , default: cdebug << ThreadNo() << " " << "(other ERROR)" << endl ; } -//#endif +#endif OutParametersList[i] = D ; } } bool GraphExecutor::InNode::OutParametersSet( bool Err , - SUPERV::GraphState NewState , + SUPERV::GraphState PortState , int nOutParams , ServicesAnyData * OutParametersList ) { bool RetVal = true ; int i ; GraphBase::OutPort * aGateOutPort = NULL ; bool OrSwitch = false ; - cdebug_in << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState " - << NewState << endl ; -// cout << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState " << NewState << endl ; + bool DefaultSwitch = false ; + cdebug_in << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewPortState " + << PortState << endl ; +// cout << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewPortState " << PortState << endl ; if ( nOutParams && !IsMacroNode() ) { GraphBase::OutPort * anOutPort ; for ( i = 0 ; i < nOutParams ; i++ ) { anOutPort = GetChangeNodeOutPort(i) ; if ( Err ) { - anOutPort->State( NewState ) ; - anOutPort->Done( true ) ; + anOutPort->PortState( PortState ) ; + anOutPort->PortDone( true ) ; } else { - cdebug << ThreadNo() << " " << "Out" << i << " " << Name() << " " + cdebug << ThreadNo() << "OutParametersSet " << "Out" << i << " " << Name() << " " << anOutPort->PortName() << " " << anOutPort->Kind() ; ServicesAnyData D = OutParametersList[i] ; switch (D.Value.type()->kind()) { // { string , long , double , objref } @@ -2922,33 +3127,50 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , cdebug << " Loop " ; anOutPort->Value( OutParametersList[i].Value ); // InLoop Port of EndLoopNode is ready : - anOutPort->ChangeInPorts(0)->State( SUPERV::ReadyState ) ; + anOutPort->ChangeInPorts(0)->PortState( SUPERV::ReadyState ) ; } else if ( anOutPort->IsSwitch() ) { cdebug << " Switch " ; anOutPort->Value( OutParametersList[i].Value ); if ( anOutPort->InPortsSize() && anOutPort->ChangeInPorts( 0 )->IsGate() ) { +//JR 09.02.2005 : OrSwitch is the OR of all SwitchBranches : +//It controls that there is only one SwitchBranch activated +//If it's final value is false ==> activation of the Default to GOTO to EndSwitchNode +//DefaultSwitch is true if a SwitchPort is linked to the DefaultPort of the EndSwitchNode if ( OrSwitch && anOutPort->BoolValue() ) { cdebug << "GraphExecutor::InNodeThreads::OutParameters more than one switch is true ERROR" << endl ; RetVal = false ; } - else { - OrSwitch = OrSwitch | anOutPort->BoolValue() ; - cdebug << "InNodeThreads::OutParameters OrSwitch = true" << endl ; + else if ( anOutPort->BoolValue() ) { +//JR 09.02.2005 Debug : case of a SwitchPort linked to the DefaultPort of the EndSwitchNode : + if ( !strcmp( anOutPort->ChangeInPorts( 0 )->NodeName() , GOTONode()->CoupledNodeName() ) ) { + DefaultSwitch = anOutPort->BoolValue() ; + } + else { + OrSwitch = OrSwitch | anOutPort->BoolValue() ; + } + cdebug << "InNodeThreads::OutParameters OrSwitch " << OrSwitch << "DefaultSwitch " + << DefaultSwitch << endl ; } } - cdebug << "OutParametersSet OrSwitch " << OrSwitch ; } else { cdebug << " Param " ; anOutPort->Value( OutParametersList[i].Value ); } - anOutPort->State( NewState ) ; - anOutPort->Done( true ) ; + anOutPort->PortState( PortState ) ; + anOutPort->PortDone( true ) ; } + cdebug << "OutParametersSet OrSwitch " << OrSwitch << "DefaultSwitch " + << DefaultSwitch << endl ; int j ; for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) { + cdebug << ThreadNo() << "OutParametersSet " << "Out" << i << " " << Name() << " " + << anOutPort->PortName() << " " << anOutPort->Kind() << " --> " + << anOutPort->ChangeInPorts( j )->NodeName() << "( " + << anOutPort->ChangeInPorts( j )->PortName() << anOutPort->ChangeInPorts( j )->Kind() + << " )" << endl ; bool fromGOTO = false ; const char * ToNodeName = anOutPort->ChangeInPorts( j )->NodeName() ; if ( !strcmp( ToNodeName , _OutNode->Graph()->Name() ) && _OutNode->Graph()->GraphMacroLevel() != 0 ) { @@ -2964,7 +3186,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , GraphBase::ComputingNode * ToNode = _OutNode->Graph()->GetChangeGraphNode( ToNodeName ) ; if ( ToNode ) { // cout << "OutParametersSet ToNodeName " << ToNodeName << endl ; - cdebug << "OutParametersSet ToNodeName " << ToNodeName << " " << ToNode->Name() << endl ; +// cdebug << "OutParametersSet ToNodeName " << ToNodeName << " " << ToNode->Name() << endl ; GraphBase::OutPort * aGOTOPort = ToNode->GetChangeNodeInGate()->GetOutPort() ; if ( aGOTOPort ) { fromGOTO = aGOTOPort->IsGOTO() ; @@ -2972,12 +3194,13 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , if ( anOutPort->ChangeInPorts( j )->IsEndSwitch() || fromGOTO ) { cdebug << anOutPort->ChangeInPorts( j )->NodeName() << "(" << anOutPort->ChangeInPorts( j )->PortName() << "," - << anOutPort->ChangeInPorts( j )->Kind() << ") WILL BE changed from " + << anOutPort->ChangeInPorts( j )->Kind() << ") CHANGED from " << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << "(" << anOutPort->ChangeInPorts( j )->GetOutPort()->PortName() - << ") to " << anOutPort->NodeName() << "(" - << anOutPort->PortName() << ")" << endl ; + << " to " << anOutPort->ChangeInPorts( j )->GetOutPort()->Kind() + << ") : Done " << anOutPort->PortDone() << " State " + << Automaton()->StateName( anOutPort->ChangeInPorts( j )->PortState() ) << endl ; anOutPort->ChangeInPorts( j )->ChangeOutPort( anOutPort ) ; } else { @@ -2987,13 +3210,13 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << "(" << anOutPort->ChangeInPorts( j )->GetOutPort()->PortName() - << ") to " << anOutPort->NodeName() << "(" - << anOutPort->PortName() << ")" << endl ; + << " " << anOutPort->ChangeInPorts( j )->GetOutPort()->Kind() + << ") " << endl ; } } } } -//#if 0 +#if 0 switch (anOutPort->Value()->type()->kind()) { case CORBA::tk_string: char * t; @@ -3048,35 +3271,57 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , cdebug << ThreadNo() << " Out" << i << " : " << "(other ERROR)" << endl ; RetVal = false ; } -//#endif +#endif } } if ( aGateOutPort && IsSwitchNode() ) { - if ( OrSwitch ) { +//JR 09.02.2005 : OrSwitch is the OR of all SwitchBranches : +//It controls that there is only one SwitchBranch activated +//If it's final value is false ==> activation of the Default to GOTO to EndSwitchNode +//DefaultSwitch is true if a SwitchPort (SwitchBranch) is linked to the DefaultPort of the EndSwitchNode + if ( !OrSwitch && !DefaultSwitch ) { + if ( aGateOutPort->InPortsSize() && aGateOutPort->ChangeInPorts( 0 ) ) { + cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of " + << aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " WITH DefaultPort" << endl ; + long l = 1; + OutParametersList[0].Value <<= l ; + aGateOutPort->Value( OutParametersList[0].Value ) ; + } + else { + cdebug << ThreadNo() << " " << "Out0 " << Name() << " " + << aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " NOT CONNECTED ERROR" << endl ; + RetVal = false ; + } + } + else { cdebug << ThreadNo() << " " << "Out0 " << Name() << " Close of " - << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; + << aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " NO DefaultPort" + << " OrSwitch " << OrSwitch << " DefaultSwitch " << DefaultSwitch << endl ; long l = 0; OutParametersList[0].Value <<= l ; aGateOutPort->Value( OutParametersList[0].Value ) ; } - else { - cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of " - << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ; - long l = 1; - OutParametersList[0].Value <<= l ; - aGateOutPort->Value( OutParametersList[0].Value ) ; + if ( !OrSwitch || DefaultSwitch ) { // DefaultPort or DefaultSwitch int i ; for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) { GraphBase::InPort * anInPort ; anInPort = CoupledNode()->GetChangeInPort( GetNodeOutPort( i )->PortName() ) ; - if ( anInPort ) { +//JR 16.02.2005 Debug : Change InPorts of EndSwitchNode that have the same name as an OutPort of +// the SwitchNode even if it is the DefaultPort : GraphSwitchCheckDefault1.xml +// if ( anInPort && !anInPort->IsGate() ) { + if ( anInPort && anInPort->GetOutPort() ) { + cdebug << "OutParametersSet " << Name() << " " << anInPort->NodeName() << "( " + << anInPort->PortName() << " ) linked from " << anInPort->GetOutPort()->NodeName() + << "( " << anInPort->GetOutPort()->PortName() << " ) CHANGED TO linked from " + << GetChangeNodeOutPort( i )->NodeName() << "( " + << GetChangeNodeOutPort( i )->PortName() << " )" << endl ; anInPort->ChangeOutPort( GetChangeNodeOutPort( i ) ) ; } } } } } - cdebug_out << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState " - << NewState << " RetVal " << RetVal << endl ; + cdebug_out << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewPortState " + << PortState << " RetVal " << RetVal << endl ; return RetVal ; } -- 2.39.2