-:    0:Source:/home/MPI/testing/mpich2/mpich2/src/mpi/romio/adio/ad_nfs/ad_nfs_iread.c
        -:    0:Graph:ad_nfs_iread.gcno
        -:    0:Data:-
        -:    0:Runs:0
        -:    0:Programs:0
        -:    1:/* -*- Mode: C; c-basic-offset:4 ; -*- */
        -:    2:/* 
        -:    3: *   Copyright (C) 1997 University of Chicago. 
        -:    4: *   See COPYRIGHT notice in top-level directory.
        -:    5: */
        -:    6:
        -:    7:#include "ad_nfs.h"
        -:    8:
        -:    9:#ifdef ROMIO_HAVE_WORKING_AIO
        -:   10:/* nearly identical to ADIOI_GEN_IreadContig, except we lock around I/O */
        -:   11:void ADIOI_NFS_IreadContig(ADIO_File fd, void *buf, int count, 
        -:   12:			   MPI_Datatype datatype, int file_ptr_type,
        -:   13:			   ADIO_Offset offset, ADIO_Request *request,
        -:   14:			   int *error_code)  
    #####:   15:{
        -:   16:    int len, typesize;
    #####:   17:    int aio_errno = 0;
        -:   18:    static char myname[] = "ADIOI_NFS_IREADCONTIG";
        -:   19:
    #####:   20:    MPI_Type_size(datatype, &typesize);
    #####:   21:    len = count * typesize;
        -:   22:
    #####:   23:    if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
    #####:   24:    aio_errno = ADIOI_NFS_aio(fd, buf, len, offset, 0, request);
    #####:   25:    if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
        -:   26:
    #####:   27:    fd->fp_sys_posn = -1;
        -:   28:
    #####:   29:    if (aio_errno != 0) {
        -:   30:	/* --BEGIN ERROR HANDLING-- */
    #####:   31:	MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
    #####:   32:	return;
        -:   33:	/* --END ERROR HANDLING-- */
        -:   34:    }
    #####:   35:    else *error_code = MPI_SUCCESS;
        -:   36:}
        -:   37:#endif