Feature #1983: Made CmiWallTimer monotonic in the common case
[charm.git] / src / libs / ck-libs / ampi / romio / adio / ad_piofs / ad_piofs_iread.c
blobe834bfacfa45fac1029f976563f536afaced92ad
1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3 * $Id$
5 * Copyright (C) 1997 University of Chicago.
6 * See COPYRIGHT notice in top-level directory.
7 */
9 #include "ad_piofs.h"
11 void ADIOI_PIOFS_IreadContig(ADIO_File fd, void *buf, int count,
12 MPI_Datatype datatype, int file_ptr_type,
13 ADIO_Offset offset, ADIO_Request *request, int *error_code)
15 ADIO_Status status;
16 int len, typesize;
18 /* PIOFS does not support nonblocking I/O. Therefore, use blocking I/O */
20 *request = ADIOI_Malloc_request();
21 (*request)->optype = ADIOI_READ;
22 (*request)->fd = fd;
23 (*request)->queued = 0;
24 (*request)->datatype = datatype;
26 MPI_Type_size(datatype, &typesize);
27 len = count * typesize;
28 ADIOI_PIOFS_ReadContig(fd, buf, len, MPI_BYTE, file_ptr_type, offset,
29 &status, error_code);
31 #ifdef HAVE_STATUS_SET_BYTES
32 if (*error_code == MPI_SUCCESS) {
33 MPI_Get_elements(&status, MPI_BYTE, &len);
34 (*request)->nbytes = len;
36 #endif
38 fd->async_count++;
43 void ADIOI_PIOFS_IreadStrided(ADIO_File fd, void *buf, int count,
44 MPI_Datatype datatype, int file_ptr_type,
45 ADIO_Offset offset, ADIO_Request *request, int
46 *error_code)
48 ADIO_Status status;
49 #ifdef HAVE_STATUS_SET_BYTES
50 int typesize;
51 #endif
53 /* PIOFS does not support nonblocking I/O. Therefore, use blocking I/O */
55 *request = ADIOI_Malloc_request();
56 (*request)->optype = ADIOI_READ;
57 (*request)->fd = fd;
58 (*request)->queued = 0;
59 (*request)->datatype = datatype;
61 ADIOI_PIOFS_ReadStrided(fd, buf, count, datatype, file_ptr_type,
62 offset, &status, error_code);
64 fd->async_count++;
66 #ifdef HAVE_STATUS_SET_BYTES
67 if (*error_code == MPI_SUCCESS) {
68 MPI_Type_size(datatype, &typesize);
69 (*request)->nbytes = count * typesize;
71 #endif