Salome HOME
PAL8624
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_OutNode.cxx
index db8a488724bd3b2a6788bdfff0481b8d65a31574..0518ce365aed550ac282fd1287f732bf6505c246 100644 (file)
@@ -50,6 +50,7 @@ GraphExecutor::OutNode::OutNode() {
   _Valid = false ;
   _Executable = false ;
   _Done = false ;
+  _NodeAborted = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
@@ -71,17 +72,15 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
                                  const char *DataFlowName ,
                                  const char * DebugFileName ,
                                  const SUPERV::KindOfNode aKindOfNode ) {
-//               Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) {
   Set_prof_debug( ORB , DebugFileName ) ;
-  cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowName << " , " << aKindOfNode << ")" << endl;
+  cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowName << " , " << DebugFileName
+            << " , " << aKindOfNode << ")" << endl;
   if ( aKindOfNode == SUPERV::DataFlowGraph ) {
     _StreamGraph = NULL ;
-//    _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;
     _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , aKindOfNode ,
                                    _prof_debug , _fdebug ) ;
   }
   else if ( aKindOfNode == SUPERV::DataStreamGraph ) {
-//    _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;;
     _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , aKindOfNode ,
                                                _prof_debug , _fdebug ) ;
     _Graph = _StreamGraph ;
@@ -92,6 +91,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _Valid = false ;
   _Executable = false ;
   _Done = false ;
