root/ompi/mca/io/romio321/romio/adio/ad_testfs/ad_testfs_write.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_TESTFS_WriteContig
  2. ADIOI_TESTFS_WriteStrided

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *   Copyright (C) 2001 University of Chicago. 
   4  *   See COPYRIGHT notice in top-level directory.
   5  */
   6 
   7 #include "ad_testfs.h"
   8 #include "adioi.h"
   9 
  10 void ADIOI_TESTFS_WriteContig(ADIO_File fd, const void *buf, int count,
  11                               MPI_Datatype datatype, int file_ptr_type,
  12                               ADIO_Offset offset, ADIO_Status *status, int
  13                               *error_code)
  14 {
  15     int myrank, nprocs;
  16     MPI_Count datatype_size;
  17 
  18     *error_code = MPI_SUCCESS;
  19 
  20     MPI_Comm_size(fd->comm, &nprocs);
  21     MPI_Comm_rank(fd->comm, &myrank);
  22     MPI_Type_size_x(datatype, &datatype_size);
  23     FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteContig called on %s\n", myrank, 
  24             nprocs, fd->filename);
  25     FPRINTF(stdout, "[%d/%d]    writing (buf = %p, loc = %lld, sz = %lld)\n",
  26             myrank, nprocs, buf, (long long) offset, 
  27             (long long)datatype_size * (long long)count);
  28 
  29     if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
  30     {
  31         fd->fp_ind += datatype_size * count;
  32         fd->fp_sys_posn = fd->fp_ind;
  33         FPRINTF(stdout, "[%d/%d]    new file position is %lld\n", myrank, 
  34                 nprocs, (long long) fd->fp_ind);
  35     }
  36     else {
  37         fd->fp_sys_posn = offset + datatype_size * count;
  38     }
  39 
  40 #ifdef HAVE_STATUS_SET_BYTES
  41     MPIR_Status_set_bytes(status, datatype, datatype_size * count);
  42 #endif
  43 }
  44 
  45 void ADIOI_TESTFS_WriteStrided(ADIO_File fd, const void *buf, int count,
  46                                MPI_Datatype datatype, int file_ptr_type,
  47                                ADIO_Offset offset, ADIO_Status *status,
  48                                int *error_code)
  49 {
  50     int myrank, nprocs;
  51 
  52     *error_code = MPI_SUCCESS;
  53 
  54     MPI_Comm_size(fd->comm, &nprocs);
  55     MPI_Comm_rank(fd->comm, &myrank);
  56     FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_WriteStrided called on %s\n", 
  57             myrank, nprocs, fd->filename);
  58     FPRINTF(stdout, "[%d/%d]    calling ADIOI_GEN_WriteStrided\n", 
  59             myrank, nprocs);
  60 
  61     ADIOI_GEN_WriteStrided(fd, buf, count, datatype, file_ptr_type, offset, 
  62                            status, error_code);
  63 }

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