From e1e913f87c9adbcd1a10adb6471cfc1c232a929a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 15 Jun 2013 11:46:48 -0500 Subject: [svn-r23777] Implement SWMR-5: Replace H5Fflush in writer with H5Dflush and file close/reopen with H5Drefresh. Use cases seem to run faster. Keeping the old code so that later on, I may test the performance between the two. Tested: koala. --- test/use_common.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/use_common.c b/test/use_common.c index 98448c3..380ef6c 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -341,7 +341,12 @@ int write_uc_file(void) return -1; } /* flush file to make the just written plane available. */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0){ +#if 0 + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) +#else + if(H5Dflush(dsid) < 0) +#endif + { fprintf(stderr, "Failed to H5Fflush file\n"); return -1; } @@ -528,6 +533,7 @@ int read_uc_file(void) nplane_old=dims[0]; /* check if dataset has grown since last time */ +#if 0 /* close dsid and file, then reopen them */ if (H5Dclose(dsid) < 0){ fprintf(stderr, "H5Dclose failed\n"); @@ -545,6 +551,9 @@ int read_uc_file(void) fprintf(stderr, "H5Dopen2 failed\n"); return -1; } +#else + H5Drefresh(dsid); +#endif f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){ fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); -- cgit v0.12