root/ompi/mca/io/romio321/romio/adio/common/ad_iwrite_fake.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_FAKE_IwriteContig
  2. ADIOI_FAKE_IwriteStrided

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 2004 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "adio.h"
   9 
  10 #include "mpiu_greq.h"
  11 
  12 /* Generic implementation of IwriteContig calls the blocking WriteContig
  13  * immediately.
  14  */
  15 void ADIOI_FAKE_IwriteContig(ADIO_File fd, const void *buf, int count,
  16                             MPI_Datatype datatype, int file_ptr_type,
  17                             ADIO_Offset offset, ADIO_Request *request,
  18                             int *error_code)
  19 {
  20     ADIO_Status status;
  21     MPI_Offset len;
  22     MPI_Count typesize;
  23     MPI_Offset nbytes=0;
  24 
  25     MPI_Type_size_x(datatype, &typesize);
  26     len = (MPI_Offset)count * (MPI_Offset)typesize;
  27 
  28     /* Call the blocking function.  It will create an error code
  29      * if necessary.
  30      */
  31     ADIOI_Assert(len == (int) len); /* the count is an int parm */
  32     ADIO_WriteContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset,
  33                      &status, error_code);  
  34     if (*error_code == MPI_SUCCESS) {
  35         MPI_Type_size_x(datatype, &typesize);
  36         nbytes = (MPI_Offset)count*(MPI_Offset)typesize;
  37     }
  38     MPIO_Completed_request_create(&fd, nbytes, error_code, request);
  39 
  40 }
  41 
  42 
  43 /* Generic implementation of IwriteStrided calls the blocking WriteStrided
  44  * immediately.
  45  */
  46 void ADIOI_FAKE_IwriteStrided(ADIO_File fd, const void *buf, int count,
  47                              MPI_Datatype datatype, int file_ptr_type,
  48                              ADIO_Offset offset, ADIO_Request *request,
  49                              int *error_code)
  50 {
  51     ADIO_Status status;
  52     MPI_Count typesize;
  53     MPI_Offset nbytes=0;
  54 
  55     /* Call the blocking function.  It will create an error code 
  56      * if necessary.
  57      */
  58     ADIO_WriteStrided(fd, buf, count, datatype, file_ptr_type, 
  59                       offset, &status, error_code);  
  60     if (*error_code == MPI_SUCCESS) {
  61         MPI_Type_size_x(datatype, &typesize);
  62         nbytes = (MPI_Offset)count * (MPI_Offset)typesize;
  63     }
  64     MPIO_Completed_request_create(&fd, nbytes, error_code, request);
  65 }

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