summaryrefslogtreecommitdiffstats
path: root/perform/pio_engine.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-05-28 04:04:18 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-05-28 04:04:18 (GMT)
commitacac31a7f4d5c2b6d11fd317bef0ba37a98d9ed5 (patch)
tree026b774266135d9e30537d91cb9742a73c6f929a /perform/pio_engine.c
parentbb5b53d9baac260ce96fbd6ca3f7fc44812fbdb2 (diff)
downloadhdf5-acac31a7f4d5c2b6d11fd317bef0ba37a98d9ed5.zip
hdf5-acac31a7f4d5c2b6d11fd317bef0ba37a98d9ed5.tar.gz
hdf5-acac31a7f4d5c2b6d11fd317bef0ba37a98d9ed5.tar.bz2
[svn-r5463] Description:
Folded the changes made in v1.4 into v1.5. print library version information in help page too. Specify the nofill feature supported in v1.5 only. Print the values of the KB, MB and GB in case a user wants to see them. Setup a macro, H5_HAVE_NOFILL, to indicate if Dataset no fill feature is supported. If not, --no-fill is an invalid option. Platforms tested: modi4
Diffstat (limited to 'perform/pio_engine.c')
-rw-r--r--perform/pio_engine.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index 54478a8..65d8d2d 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -445,7 +445,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
off_t nelmts, size_t buf_size, void *buffer)
{
int ret_code = SUCCESS;
- long rc; /*routine return code */
+ int rc; /*routine return code */
int mrc; /*MPI return code */
MPI_Offset mpi_offset;
MPI_Status mpi_status;
@@ -534,7 +534,7 @@ fprintf(stderr, "buffer size=%ld\n", buf_size);
} /* end if */
} /* end if */
-#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
+#ifdef H5_HAVE_NOFILL
/* Disable writing fill values if asked */
if(parms->h5_no_fill) {
hrc = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
@@ -618,14 +618,17 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
file_offset = dset_offset + (off_t)(elmts_begin + nelmts_written)*ELMT_SIZE;
#if AKCDEBUG
-fprintf(stderr, "proc %d: writes %ld bytes at file-offset %ld\n",
- pio_mpi_rank_g, nelmts_towrite*ELMT_SIZE, file_offset);
+HDfprintf(stderr, "proc %d: write %Hd bytes at file-offset %Hd\n",
+ pio_mpi_rank_g, (long_long)nelmts_towrite*ELMT_SIZE, (long_long)file_offset);
#endif
- rc = POSIXSEEK(fd->posixfd, file_offset);
- VRFY((rc>=0), "POSIXSEEK");
- rc = POSIXWRITE(fd->posixfd, buffer, (size_t)(nelmts_towrite * ELMT_SIZE));
- VRFY((rc == (nelmts_towrite*ELMT_SIZE)), "POSIXWRITE");
+ /* only care if seek returns error */
+ rc = POSIXSEEK(fd->posixfd, file_offset) < 0 ? -1 : 0;
+ VRFY((rc==0), "POSIXSEEK");
+ /* check if all bytes are written */
+ rc = ((nelmts_towrite*ELMT_SIZE) ==
+ POSIXWRITE(fd->posixfd, buffer, nelmts_towrite*ELMT_SIZE));
+ VRFY((rc != 0), "POSIXWRITE");
break;
case MPIO:
@@ -726,7 +729,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
off_t nelmts, size_t buf_size, void *buffer /*out*/)
{
int ret_code = SUCCESS;
- long rc; /*routine return code */
+ int rc; /*routine return code */
int mrc; /*MPI return code */
MPI_Offset mpi_offset;
MPI_Status mpi_status;
@@ -849,14 +852,17 @@ fprintf(stderr, "proc %d: elmts_begin=%ld, elmts_count=%ld\n",
file_offset = dset_offset + (off_t)(elmts_begin + nelmts_read)*ELMT_SIZE;
#if AKCDEBUG
-fprintf(stderr, "proc %d: read %ld bytes at file-offset %ld\n",
- pio_mpi_rank_g, nelmts_toread*ELMT_SIZE, file_offset);
+HDfprintf(stderr, "proc %d: read %Hd bytes at file-offset %Hd\n",
+ pio_mpi_rank_g, (long_long)nelmts_towrite*ELMT_SIZE, (long_long)file_offset);
#endif
- rc = POSIXSEEK(fd->posixfd, file_offset);
- VRFY((rc>=0), "POSIXSEEK");
- rc = POSIXREAD(fd->posixfd, buffer, (size_t)(nelmts_toread*ELMT_SIZE));
- VRFY((rc==(nelmts_toread*ELMT_SIZE)), "POSIXREAD");
+ /* only care if seek returns error */
+ rc = POSIXSEEK(fd->posixfd, file_offset) < 0 ? -1 : 0;
+ VRFY((rc==0), "POSIXSEEK");
+ /* check if all bytes are read */
+ rc = ((nelmts_toread*ELMT_SIZE) ==
+ POSIXREAD(fd->posixfd, buffer, nelmts_toread*ELMT_SIZE));
+ VRFY((rc != 0), "POSIXREAD");
break;
case MPIO: