X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGraphExecutor%2FDataFlowExecutor_FiniteStateMachine.cxx;h=5b79d6bc0fd36b11a7bb07563063763a4e613817;hb=f8a404498be3d553fcc09814c13047e5282bf00b;hp=c563b2550bfcbd0f31951354b35f70ffe292ed38;hpb=7d3931c54614b3d73351551e662ccbd3be07a0d8;p=modules%2Fsuperv.git diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx index c563b25..5b79d6b 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx @@ -125,7 +125,7 @@ void * start_function( void *p ) ; #define NumberOfEvents GraphExecutor::NumberOfEvents GraphExecutor::FiniteStateMachine::FiniteStateMachine() { -// cdebug_in << "FiniteStateMachine::FiniteStateMachine" << endl; + MESSAGE( "FiniteStateMachine::FiniteStateMachine" ) ; _ControlStateName[ VoidState ] = "VoidState" ; _ControlStateName[ ToSuspendStartState ]= "ToSuspendStartState" ; @@ -355,6 +355,10 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { // SuspendedExecutingState : NO ResumeEvent 13-03-2003 _TransitionTable[ SuspendedExecutingState ][ SuccessEvent ] = SuccessedExecutingState ; _ActionTable[ SuccessedExecutingState ][ SuccessEvent ] = Executing_SuccessAction; +//JR 24.03.2005 : Debug for PAL8176 : abort of GOTONode +// ErrorEvent + _TransitionTable[ SuccessedState ][ ErrorEvent ] = ErroredExecutingState ; + _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; // ErrorEvent _TransitionTable[ ExecutingState ][ ErrorEvent ] = ErroredExecutingState ; _ActionTable[ ErroredExecutingState ][ ErrorEvent ] = Executing_ErrorAction; @@ -459,8 +463,7 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { _GraphExecutingNumber = 0 ; _PyInitModule = false ; _DbgFileNumber = 0 ; -// cdebug_out << "FiniteStateMachine::FiniteStateMachine _TransitionTable " -// << endl; + MESSAGE( "FiniteStateMachine::FiniteStateMachine _TransitionTable " ) ; } void * start_function( void *p ) { @@ -494,17 +497,19 @@ void GraphExecutor::FiniteStateMachine::Executed() { for ( aPyFunction = _MapOfPyFunctions.begin() ; aPyFunction != _MapOfPyFunctions.end() ; aPyFunction++ ) { if ( !strcmp( aPyFunction->first.c_str() , "PyObjRef" ) || !strcmp( aPyFunction->first.c_str() , "PyObjIor" ) ) { - //cout << "GraphExecutor::FiniteStateMachine::Executed " << aPyFunction->first << " keeped ..."<< endl ; + MESSAGE( "GraphExecutor::FiniteStateMachine::Executed " << aPyFunction->first << " keeped ..." + ) ; } else { - //cout << "GraphExecutor::FiniteStateMachine::Executed " << aPyFunction->first << " erased ..."<< endl ; + MESSAGE( "GraphExecutor::FiniteStateMachine::Executed " << aPyFunction->first << " erased ..." + ) ; _MapOfPyFunctions.erase( aPyFunction->first ) ; } } } else { - //cout << "GraphExecutor::FiniteStateMachine::Executed _GraphExecutingNumber " << _GraphExecutingNumber - // << " != 0 ==> no erase" << endl ; + MESSAGE( "GraphExecutor::FiniteStateMachine::Executed _GraphExecutingNumber " + << _GraphExecutingNumber << " != 0 ==> no erase" ) ; } PyUnLock() ; return ; @@ -546,6 +551,7 @@ void GraphExecutor::FiniteStateMachine::PyLockReset() { } } +#define PyFunctionTrace 0 PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName ) { PyObject * RetVal = NULL ; @@ -553,29 +559,30 @@ PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncNa PyObject * PyFunctionMapped = _MapOfPyFunctions[ aPyFuncName ] ; if ( _GraphExecutingNumber > 1 && !PyObjRefIor ) { RetVal = PyFunctionMapped ; - //cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ; +#if PyFunctionTrace + MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ) ; if ( RetVal ) { - //cout << RetVal << " ob_refcnt " << RetVal->ob_refcnt ; + MESSAGE( RetVal << " ob_refcnt " << RetVal->ob_refcnt ) ; } else { - //cout << " NULL" ; + MESSAGE( " NULL" ) ; } - //cout << endl ; +#endif } else { RetVal = PyFunctionMapped ; - //cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ; +#if PyFunctionTrace + MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) --> " ) ; if ( RetVal && PyObjRefIor ) { - //cout << RetVal << " " << RetVal->ob_refcnt << endl ; + MESSAGE( RetVal << " " << RetVal->ob_refcnt ) ; } else if ( RetVal ) { - //cout << RetVal << " " << RetVal->ob_refcnt << endl ; -// _MapOfPyFunctions.erase( aPyFuncName ) ; -// cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) erased --> NULL" << endl ; + MESSAGE( RetVal << " " << RetVal->ob_refcnt ) ; } else { - //cout << " NULL" << endl ; + MESSAGE( " NULL" ) ; } +#endif } return RetVal ; @@ -585,15 +592,19 @@ bool GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName , P bool RetVal = false ; if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) { - //PyObject * aPyFunc = _MapOfPyFunctions[ aPyFuncName ] ; - //cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' , " << aPyFunction - // << " ) ob_refcnt " << aPyFunction->ob_refcnt << " already mapped : " << aPyFunc << " ob_refcnt " - // << aPyFunc->ob_refcnt << endl ; +#if PyFunctionTrace + PyObject * aPyFunc = _MapOfPyFunctions[ aPyFuncName ] ; + MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' , aPyFunction " + << aPyFunction << " ) ob_refcnt " << aPyFunction->ob_refcnt << " already mapped : " + << aPyFunc << " ob_refcnt " << aPyFunc->ob_refcnt ) ; +#endif } else { _MapOfPyFunctions[ aPyFuncName ] = aPyFunction ; - //cout << "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' , " << aPyFunction - // << " ) ob_refcnt " << aPyFunction->ob_refcnt << " mapped" << endl ; +#if PyFunctionTrace + MESSAGE( "GraphExecutor::FiniteStateMachine::PyFunction( '" << aPyFuncName << "' ) " << aPyFunction + << " ) ob_refcnt " << aPyFunction->ob_refcnt << " mapped" ) ; +#endif RetVal = true ; } @@ -602,6 +613,9 @@ bool GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName , P bool GraphExecutor::FiniteStateMachine::ErasePyFunction( const char * aPyFuncName ) { +#if PyFunctionTrace + MESSAGE( "GraphExecutor::FiniteStateMachine::ErasePyFunction( '" << aPyFuncName << "' )" ) ; +#endif if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) { _MapOfPyFunctions.erase( aPyFuncName ) ; return true ; @@ -678,7 +692,7 @@ void GraphExecutor::FiniteStateMachine::JoinThread() { exit( 0 ) ; } else { - MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_joined : " << _Thread ); +// MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_joined : " << _Thread ); _ThreadList.pop_front() ; } }