⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpe_log.c

📁 mpi并行计算的c++代码 可用vc或gcc编译通过 可以用来搭建并行计算试验环境
💻 C
📖 第 1 页 / 共 3 页
字号:
@*/int MPE_Describe_info_state( int state_startID, int state_finalID,                             const char *name, const char *color,                             const char *format ){    return MPE_Describe_comm_state( MPI_COMM_WORLD, 0,                                    state_startID, state_finalID,                                    name, color, format );}/*    This is an MPE internal function to describe MPI states.    It is not meant for user application.    stateID should be fetched from CLOG_Get_known_stateID()    i.e, MPE_Log_get_known_stateID()*/int MPE_Describe_known_state( const CLOG_CommIDs_t *commIDs, int local_thread,                              int stateID, int state_startID, int state_finalID,                              const char *name, const char *color,                              const char *format ){    if (!MPE_Log_hasBeenInit)        return MPE_LOG_NOT_INITIALIZED;    if ( CLOG_Check_known_stateID( CLOG_Stream, stateID ) != CLOG_BOOL_TRUE ) {        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..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, 0,                                    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.    Input Parameters:+ comm         - MPI_Comm where this process is part of.. local_thread - local thread ID where the event is being defined.. 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..N MPE_LOG_BYTE_FORMAT.seealso: MPE_Log_get_solo_eventID()@*/int MPE_Describe_comm_event( MPI_Comm comm, int local_thread,                             int eventID,                             const char *name, const char *color,                             const char *format ){    const CLOG_CommIDs_t *commIDs;    if (!MPE_Log_hasBeenInit)        return MPE_LOG_NOT_INITIALIZED;    commIDs  = CLOG_CommSet_get_IDs( CLOG_CommSet, comm );    CLOG_Buffer_save_eventdef( CLOG_Buffer, commIDs, local_thread,                               eventID, color, name, format );    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..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, 0,                                    eventID, name, color, format );}/*@   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..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, 0,                                    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(). ***@*/int MPE_Log_get_event_number( void ){    return CLOG_Get_user_eventID( CLOG_Stream );}/*@    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.@*/int MPE_Log_get_state_eventIDs( int *statedef_startID,                                int *statedef_finalID ){    *statedef_startID = CLOG_Get_user_eventID( CLOG_Stream );    *statedef_finalID = CLOG_Get_user_eventID( CLOG_Stream );    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.@*/int MPE_Log_get_solo_eventID( int *eventdef_eventID ){    *eventdef_eventID = CLOG_Get_user_solo_eventID( CLOG_Stream );    return MPE_LOG_OK;}/*    This is an MPE internal function in defining MPE_state[] evtID components.    It is not meant for user application.*/int MPE_Log_get_known_eventID( void ){    return CLOG_Get_known_eventID( CLOG_Stream );}/*    This is an 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 );}int MPE_Log_commIDs_send( const CLOG_CommIDs_t *commIDs, int local_thread,                          int other_party, int tag, int size ){#if !defined( CLOG_NOMPI )    if (other_party != MPI_PROC_NULL)#endif        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.    Input Parameters:+ comm          - MPI_Comm where this process is part of.. local_thread  - local thread ID where the send event takes place.. other_party   - the rank of the other party, i.e. receive event's rank.. tag           - message tag ID.- size          - message size in byte.@*/int MPE_Log_comm_send( MPI_Comm comm, int local_thread,                       int other_party, int tag, int size ){    const CLOG_CommIDs_t *commIDs;    commIDs  = CLOG_CommSet_get_IDs( CLOG_CommSet, comm );    return MPE_Log_commIDs_send( commIDs, local_thread,                                 other_party, tag, size );}/*@    MPE_Log_send - Log the send event of a message within MPI_COMM_WORLD.    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.@*/int MPE_Log_send( int other_party, int tag, int size ){    return MPE_Log_commIDs_send( CLOG_CommIDs4World, 0,                                 other_party, tag, size );}int MPE_Log_commIDs_receive( const CLOG_CommIDs_t *commIDs, int local_thread,                             int other_party, int tag, int size ){#if !defined( CLOG_NOMPI )    if (other_party != MPI_PROC_NULL)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -