📄 mpe_log.c
字号:
fprintf( stderr, __FILE__":MPE_Describe_known_state() - \n" "\t""The input stateID, %d, for state %s " "is out of known range [%d..%d].\n" "\t""Use user-space stateID instead.\n", stateID, name, CLOG_KNOWN_STATEID_START, CLOG_USER_STATEID_START-1 ); fflush( stderr ); stateID = CLOG_Get_user_stateID( CLOG_Stream ); } CLOG_Buffer_save_statedef( CLOG_Buffer, commIDs, local_thread, stateID, state_startID, state_finalID, color, name, format ); return MPE_LOG_OK;}/*@ MPE_Describe_state - Describe the attributes of a state without byte informational data in MPI_COMM_WORLD. Input Parameters:+ state_startID - event number for the beginning of the state.. state_finalID - event number for the ending of the state.. name - name of the state, the maximum length of the NULL-terminated string is, sizeof(CLOG_DESC), 32.- color - color of the state, the maximum length of the NULL-terminated string is, sizeof(CLOG_COLOR), 24. Notes: Adds a state definition to the logfile. States are added to a log file by calling 'MPE_Log_event()' for the start and end event numbers. The function is provided for backward compatibility purpose. Users are urged to use 'MPE_Describe_comm_state()' and 'MPE_Log_comm_event()' instead. This function is threadsafe..seealso: MPE_Log_get_state_eventIDs(), MPE_Describe_comm_state()@*/int MPE_Describe_state( int state_startID, int state_finalID, const char *name, const char *color ){ return MPE_Describe_comm_state( MPI_COMM_WORLD, state_startID, state_finalID, name, color, NULL );}/*@ MPE_Describe_comm_event - Describe the attributes of an event with byte informational data in a specified MPI_Comm and on the thread that the function is invoked. Input Parameters:+ comm - MPI_Comm where this process is part of.. eventID - event number for the event.. name - name of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_DESC), 32.. color - color of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_COLOR), 24.- format - printf style %-token format control string for the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_FORMAT), 40. If format is NULL, it is equivalent to calling MPE_Describe_event(). The fortran interface of this routine considers the zero-length string, "", and single-blank string, " ", as NULL. Notes: Adds a event definition to the logfile. This function is threadsafe..N MPE_LOG_BYTE_FORMAT.seealso: MPE_Log_get_solo_eventID()@*/int MPE_Describe_comm_event( MPI_Comm comm, int eventID, const char *name, const char *color, const char *format ){ const CLOG_CommIDs_t *commIDs; MPE_LOG_THREADSTM_DECL MPE_LOG_THREADSTM_GET MPE_LOG_THREAD_LOCK if (!MPE_Log_hasBeenInit) return MPE_LOG_NOT_INITIALIZED; commIDs = CLOG_CommSet_get_IDs( CLOG_CommSet, comm ); CLOG_Buffer_save_eventdef( CLOG_Buffer, commIDs, THREADID, eventID, color, name, format ); MPE_LOG_THREAD_UNLOCK return MPE_LOG_OK;}/*@ MPE_Describe_info_event - Describe the attributes of an event with byte informational data in MPI_COMM_WORLD. Input Parameters:+ eventID - event number for the event.. name - name of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_DESC), 32.. color - color of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_COLOR), 24.- format - printf style %-token format control string for the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_FORMAT), 40. If format is NULL, it is equivalent to calling MPE_Describe_event(). The fortran interface of this routine considers the zero-length string, "", and single-blank string, " ", as NULL. Notes: Adds a event definition to the logfile. The function is provided for backward compatibility purpose. Users are urged to use 'MPE_Describe_comm_event' instead. This function is threadsafe..N MPE_LOG_BYTE_FORMAT.seealso: MPE_Log_get_solo_eventID(), MPE_Describe_comm_event() @*/int MPE_Describe_info_event( int eventID, const char *name, const char *color, const char *format ){ return MPE_Describe_comm_event( MPI_COMM_WORLD, eventID, name, color, format );}/* This is a MPE internal function to describe MPI events. It is not meant for user application. eventID should be fetched from CLOG_Get_known_solo_eventID() i.e, MPE_Log_get_known_solo_eventID() This function is NOT threadsafe.*/int MPE_Describe_known_event( const CLOG_CommIDs_t *commIDs, int local_thread, int eventID, const char *name, const char *color, const char *format ){ if (!MPE_Log_hasBeenInit) return MPE_LOG_NOT_INITIALIZED; CLOG_Buffer_save_eventdef( CLOG_Buffer, commIDs, local_thread, eventID, color, name, format ); return MPE_LOG_OK;}/*@ MPE_Describe_event - Describe the attributes of an event without byte informational data in MPI_COMM_WORLD. Input Parameters:+ eventID - event number for the event.. name - name of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_DESC), 32.- color - color of the event, the maximum length of the NULL-terminated string is, sizeof(CLOG_COLOR), 24. Notes: Adds a event definition to the logfile. The function is provided for backward compatibility purpose. Users are urged to use 'MPE_Describe_comm_event' instead. This function is threadsafe..seealso: MPE_Log_get_solo_eventID(), MPE_Describe_comm_event()@*/int MPE_Describe_event( int eventID, const char *name, const char *color ){ return MPE_Describe_comm_event( MPI_COMM_WORLD, eventID, name, color, NULL );}/*@ MPE_Log_get_event_number - Get an unused event number. Returns: A value that can be used in MPE_Describe_info_event() and MPE_Describe_info_state() which define an event or state not used before. Notes: This routine is provided to ensure that users are using unique event numbers. It relies on all packages using this routine. *** The function is deprecated, its use is strongly discouraged. The function has been replaced by MPE_Log_get_state_eventIDs() and MPE_Log_get_event_eventID(). *** This function is threadsafe.@*/int MPE_Log_get_event_number( void ){ int evtID; MPE_LOG_THREAD_LOCK evtID = CLOG_Get_user_eventID( CLOG_Stream ); MPE_LOG_THREAD_UNLOCK return evtID;}/*@ MPE_Log_get_state_eventIDs - Get a pair of event numbers to be used to define STATE drawable through MPE_Describe_state(). Input/Output Parameters:+ statedef_startID - starting eventID for the definition of state drawable.- statedef_finalID - ending eventID for the definition of state drawable. Notes: This routine is provided to ensure that users are using unique event numbers. It relies on all packages using this routine. This function is threadsafe.@*/int MPE_Log_get_state_eventIDs( int *statedef_startID, int *statedef_finalID ){ MPE_LOG_THREAD_LOCK *statedef_startID = CLOG_Get_user_eventID( CLOG_Stream ); *statedef_finalID = CLOG_Get_user_eventID( CLOG_Stream ); MPE_LOG_THREAD_UNLOCK return MPE_LOG_OK;}/*@ MPE_Log_get_solo_eventID - Get a single event number to be used to define EVENT drawable through MPE_Describe_event(). Input/Output Parameters:. eventdef_eventID - eventID for the definition of event drawable. Notes: This routine is provided to ensure that users are using unique event numbers. It relies on all packages using this routine. This function is threadsafe.@*/int MPE_Log_get_solo_eventID( int *eventdef_eventID ){ MPE_LOG_THREAD_LOCK *eventdef_eventID = CLOG_Get_user_solo_eventID( CLOG_Stream ); MPE_LOG_THREAD_UNLOCK return MPE_LOG_OK;}/* This is a MPE internal function in defining MPE_state[] evtID components. It is not meant for user application. This function is NOT threadsafe.*/int MPE_Log_get_known_eventID( void ){ return CLOG_Get_known_eventID( CLOG_Stream );}/* This is a MPE internal function in defining MPE_Event[] evtID components. It is not meant for user application. This function is NOT threadsafe.*/int MPE_Log_get_known_solo_eventID( void ){ return CLOG_Get_known_solo_eventID( CLOG_Stream );}/* This is a MPE internal function in defining MPE_state[] stateID component. It is not meant for user application.*/int MPE_Log_get_known_stateID( void ){ return CLOG_Get_known_stateID( CLOG_Stream );}/* This is a MPE internal function in defining MPI logging wrappers. It is not meant for user application. This function is NOT threadsafe.*/int MPE_Log_commIDs_send( const CLOG_CommIDs_t *commIDs, int local_thread, int other_party, int tag, int size ){ if (other_party != MPI_PROC_NULL) CLOG_Buffer_save_msgevt( CLOG_Buffer, commIDs, local_thread, CLOG_EVT_SENDMSG, tag, other_party, size ); return MPE_LOG_OK;}/*@ MPE_Log_comm_send - Log the send event of a message within a specified MPI_Comm (on the calling thread where the send event takes place). Input Parameters:+ comm - MPI_Comm where this process is part of.. other_party - the rank of the other party, i.e. receive event's rank.. tag - message tag ID.- size - message size in byte. Notes: This function is threadsafe.@*/int MPE_Log_comm_send( MPI_Comm comm, int other_party, int tag, int size ){ const CLOG_CommIDs_t *commIDs; int ierr; MPE_LOG_THREADSTM_DECL MPE_LOG_THREADSTM_GET MPE_LOG_THREAD_LOCK commIDs = CLOG_CommSet_get_IDs( CLOG_CommSet, comm ); ierr = MPE_Log_commIDs_send( commIDs, THREADID, other_party, tag, size ); MPE_LOG_THREAD_UNLOCK return ierr;}/*@ MPE_Log_send - Log the send event of a message within MPI_COMM_WORLD. (on the calling thread where send event takes place) Input Parameters:+ other_party - the rank of the other party, i.e. receive event's rank.. tag - message tag ID.- size - message size in byte. Notes: This function is threadsafe.@*/int MPE_Log_send( int other_party, int tag, int size ){ int ierr; MPE_LOG_THREADSTM_DECL MPE_LOG_THREADSTM_GET MPE_LOG_THREAD_LOCK ierr = MPE_Log_commIDs_send( CLOG_CommSet->IDs4world, THREADID, other_party, tag, size ); MPE_LOG_THREAD_UNLOCK return ierr;}/* This is a MPE internal function in defining MPI logging wrappers. It is not meant for user application. This function is NOT threadsafe.*/int MPE_Log_commIDs_receive( const CLOG_CommIDs_t *commIDs, int local_thread, int other_party, int tag, int size ){ if (other_party != MPI_PROC_NULL) CLOG_Buffer_save_msgevt( CLOG_Buffer, commIDs, local_thread, CLOG_EVT_RECVMSG, tag, other_party, size ); return MPE_LOG_OK;}/*@ MPE_Log_comm_receive - log the receive event of a message within a specified MPI_Comm (on the calling thread where receive event takes place) Input Parameters:+ comm - MPI_Comm where this process is part of.. other_party - the rank of the other party, i.e. send event's rank.. tag - message tag ID.- size - message size in byte. Notes: This function is threadsafe.@*/int MPE_Log_comm_receive( MPI_Comm comm, int other_party, int tag, int size ){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -