This source file includes following definitions.
- MPI_File_read_all
- MPIOI_File_read_all
   1 
   2 
   3 
   4 
   5 
   6 
   7 #include "mpioimpl.h"
   8 
   9 #ifdef HAVE_WEAK_SYMBOLS
  10 
  11 #if defined(HAVE_PRAGMA_WEAK)
  12 #pragma weak MPI_File_read_all = PMPI_File_read_all
  13 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  14 #pragma _HP_SECONDARY_DEF PMPI_File_read_all MPI_File_read_all
  15 #elif defined(HAVE_PRAGMA_CRI_DUP)
  16 #pragma _CRI duplicate MPI_File_read_all as PMPI_File_read_all
  17 
  18 #elif defined(HAVE_WEAK_ATTRIBUTE)
  19 int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
  20     __attribute__((weak,alias("PMPI_File_read_all")));
  21 #endif
  22 
  23 
  24 #define MPIO_BUILD_PROFILING
  25 #include "mpioprof.h"
  26 #endif
  27 
  28 
  29 
  30 
  31 
  32 
  33 
  34 
  35 
  36 
  37 
  38 
  39 
  40 
  41 
  42 
  43 
  44 int MPI_File_read_all(MPI_File fh, void *buf, int count,
  45                       MPI_Datatype datatype, MPI_Status *status)
  46 {
  47     int error_code;
  48     static char myname[] = "MPI_FILE_READ_ALL";
  49 #ifdef MPI_hpux
  50     int fl_xmpi;
  51 
  52     HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count);
  53 #endif 
  54 
  55     error_code = MPIOI_File_read_all(fh, (MPI_Offset) 0,
  56                                      ADIO_INDIVIDUAL, buf,
  57                                      count, datatype, myname, status);
  58 
  59 #ifdef MPI_hpux
  60     HPMP_IO_END(fl_xmpi, fh, datatype, count);
  61 #endif 
  62 
  63     return error_code;
  64 }
  65 
  66 
  67 
  68 #ifdef MPIO_BUILD_PROFILING
  69 int MPIOI_File_read_all(MPI_File fh,
  70                         MPI_Offset offset,
  71                         int file_ptr_type,
  72                         void *buf,
  73                         int count,
  74                         MPI_Datatype datatype,
  75                         char *myname,
  76                         MPI_Status *status)
  77 {
  78     int error_code;
  79     MPI_Count datatype_size;
  80     ADIO_File adio_fh;
  81     void *xbuf=NULL, *e32_buf=NULL;
  82 
  83     ROMIO_THREAD_CS_ENTER();
  84 
  85     adio_fh = MPIO_File_resolve(fh);
  86 
  87     
  88     MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
  89     MPIO_CHECK_COUNT(adio_fh, count, myname, error_code);
  90     MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
  91 
  92     if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
  93     {
  94         error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  95                                           myname, __LINE__, MPI_ERR_ARG,
  96                                           "**iobadoffset", 0);
  97         error_code = MPIO_Err_return_file(adio_fh, error_code);
  98         goto fn_exit;
  99     }
 100     
 101 
 102     MPI_Type_size_x(datatype, &datatype_size);
 103 
 104     
 105     MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
 106     MPIO_CHECK_READABLE(adio_fh, myname, error_code);
 107     MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
 108     MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
 109     
 110 
 111     xbuf = buf;
 112     if (adio_fh->is_external32)
 113     {
 114         MPI_Aint e32_size = 0;
 115         error_code = MPIU_datatype_full_size(datatype, &e32_size);
 116         if (error_code != MPI_SUCCESS)
 117             goto fn_exit;
 118 
 119         e32_buf = ADIOI_Malloc(e32_size*count);
 120         xbuf = e32_buf;
 121     }
 122 
 123     ADIO_ReadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type,
 124                          offset, status, &error_code);
 125 
 126     
 127     if (error_code != MPI_SUCCESS)
 128         error_code = MPIO_Err_return_file(adio_fh, error_code);
 129     
 130 
 131     if (e32_buf != NULL) {
 132         error_code = MPIU_read_external32_conversion_fn(buf, datatype,
 133                 count, e32_buf);
 134         ADIOI_Free(e32_buf);
 135     }
 136 
 137 fn_exit:
 138     ROMIO_THREAD_CS_EXIT();
 139 
 140     return error_code;
 141 }
 142 #endif