Salome HOME
Traces
authorrahuel <rahuel@opencascade.com>
Tue, 15 Feb 2005 13:20:32 +0000 (13:20 +0000)
committerrahuel <rahuel@opencascade.com>
Tue, 15 Feb 2005 13:20:32 +0000 (13:20 +0000)
src/GraphExecutor/DataFlowExecutor_InNode.cxx
src/GraphExecutor/DataFlowExecutor_InNode.hxx

index 4fa3a64de3498c1fd1572c0027c6c7eb86df1987..719d00eea2d96fb1f8866be55e199187a4aca1d1 100644 (file)
@@ -386,18 +386,22 @@ GraphExecutor::InNode::~InNode() {
 }
 
 void GraphExecutor::InNode::LockDataWait() {
+  cdebug_in << "GraphExecutor::InNode::LockDataWait " << endl ;
   if ( pthread_mutex_lock( &_MutexDataWait ) ) {
     perror("Ready pthread_mutex_lock ") ;
     exit( 0 ) ;
   }
   _DataWait = true ;
+  cdebug_out << "GraphExecutor::InNode::LockDataWait " << endl ;
 }
 void GraphExecutor::InNode::UnLockDataWait() {
+  cdebug_in << "GraphExecutor::InNode::UnLockDataWait " << endl ;
   _DataWait = false ;
   if ( pthread_mutex_unlock( &_MutexDataWait ) ) {
     perror("Ready pthread_mutex_unlock ") ;
     exit( 0 ) ;
   }
+  cdebug_out << "GraphExecutor::InNode::UnLockDataWait " << endl ;
 }
 
 Engines::Component_var GraphExecutor::InNode::Component() const {
@@ -1343,6 +1347,9 @@ void GraphExecutor::InNode::InitialState()
       *anAny <<= (long ) 1 ;
       anOutPort->Value( anAny ) ;
       _InitLoop = true ;
+      cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
+             << " OutPort " << anOutPort->PortStatus() << theAutomaton->StateName( anOutPort->State() )
+             << " InitLoop HeadNode" << endl ;
     }
 // JR 15_09_2004 if backward link from GOTONode or EndLoopNode ==> DataConnected
     else if ( anInPort->IsGate() && anOutPort ) {
@@ -1358,6 +1365,13 @@ void GraphExecutor::InNode::InitialState()
         anOutPort->State( SUPERV::ReadyState ) ;
         anOutPort->Done( true ) ;
       }
+      cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
+             << " OutPort " << anOutPort->PortStatus() << theAutomaton->StateName( anOutPort->State() )
+             << " Gate HeadNode" << endl ;
+    }
+    else {
+      cdebug << Name() << " IsHeadNode " << IsHeadNode() << " InPort" << i << " " << anInPort->PortName()
+             << " " << anInPort->PortStatus() << endl ;
     }
     if ( anInPort->IsGate() && anOutPort == NULL ) {
       Pc-- ;
@@ -1391,7 +1405,7 @@ void GraphExecutor::InNode::InitialState()
       if ( !anOutPort->IsDataStream() || anInPort->IsDataStream() ) {
         cdebug << "InPort" << i << " state change : " << anInPort->PortName() << " from OutPort "
                << anOutPort->PortName() << " from Node " << anOutPort->NodeName()
-               << " with state " << theAutomaton->StateName( anOutPort->State() ) << endl ;
+               << " with state of OutPort : " << theAutomaton->StateName( anOutPort->State() ) << endl ;
         GetChangeNodeInPort(i)->State( anOutPort->State() ) ;
       }
       else if ( anOutPort->IsDataConnected() ) {
@@ -1403,7 +1417,7 @@ void GraphExecutor::InNode::InitialState()
       else {
         cdebug << "InPort" << i << " state NOT changed : " << anInPort->PortName() << " from OutPort "
                << anOutPort->PortName() << " " << anOutPort->PortStatus() << " from Node " << anOutPort->NodeName()
-               << " with state " << anOutPort->State() << endl ;
+               << " with state " << theAutomaton->StateName( anOutPort->State() ) << endl ;
       }
     }
     if ( anOutPort ) {
@@ -1419,9 +1433,8 @@ void GraphExecutor::InNode::InitialState()
       else {
         cdebug << "???" ;
       }
-      cdebug << " PortConnected("
-             << anOutPort->IsPortConnected() << ") DataConnected("
-             << anOutPort->IsDataConnected() << ")" << endl ;
+      cdebug << " OutPortStatus " << anOutPort->PortStatus() << " State "
+             << theAutomaton->StateName( anOutPort->State() ) << endl ;
     }
   }
 
@@ -1533,7 +1546,7 @@ const long GraphExecutor::InNode::CpuUsed( bool tot ) {
   CORBA::Long cpu = 0 ;
 //  cout << "Begin CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
 //       << theAutomaton->StateName( _currentState ) << endl ;
-  cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
+//  cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
   if ( IsOneOfInLineNodes() ) {
 //    cdebug << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
 //    cout << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
@@ -1554,7 +1567,7 @@ const long GraphExecutor::InNode::CpuUsed( bool tot ) {
       }
     }
   }
-  cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
+//  cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
 //  cout << "End CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
 //       << theAutomaton->StateName( _currentState ) << endl ;
   return cpu ;
index 1b25ab5ad79f3f477d26b661fabccded3d741930..74613b6222c3c3e35fbb59d9ac96ed550443b956 100644 (file)
@@ -342,8 +342,12 @@ namespace GraphExecutor {
       bool Resume() ;
       bool Stop() ;
 
-      void CreateNewThread( bool k_create ) { _createNewThread = k_create ; } ;
-      void CreateNewThreadIf( bool k_create ) { _createNewThreadIf = k_create ; } ;
+      void CreateNewThread( bool k_create ) {
+           cdebug << Name() << " CreateNewThread( " << k_create << " )" << endl ;
+           _createNewThread = k_create ; } ;
+      void CreateNewThreadIf( bool k_create ) {
+           cdebug << Name() << " CreateNewThreadIf( " << k_create << " )" << endl ;
+           _createNewThreadIf = k_create ; } ;
       bool CreateNewThread() { return _createNewThread ; } ;
       bool CreateNewThreadIf() { return _createNewThreadIf ; } ;
       void NewThread( pthread_t aThread ) ;