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