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

📄 slog_irec_read.c

📁 MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程环境.
💻 C
📖 第 1 页 / 共 2 页
字号:
    return NULL;}/*@C    SLOG_CloseInputStream - Close the specified SLOG_STREAM.  It frees                            all the internally allocated memory used in                            SLOG_STREAM  Modified Input Variables :. slog - pointer to the SLOG_STREAM to be closed.  Modifies Output Variables :. returned value - integer status code.  Include File Needed :  slog.h.N SLOG_RETURN_STATUS@*/int SLOG_CloseInputStream( SLOG_STREAM *slog ){    int         ierr;    ierr = SLOG_CloseStream( slog );    if ( ierr != SLOG_SUCCESS ) {        fprintf( errfile, __FILE__":SLOG_CloseInputStream() - "                          "SLOG_CloseStream( slog ) fails!!\n" );        fflush( errfile );        return SLOG_FAIL;    }#if defined( DEBUG )fprintf( stdout, __FILE__":SLOG_CloseInputStream() - End\n" );fflush( stdout );#endif    return SLOG_SUCCESS;}/*@C    SLOG_Irec_GetMinRec - Retrieve the fields for a bare minimal Interval Record  Unmodified Input Variables :. intvlrec - pointer to the internal Interval record to be retrieved.  Modified Output Variables :. rectype - pointer to the interval record's record field which determines             if the record is a FIXED record or VARIABLE record, this in turns            will determine the number of association and the number of            sets of MPI call arguments.. intvltype - pointer to interval record's interval type field.. bebit_0 - pointer to interval record's first bebit.. bebit_1 - pointer to interval record's second bebit.. starttime - pointer to interval record's start time.. duration - pointer to interval record's life time.. orig_node_id - pointer to interval record's origin node ID.. orig_cpu_id - pointer to interval record's origin cpu ID.. orig_thread_id - pointer to interval record's origin thread ID.. orig_instr_addr - pointer to interval record's instr_addr integer pointer.. ...   - pointers to destination task labels for Message Record ( optional ) :  dest_node_id - pointer to interval record's destination node ID.  dest_cpu_id - pointer to interval record's destination cpu ID.  dest_thread_id - pointer to interval record's destination thread ID.  Modified Output Variables :. returned value - integer return status.  Usage Notes on this subroutine :    Since the subroutine copies all the fixed fields of the specified     record to the input variables, the record must be non-empty.    The subroutine can only be called __After__ retrieving the interval    record from the SLOG file.  Include File Needed :  slog.h.N SLOG_RETURN_STATUS@*/int SLOG_Irec_GetMinRec( const SLOG_intvlrec_t   *intvlrec,                               SLOG_rectype_t    *rectype,                               SLOG_intvltype_t  *intvltype,                               SLOG_bebit_t      *bebit_0,                               SLOG_bebit_t      *bebit_1,                               SLOG_starttime_t  *starttime,                               SLOG_duration_t   *duration,                               SLOG_nodeID_t     *orig_node_id,                               SLOG_cpuID_t      *orig_cpu_id,                               SLOG_threadID_t   *orig_thread_id,                               SLOG_iaddr_t      *instr_addr,                         ... ){    /*  Local Variables  */    va_list            ap;    SLOG_nodeID_t     *dest_node_id;    SLOG_cpuID_t      *dest_cpu_id;    SLOG_threadID_t   *dest_thread_id;    if ( intvlrec == NULL ) {        fprintf( errfile, __FILE__":SLOG_Irec_GetMinRec() - "                          "Source interval record pointer is NULL/n" );        fflush( errfile );        return SLOG_FAIL;    }    *rectype        = intvlrec->rectype;    *intvltype      = intvlrec->intvltype;    *bebit_0        = intvlrec->bebits[0];    *bebit_1        = intvlrec->bebits[1];    *starttime      = intvlrec->starttime;    *duration       = intvlrec->duration;    *orig_node_id   = (intvlrec->origID).node;    *orig_cpu_id    = (intvlrec->origID).cpu;    *orig_thread_id = (intvlrec->origID).thread;    *instr_addr     = intvlrec->instr_addr;    if ( SLOG_global_IsOffDiagRec( intvlrec->rectype ) ) {        va_start( ap, instr_addr );        dest_node_id   = va_arg( ap, SLOG_nodeID_t * );        dest_cpu_id    = va_arg( ap, SLOG_cpuID_t * );        dest_thread_id = va_arg( ap, SLOG_threadID_t * );        va_end( ap );        *dest_node_id   = (intvlrec->destID).node;        *dest_cpu_id    = (intvlrec->destID).cpu;        *dest_thread_id = (intvlrec->destID).thread;    }    return SLOG_SUCCESS;}/*@C    SLOG_Irec_GetAssocs - Retrieve the association array of the interval record.  Unmodified Input Variables :. intvlrec - pointer to the internal Interval record to be retrieved.. size_assocs - Number of elements available for the input association array.  Modified Intput Variables :. assocs - association array, array of file pointers to the associated           interval records of the specified interval record.           It is assumed the input array, assocs[], is big enough           to hold the association array of the interval record.  Modified Output Variables :. returned value - N_assocs : Number of elements in the association array                   returned.  If the input size, size_assocs, is smaller                   than the actual number of elements of the association                   array, the return value will be SLOG_EOF and only the                   first size_assocs elements will be returned.  Usage Notes on this subroutine :    The subroutine gets the association array of the specified Internal     Interval Record.  This subroutine is meant to be called once for    each interval record.  Calling multiple times for the same interval    record returns the same results.  If the return value, N_assocs,     is equal to zero.  It means there is no associated record.  Include File Needed :  slog.h@*/int SLOG_Irec_GetAssocs( const SLOG_intvlrec_t  *intvlrec,                         const SLOG_N_assocs_t   size_assocs,                               SLOG_assoc_t     *assocs ){    int   ii;    if ( intvlrec == NULL ) {        fprintf( errfile, __FILE__":SLOG_Irec_GetAssocs() - "                          "Source interval record pointer is NULL/n" );        fflush( errfile );        return SLOG_FAIL;    }    if ( size_assocs >= intvlrec->N_assocs ) {        for ( ii = 0; ii < intvlrec->N_assocs; ii++ )            assocs[ ii ] = intvlrec->assocs[ ii ];        return ( intvlrec->N_assocs );    }    else {        for ( ii = 0; ii < size_assocs; ii++ )            assocs[ ii ] = intvlrec->assocs[ ii ];        return SLOG_EOF;    }}/*@C    SLOG_Irec_GetArgs - Retrieve the argument array of the interval record.  Unmodified Input Variables :. size_args - Number of elements available for the input array.  Modified Intput Variables :. intvlrec - pointer to the internal interval record to be retrieved.             The internal pointer to Vector Argument will be updated.. args - argument array, array of call arguments of the specified          interval record.  It is assumed the input array, args[], is          big enough to hold the argument array of the interval record.  Modified Output Variables :. returned value - N_args : Number of elements in the argument array                   returned.  If the input size, size_args, is smaller                   than the actual number of elements of the argument                   array, the return value will be SLOG_EOF and only the                   first size_args elements will be returned.  When there                   is no more argument array in the interval record,                   a zero will be returned.  Usage Notes on this subroutine :    The subroutine retrieves argument array(s) of the specified Internal     Interval Record.  This subroutine is meant to be called at least once    for each interval record extracted from the slogfile.    If the return value, N_args, is equal to zero.  It means there is    no argument array.   That suggests that the subroutine needs to be    called as long as it returns positive integer ( > 0 ).  Include File Needed :  slog.h@*/int SLOG_Irec_GetArgs(       SLOG_intvlrec_t  *intvlrec,                       const SLOG_N_args_t     size_args,                             SLOG_arg_t       *args ){    const SLOG_vtrarg_t *vtr_args;          int            ii;    if ( intvlrec == NULL ) {        fprintf( errfile, __FILE__":SLOG_Irec_GetArgs() - "                          "Source interval record pointer is NULL/n" );        fflush( errfile );        return SLOG_FAIL;    }    vtr_args = SLOG_Irec_GetVtrArgs( intvlrec );    if ( vtr_args != NULL ) {        if ( size_args >= vtr_args->size ) {            for ( ii = 0; ii < vtr_args->size; ii++ )                args[ ii ] = vtr_args->values[ ii ];            return ( vtr_args->size );        }        else {            for ( ii = 0; ii < size_args; ii++ )                args[ ii ] = vtr_args->values[ ii ];            return SLOG_EOF;        }    }    else        return 0;}

⌨️ 快捷键说明

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