+  _NodeAborted = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
@@ -124,14 +124,11 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
                                  const char * DataFlowComputer ,
                                  const char * DataFlowComment ,
                                  const char * DebugFileName ) {
-//                                 Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
-//                                        DataFlowInterfaceName , DataFlowName , DataFlowkind ,
-//                                        DataFlowFirstCreation , DataFlowLastModification  ,
-//                                        DataFlowEditorRelease , DataFlowAuthor ,
-//                                        DataFlowComputer , DataFlowComment , DebugFileName ) {
   Set_prof_debug( ORB , DebugFileName ) ;
 
-  cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowName << " , " << DataFlowkind << ")" << endl;
+  cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowComponentName << " , "
+            << DataFlowInterfaceName << " , " << DataFlowName << " , " << DataFlowkind << ")"
+            << " , ... , " << DebugFileName << ")" << endl;
   if ( DataFlowkind == SUPERV::DataFlowGraph ) {
     _StreamGraph = NULL ;
     _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName ,
@@ -157,6 +154,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _Valid = false ;
   _Executable = false ;
   _Done = false ;
+  _NodeAborted = false ;
   _Threads = 0 ;
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
@@ -200,7 +198,7 @@ bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph * aDataFlow )
         if ( RetVal ) {
           IsValid() ;
           RetVal = LoadDatas( (*aDataFlow).Datas ) ;
-          IsExecutable() ;
+//          IsExecutable() ;
           if ( !RetVal) {
             cdebug << "GraphExecutor::OutNode::LoadDataFlow LoadDatas Error."
                    << endl ;
@@ -224,7 +222,7 @@ bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph * aDataFlow )
   else {
     cdebug << "GraphExecutor::OutNode::LoadDataFlow ServiceName Error." << endl ;
   }
-  cdebug_out << "GraphExecutor::OutNode::LoadDataFlow " << Graph()->Name() << " RetVal "
+  cdebug_out << "GraphExecutor::OutNode::LoadDataFlow " << Name() << " RetVal "
              << RetVal << endl ;
   return RetVal ;
 }
@@ -389,18 +387,18 @@ bool GraphExecutor::OutNode::LoadDatas(const GraphBase::ListOfSLinks &aListOfDat
   int i ;
   for ( i = 0 ; i < (int ) aListOfDatas.size() ; i++ ) {
     GraphBase::SLink aLink = aListOfDatas[ i ] ;
-    if ( !strcmp( aLink.FromNodeName.c_str() , Graph()->Name() ) )
+    if ( !strcmp( aLink.FromNodeName.c_str() , Name() ) )
       RetVal = Graph()->AddInputData( aLink.ToNodeName.c_str() ,
                                       aLink.ToServiceParameterName.c_str() ,
                                       aLink.aLinkValue ) ;
-//    else if ( !strcmp( aLink.ToNodeName.c_str() , Graph()->Name() ) ) {
+//    else if ( !strcmp( aLink.ToNodeName.c_str() , Name() ) ) {
 //      RetVal = Graph()->AddOutputData( aLink.FromNodeName.c_str() ,
 //                                       aLink.FromServiceParameterName.c_str() ) ;
 //      Graph()->AddLink( aLink.FromNodeName.c_str() , (GraphBase::ComputingNode *) this ) ;
 //    }
     else {
       cdebug << "GraphExecutor::OutNode::LoadDatas Error " << aLink.FromNodeName
-           << " and " << aLink.ToNodeName << " differents from " << Graph()->Name()
+           << " and " << aLink.ToNodeName << " differents from " << Name()
            << endl ;
       RetVal = false ;
     }
@@ -445,7 +443,8 @@ GraphExecutor::InNode *GraphExecutor::OutNode::AddNode(
 
 bool GraphExecutor::OutNode::Valid() {
   cdebug_in << "GraphExecutor::OutNode::Valid" << endl;
-
+  bool RetVal = true ;
+  Graph()->ReSetMessages() ; // ==> Only one set of errors messages ...
   if ( _Valid )
     return true ;
 
@@ -453,12 +452,12 @@ bool GraphExecutor::OutNode::Valid() {
 
   if ( !Graph()->CreateService() ) {
     cdebug_out << "This DataFlow has invalid type(s)." << endl ;
-    return false ;
+    RetVal = false ;
   }
   int SubStreamGraphsNumber = 0 ;
   if ( !Graph()->Sort( SubStreamGraphsNumber ) ) {
     cdebug_out << "This DataFlow is not valid." << endl ;
-    return false ;
+    RetVal = false ;
   }
   if ( Graph()->IsDataStreamNode() ) {
     StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
@@ -467,35 +466,40 @@ bool GraphExecutor::OutNode::Valid() {
 
   if ( !Graph()->ValidLoops() ) {
     cdebug_out << "This DataFlow have not valid Loops." << endl ;
-    return false ;
+    RetVal = false ;
   }
   if ( !Graph()->ValidSwitchs() ) {
     cdebug_out << "This DataFlow have not valid Switchs." << endl ;
-    return false ;
+    RetVal = false ;
   }
 
 //  CreateService() ;
 
   Graph()->ComputingNodes() ;
-  
-  _Valid = true ;
+  if ( RetVal ) {
+    _Valid = true ;
+  }
 
-  cdebug_out << "GraphExecutor::OutNode::Valid " << _Valid << endl;
-  return _Valid ;
+  cdebug_out << "GraphExecutor::OutNode::Valid " << _Valid << " RetVal " << RetVal << endl;
+  return RetVal ;
 }
 
-
 bool GraphExecutor::OutNode::Executable() {
-
   cdebug_in << "GraphExecutor::OutNode::Executable" << endl;
-  if ( !IsValid() )
-    return false ;
+  bool RetVal = true ;
+  if ( !IsValid() ) {
+    RetVal = false ;
+  }
 
-  if ( Graph()->DataServerNodes() )
-    _Executable = true ;
+  if ( Graph()->DataServerNodes() ) {
+    if ( RetVal ) {
+      _Executable = true ;
+    }
+  }
   else {
     cdebug << "This DataFlow is not executable." << endl ;
     _Executable = false ;
+    RetVal = false ;
   }
 
   cdebug_out << "GraphExecutor::OutNode::Executable " << _Executable << endl;
@@ -547,7 +551,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
           Done( true ) ;
           cdebug_out << "GraphExecutor::OutNode::Run InitPythonFunctions ERROR "
                      << anInNode->Name() << endl ;
-          return false ;
+          RetVal = false ;
        }
       }
     }
@@ -571,13 +575,13 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
     */
     if ( Graph()->GraphMacroLevel() != 0 ) {
       cdebug << "GraphExecutor::OutNode::Run Execution starting GraphExecutor::Action_DataOk_RunService Node "
-             << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
+             << Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
       PushEvent( NULL , GraphExecutor::NoDataReadyEvent ,
                  GraphExecutor::DataUndefState ) ; 
     }
     else {
       cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node "
-             << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
+             << Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
       PushEvent( NULL , GraphExecutor::ReadyEvent ,
                  GraphExecutor::DataReadyState ) ; 
       State( GraphExecutor::DataReadyState ) ;
@@ -601,9 +605,11 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //        PushEvent( anInNode , GraphExecutor::ReadyEvent ,
 //                   GraphExecutor::DataReadyState ) ; 
 // We say that we have to create a thread for that HeadNode 'anInNode'
-        anInNode->CreateNewThread( true ) ;
-        IncrCreatedThreads() ;
-        anInNode->DataFromNode( Graph()->Name() ) ;
+        if ( !anInNode->IsMacroNode() ) {
+          anInNode->CreateNewThread( true ) ;
+          IncrCreatedThreads() ;
+       }
+        anInNode->DataFromNode( Name() ) ;
 // AndSuspend == true <==> Start()
         if ( AndSuspend ) {
           anInNode->State( GraphExecutor::DataWaitingState ) ;
@@ -635,6 +641,25 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
             cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
             return false ;
          }
+//JR 15.04.2005 Debug PAL8624 RetroConception :
+          anInNode->CreateNewThread( true ) ;
+          IncrCreatedThreads() ;
+          if ( anInNode->HasAllDataReady() ) {
+            if ( !anInNode->SendEvent( GraphExecutor::AllDataReadyEvent ) ) { // ==> Ready to execute
+              cdebug <<  "GraphExecutor::OutNode::Run SendEvent(AllDataReadyEvent) ERROR "
+                     << " Node " << anInNode->Name() << endl ;
+              cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
+              return false ;
+           }
+         }
+          else {
+            State( GraphExecutor::ErroredState ) ;
+            Done( true ) ;
+            cdebug <<  "GraphExecutor::OutNode::Run HasAllDataReady " << anInNode->HasAllDataReady()
+                   << " Node " << anInNode->Name() << endl ;
+            cdebug_out << "GraphExecutor::OutNode::Run HasAllDataReady ERROR" << endl ;
+            return false ;
+         }
           cdebug << pthread_self() << " GraphExecutor::OutNode::Run " << anInNode->Name() << "->RunningWait"
                  << endl ;
 // ==> We wait for RunningState
@@ -671,7 +696,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
         };
       }
 //      ostringstream astr ;
-//      astr << "Graph " << Graph()->Name() << " is running" ;
+//      astr << "Graph " << Name() << " is running" ;
 //      Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
       RetVal = true ;
     }
@@ -681,11 +706,24 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //JR 24.03.2005 debug : State and done flags were missing
     State( GraphExecutor::ErroredState ) ;
     Done( true ) ;
+//JR 17.06.2005 debug call to executed was missing ===>
+//              _GraphExecutingNumber field of FiniteStateMachine was not decremented ===>
+//              register of python functions was de-activated ==>
+//              two graphs execution with two different python functions with the same name
+//              give aborted state for the second one
+//Example : GraphLoopSwitchOfSwitchNOTValid, GraphLoopSwitchs and GraphLoopSwitchsBranches
+    if ( IsDone() ) {
+      cdebug << " ==> theAutomaton->Executed() " << endl ;
+      theAutomaton->Executed() ;
+    }
+    else {
+      cdebug << " NO theAutomaton->Executed() " << endl ;
+    }
     cdebug_out << "GraphExecutor::OutNode::Run Not Executable ERROR " << endl ;
     return false ;
   }
 
-  cdebug_out << pthread_self() << "GraphExecutor::OutNode::Run " << Graph()->Name()
+  cdebug_out << pthread_self() << "GraphExecutor::OutNode::Run " << Name()
              << " State " << theAutomaton->StateName( State() ) << " GraphMacroLevel "
              << Graph()->GraphMacroLevel() << " RetVal " << RetVal << endl ;
   return RetVal ;
@@ -706,7 +744,9 @@ void GraphExecutor::OutNode::CheckAllDone() {
       if ( InNodeState != GraphExecutor::SuccessedState &&
            InNodeState != GraphExecutor::ErroredState &&
            InNodeState != GraphExecutor::DataWaitingState ) {
-        AllDone = false ;
+        if ( !IsNodeAborted() ) {
+          AllDone = false ;
+       }
       }
       if ( InNodeState != GraphExecutor::SuccessedState &&
            InNodeState != GraphExecutor::DataWaitingState &&
@@ -746,7 +786,9 @@ void GraphExecutor::OutNode::CheckAllDone() {
                   aState == SUPERV::SuspendDoneState ||
                   aState == SUPERV::SuspendErroredState ||
                   aState == SUPERV::SuspendState ) {
-          alivenodes += 1 ;
+          if ( !IsNodeAborted() ) {
+            alivenodes += 1 ;
+         }
        }
         aNode->SuspendedAction() ;
         aNode->DoneAction() ;
@@ -757,7 +799,7 @@ void GraphExecutor::OutNode::CheckAllDone() {
         Done( true ) ;
         _JustStarted = false ;
       }
-      cdebug << Graph()->Name() << " alivenodes " << alivenodes << " OutNodeState " << OutNodeState
+      cdebug << Name() << " alivenodes " << alivenodes << " OutNodeState " << OutNodeState
              << endl ;
       PushEvent( NULL , GraphExecutor::EndExecuteEvent ,
                  OutNodeState ) ;
@@ -767,11 +809,11 @@ void GraphExecutor::OutNode::CheckAllDone() {
   }
   if ( IsDone() ) {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+    MESSAGE( Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
              << EventQSize() ) ;
     MESSAGE("================================================================================") ;
     cdebug << "================================================================================" << endl ;
-    cdebug << Graph()->Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+    cdebug << Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
              << EventQSize() << endl  ;
     cdebug << "================================================================================" << endl ;
 
@@ -792,7 +834,7 @@ void GraphExecutor::OutNode::CheckAllDone() {
     Graph()->GraphEditor()->Editing();
   }
   cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() << " this " << this << " "
-             << Graph()->Name() << " GraphAutomatonState "
+             << Name() << " GraphAutomatonState "
              << theAutomaton->StateName( AutomatonState() )
              << " State " << State() << " Threads " << _Threads << " SuspendedThreads "
              << _SuspendedThreads << " EventQSize " << EventQSize() << endl ;
@@ -890,9 +932,16 @@ void GraphExecutor::OutNode::ExitThread( pthread_t ThreadNumber ) {
   }
   if ( _Threads == 0 && _SuspendedThreads == 0 ) {
     CheckAllDone() ;
+    cdebug << pthread_self() << " ExitThread( " << ThreadNumber << " ) " << _Threads
+           << " running threads " << _SuspendedThreads << " suspended threads IsDone() "
+           << IsDone() ;
     if ( IsDone() ) {
+      cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
+    else {
+      cdebug << " NO theAutomaton->Executed() " << endl ;
+    }
   }
 }
 void GraphExecutor::OutNode::JoinedWait() {
@@ -1243,7 +1292,7 @@ bool GraphExecutor::OutNode::PushEvent( GraphExecutor::InNode * aNode ,
     perror("PushEvent pthread_mutex_lock ") ;
     exit( 0 ) ;
   }
-  char* aNodeName = aNode ? aNode->Name() : Graph()->Name() ;
+  char* aNodeName = aNode ? aNode->Name() : Name() ;
   _EventNodes.push_back( aNodeName ) ;
   _Events.push_back( anEvent ) ;
   _States.push_back( aState ) ;
@@ -1259,7 +1308,7 @@ bool GraphExecutor::OutNode::PushEvent( GraphExecutor::InNode * aNode ,
 //           << aNode->Automaton()->ControlStateName( aNode->ControlState() ) ;
   }
   else {
-//    cdebug << "PushEvent " << Graph()->Name() ;
+//    cdebug << "PushEvent " << Name() ;
 //    cdebug << " " << theAutomaton->EventName( anEvent ) << " "
 //           << theAutomaton->StateName( aState ) ;
   }
@@ -1383,8 +1432,8 @@ bool GraphExecutor::OutNode::EventW( char ** aNodeName ,
           aState != SUPERV::RunningState &&
           aState != SUPERV::SuspendDoneState &&
           aState != SUPERV::SuspendErroredState ) {
-    NodeName = Graph()->Name() ;
-    while ( sts && !strcmp( NodeName , Graph()->Name() ) ) {
+    NodeName = Name() ;
+    while ( sts && !strcmp( NodeName , Name() ) ) {
       sts = EventWait( aNodeName , anEvent , aState ) ;
       NodeName = *aNodeName ;
     }
@@ -1547,14 +1596,14 @@ void GraphExecutor::OutNode::EventList() {
 
 void GraphExecutor::OutNode::SendSomeDataReady( const char * aNodeName ) {
   cdebug_in << "GraphExecutor::OutNode::SendSomeDataReady " << aNodeName << "->SendSomeDataReady( "
-            << Graph()->Name() << " )" << endl;
+            << Name() << " )" << endl;
   int sts ;
-  sts = ((GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( aNodeName )->GetInNode())->SendSomeDataReady( Graph()->Name() ) ;
+  sts = ((GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( aNodeName )->GetInNode())->SendSomeDataReady( Name() ) ;
   cdebug_out << "GraphExecutor::OutNode::SendSomeDataReady sts " << sts << endl ;
 }
 
 void GraphExecutor::OutNode::State(GraphExecutor::AutomatonState aState ) {
-//  cdebug << "GraphExecutor::OutNode::State " << Graph()->Name() << " "
+//  cdebug << "GraphExecutor::OutNode::State " << Name() << " "
 //         << theAutomaton->StateName( AutomatonGraphState( _State ) ) << " ---> "
 //         << theAutomaton->StateName( AutomatonGraphState( aState ) ) << endl ;
   _State = aState ;
@@ -1839,12 +1888,12 @@ bool GraphExecutor::OutNode::Suspend() {
   if ( RetVal ) {
     State( GraphExecutor::SuspendedState ) ;
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS SUSPENDED" ) ;
+    MESSAGE( Name() << " IS SUSPENDED" ) ;
     MESSAGE("================================================================================") ;
   }
   else {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS NOT SUSPENDED" ) ;
+    MESSAGE( Name() << " IS NOT SUSPENDED" ) ;
     MESSAGE("================================================================================") ;
   }
   for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
@@ -1887,16 +1936,16 @@ bool GraphExecutor::OutNode::Resume() {
     }
   }
   else {
-    cdebug << Graph()->Name() << " not suspended " << theAutomaton->StateName( State() ) << endl ;
+    cdebug << Name() << " not suspended " << theAutomaton->StateName( State() ) << endl ;
   }
   if ( RetVal ) {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS RESUMED" ) ;
+    MESSAGE( Name() << " IS RESUMED" ) ;
     MESSAGE("================================================================================") ;
   }
   else {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS NOT RESUMED" ) ;
+    MESSAGE( Name() << " IS NOT RESUMED" ) ;
     MESSAGE("================================================================================") ;
   }
   int i ;
@@ -1958,13 +2007,13 @@ bool GraphExecutor::OutNode::Kill() {
   if ( RetVal ) {
     State( GraphExecutor::KilledState ) ;
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS KILLED" <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
+    MESSAGE( Name() << " IS KILLED" <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
              << EventQSize() ) ;
     MESSAGE("================================================================================") ;
   }
   else {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS NOT KILLED" ) ;
+    MESSAGE( Name() << " IS NOT KILLED" ) ;
     MESSAGE("================================================================================") ;
   }
   for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
@@ -2003,7 +2052,7 @@ bool GraphExecutor::OutNode::Stop() {
   cdebug_out << "GraphExecutor::OutNode::Stop" << endl ;
   if ( RetVal ) {
     MESSAGE("================================================================================") ;
-    MESSAGE( Graph()->Name() << " IS STOPPED" ) ;
+    MESSAGE( Name() << " IS STOPPED" ) ;
     MESSAGE("================================================================================") ;
   }
   return RetVal ;
@@ -2053,7 +2102,7 @@ bool GraphExecutor::OutNode::RunningWait() {
 }
 
 bool GraphExecutor::OutNode::DoneWait() {
-  cdebug_in << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name() << endl;
+  cdebug_in << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name() << endl;
   bool aret ;
   if ( pthread_mutex_lock( &_MutexWait ) ) {
     perror("pthread_mutex_lock _DoneWait") ;
@@ -2061,18 +2110,18 @@ bool GraphExecutor::OutNode::DoneWait() {
   }
   aret = IsDone() ;
   while ( !aret && !IsSuspended() && IsRunning() ) {
-    cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name()
+    cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name()
            << " DoneWait pthread_cond_wait _EventWait " << &_EventWait << endl;
     pthread_cond_wait( &_EventWait , &_MutexWait );
     aret = IsDone() ;
-    cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name()
+    cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name()
            << " DoneWait pthread_cond_waited _EventWaited " << &_EventWait << " : "<< aret << endl;
   }
   if ( pthread_mutex_unlock( &_MutexWait ) ) {
     perror("pthread_mutex_lock _DoneWait") ;
     exit( 0 ) ;
   }
-  cdebug_out << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name()
+  cdebug_out << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name()
              << " " << State() << " : " << aret << endl ;
   return aret ;
 }