root/ompi/mca/io/romio321/src/io_romio321_file_write.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_io_romio321_file_write_at
  2. mca_io_romio321_file_write_at_all
  3. mca_io_romio321_file_iwrite_at
  4. mca_io_romio321_file_iwrite_at_all
  5. mca_io_romio321_file_write
  6. mca_io_romio321_file_write_all
  7. mca_io_romio321_file_iwrite
  8. mca_io_romio321_file_iwrite_all
  9. mca_io_romio321_file_write_shared
  10. mca_io_romio321_file_iwrite_shared
  11. mca_io_romio321_file_write_ordered
  12. mca_io_romio321_file_write_at_all_begin
  13. mca_io_romio321_file_write_at_all_end
  14. mca_io_romio321_file_write_all_begin
  15. mca_io_romio321_file_write_all_end
  16. mca_io_romio321_file_write_ordered_begin
  17. mca_io_romio321_file_write_ordered_end

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2015-2017 Research Organization for Information Science
  13  *                         and Technology (RIST). All rights reserved.
  14  * Copyright (c) 2017      IBM Corporation.  All rights reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "ompi_config.h"
  23 #include "mpi.h"
  24 #include "ompi/file/file.h"
  25 #include "io_romio321.h"
  26 
  27 
  28 int
  29 mca_io_romio321_file_write_at (ompi_file_t *fh,
  30                             MPI_Offset offset,
  31                             const void *buf,
  32                             int count,
  33                             struct ompi_datatype_t *datatype,
  34                             ompi_status_public_t * status)
  35 {
  36     int         ret;
  37     mca_io_romio321_data_t *data;
  38 
  39     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
  40     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
  41     ret =
  42         ROMIO_PREFIX(MPI_File_write_at) (data->romio_fh, offset, buf, count,
  43                                         datatype, status);
  44     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
  45 
  46     return ret;
  47 }
  48 
  49 
  50 
  51 int
  52 mca_io_romio321_file_write_at_all (ompi_file_t *fh,
  53                                 MPI_Offset offset,
  54                                 const void *buf,
  55                                 int count,
  56                                 struct ompi_datatype_t *datatype,
  57                                 ompi_status_public_t * status)
  58 {
  59     int         ret;
  60     mca_io_romio321_data_t *data;
  61 
  62     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
  63     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
  64     ret =
  65         ROMIO_PREFIX(MPI_File_write_at_all) (data->romio_fh, offset, buf,
  66                                              count, datatype, status);
  67     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
  68 
  69     return ret;
  70 }
  71 
  72 
  73 
  74 int
  75 mca_io_romio321_file_iwrite_at (ompi_file_t *fh,
  76                              MPI_Offset offset,
  77                              const void *buf,
  78                              int count,
  79                              struct ompi_datatype_t *datatype,
  80                              ompi_request_t **request)
  81 {
  82     int ret;
  83     mca_io_romio321_data_t *data;
  84 
  85     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
  86     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
  87     ret =
  88         ROMIO_PREFIX(MPI_File_iwrite_at) (data->romio_fh, offset, buf, count,
  89                                           datatype, request);
  90     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
  91 
  92     return ret;
  93 }
  94 
  95 
  96 int
  97 mca_io_romio321_file_iwrite_at_all (ompi_file_t *fh,
  98                                     MPI_Offset offset,
  99                                     const void *buf,
 100                                     int count,
 101                                     struct ompi_datatype_t *datatype,
 102                                     ompi_request_t **request)
 103 {
 104     int         ret;
 105     mca_io_romio321_data_t *data;
 106 
 107     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 108     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 109     // ----------------------------------------------------
 110     // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call.
 111     // ----------------------------------------------------
 112     // No support for non-blocking collective I/O operations.
 113     // Fake it with individual non-blocking I/O operations.
 114     // Similar to OMPIO
 115     ret =
 116         ROMIO_PREFIX(MPI_File_iwrite_at_all) (data->romio_fh, offset, buf, count,
 117                                              datatype, request);
 118     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 119 
 120     return ret;
 121 }
 122 
 123 
 124 
 125 int
 126 mca_io_romio321_file_write (ompi_file_t *fh,
 127                          const void *buf,
 128                          int count,
 129                          struct ompi_datatype_t *datatype,
 130                          ompi_status_public_t * status)
 131 {
 132     int         ret;
 133     mca_io_romio321_data_t *data;
 134 
 135     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 136     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 137     ret =
 138         ROMIO_PREFIX(MPI_File_write) (data->romio_fh, buf, count, datatype,
 139                                      status);
 140     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 141 
 142     return ret;
 143 }
 144 
 145 int
 146 mca_io_romio321_file_write_all (ompi_file_t *fh,
 147                              const void *buf,
 148                              int count,
 149                              struct ompi_datatype_t *datatype,
 150                              ompi_status_public_t * status)
 151 {
 152     int         ret;
 153     mca_io_romio321_data_t *data;
 154 
 155     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 156     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 157     ret =
 158         ROMIO_PREFIX(MPI_File_write_all) (data->romio_fh, buf, count, datatype,
 159                                          status);
 160     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 161 
 162     return ret;
 163 }
 164 
 165 int
 166 mca_io_romio321_file_iwrite (ompi_file_t *fh,
 167                           const void *buf,
 168                           int count,
 169                           struct ompi_datatype_t *datatype,
 170                           ompi_request_t **request)
 171 {
 172     int ret;
 173     mca_io_romio321_data_t *data;
 174 
 175     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 176     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 177     ret =
 178         ROMIO_PREFIX(MPI_File_iwrite) (data->romio_fh, buf, count, datatype,
 179                                        request);
 180     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 181 
 182     return ret;
 183 }
 184 
 185 int
 186 mca_io_romio321_file_iwrite_all (ompi_file_t *fh,
 187                                 const void *buf,
 188                                  int count,
 189                                  struct ompi_datatype_t *datatype,
 190                                  ompi_request_t **request)
 191 {
 192     int         ret;
 193     mca_io_romio321_data_t *data;
 194 
 195     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 196     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 197     // ----------------------------------------------------
 198     // NOTE: If you upgrade ROMIO, replace this with the actual ROMIO call.
 199     // ----------------------------------------------------
 200     // No support for non-blocking collective I/O operations.
 201     // Fake it with individual non-blocking I/O operations.
 202     // Similar to OMPIO
 203     ret =
 204         ROMIO_PREFIX(MPI_File_iwrite_all) (data->romio_fh, buf, count, datatype,
 205                                           request);
 206     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 207 
 208     return ret;
 209 }
 210 
 211 
 212 int
 213 mca_io_romio321_file_write_shared (ompi_file_t *fh,
 214                                 const void *buf,
 215                                 int count,
 216                                 struct ompi_datatype_t *datatype,
 217                                 ompi_status_public_t * status)
 218 {
 219     int         ret;
 220     mca_io_romio321_data_t *data;
 221 
 222     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 223     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 224     ret =
 225         ROMIO_PREFIX(MPI_File_write_shared) (data->romio_fh, buf, count,
 226                                              datatype, status);
 227     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 228 
 229     return ret;
 230 }
 231 
 232 int
 233 mca_io_romio321_file_iwrite_shared (ompi_file_t *fh,
 234                                  const void *buf,
 235                                  int count,
 236                                  struct ompi_datatype_t *datatype,
 237                                  ompi_request_t **request)
 238 {
 239     int ret;
 240     mca_io_romio321_data_t *data;
 241 
 242     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 243     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 244     ret =
 245         ROMIO_PREFIX(MPI_File_iwrite_shared) (data->romio_fh, buf, count,
 246                                               datatype, request);
 247     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 248 
 249     return ret;
 250 }
 251 
 252 int
 253 mca_io_romio321_file_write_ordered (ompi_file_t *fh,
 254                                  const void *buf,
 255                                  int count,
 256                                  struct ompi_datatype_t *datatype,
 257                                  ompi_status_public_t * status)
 258 {
 259     int         ret;
 260     mca_io_romio321_data_t *data;
 261 
 262     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 263     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 264     ret =
 265         ROMIO_PREFIX(MPI_File_write_ordered) (data->romio_fh, buf, count,
 266                                              datatype, status);
 267     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 268 
 269     return ret;
 270 }
 271 
 272 int
 273 mca_io_romio321_file_write_at_all_begin (ompi_file_t *fh,
 274                                       MPI_Offset offset,
 275                                       const void *buf,
 276                                       int count,
 277                                       struct ompi_datatype_t *datatype)
 278 {
 279     int         ret;
 280     mca_io_romio321_data_t *data;
 281 
 282     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 283     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 284     ret = ROMIO_PREFIX(MPI_File_write_at_all_begin) (data->romio_fh, offset,
 285                                                      buf, count, datatype);
 286     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 287 
 288     return ret;
 289 }
 290 
 291 int
 292 mca_io_romio321_file_write_at_all_end (ompi_file_t *fh,
 293                                     const void *buf,
 294                                     ompi_status_public_t * status)
 295 {
 296     int         ret;
 297     mca_io_romio321_data_t *data;
 298 
 299     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 300     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 301     ret = ROMIO_PREFIX(MPI_File_write_at_all_end) (data->romio_fh, buf,
 302                                                    status);
 303     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 304 
 305     return ret;
 306 }
 307 
 308 int
 309 mca_io_romio321_file_write_all_begin (ompi_file_t *fh,
 310                                    const void *buf,
 311                                    int count,
 312                                    struct ompi_datatype_t *datatype)
 313 {
 314     int         ret;
 315     mca_io_romio321_data_t *data;
 316 
 317     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 318     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 319     ret = ROMIO_PREFIX(MPI_File_write_all_begin) (data->romio_fh, buf, count,
 320                                                  datatype);
 321     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 322 
 323     return ret;
 324 }
 325 
 326 int
 327 mca_io_romio321_file_write_all_end (ompi_file_t *fh,
 328                                  const void *buf,
 329                                  ompi_status_public_t * status)
 330 {
 331     int         ret;
 332     mca_io_romio321_data_t *data;
 333 
 334     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 335     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 336     ret = ROMIO_PREFIX(MPI_File_write_all_end) (data->romio_fh, buf, status);
 337     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 338 
 339     return ret;
 340 }
 341 
 342 int
 343 mca_io_romio321_file_write_ordered_begin (ompi_file_t *fh,
 344                                        const void *buf,
 345                                        int count,
 346                                        struct ompi_datatype_t *datatype)
 347 {
 348     int         ret;
 349     mca_io_romio321_data_t *data;
 350 
 351     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 352     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 353     ret = ROMIO_PREFIX(MPI_File_write_ordered_begin) (data->romio_fh, buf,
 354                                                      count, datatype);
 355     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 356 
 357     return ret;
 358 }
 359 
 360 int
 361 mca_io_romio321_file_write_ordered_end (ompi_file_t *fh,
 362                                      const void *buf,
 363                                      ompi_status_public_t * status)
 364 {
 365     int         ret;
 366     mca_io_romio321_data_t *data;
 367 
 368     data = (mca_io_romio321_data_t *) fh->f_io_selected_data;
 369     OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
 370     ret = ROMIO_PREFIX(MPI_File_write_ordered_end) (data->romio_fh, buf,
 371                                                     status);
 372     OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);
 373 
 374     return ret;
 375 }

/* [<][>][^][v][top][bottom][index][help] */