diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/WriteIsosurface.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/WriteIsosurface.c b/src/WriteIsosurface.c index 19c3f51..db0171a 100644 --- a/src/WriteIsosurface.c +++ b/src/WriteIsosurface.c @@ -51,10 +51,11 @@ int IOHDF5_WriteIsosurface (cGH *GH, int nVertices, CCTK_REAL4 *vertices) { - hid_t h5file, fapl; + hid_t h5file, plist; hid_t aspace, dataspace, dataset; hid_t group0, group1, group2, group3, group4; hsize_t dim [2]; + H5FD_stream_fapl_t fapl; char sliceName [40], *isoVarname; int isSocketURL; sliceInfo_t *sliceInfo; @@ -71,28 +72,40 @@ int IOHDF5_WriteIsosurface (cGH *GH, CACTUS_IOHDF5_ERROR (hdf5_string = H5Tcopy (H5T_C_S1)); } - CACTUS_IOHDF5_ERROR (fapl = H5Pcreate (H5P_FILE_ACCESS)); + CACTUS_IOHDF5_ERROR (plist = H5Pcreate (H5P_FILE_ACCESS)); isSocketURL = strncasecmp (filename, SOCKET_URL_PREFIX, SOCKET_URL_PREFIX_LEN) == 0; - if (isSocketURL) { -#ifndef H5FDstream_H + if (isSocketURL) + { +#ifndef H5_HAVE_STREAM CCTK_WARN (1, "The configured HDF5 installation doesn't include the Stream " "VFD. No HDF5 streaming output available !"); - CACTUS_IOHDF5_ERROR (H5Pclose (fapl)); + CACTUS_IOHDF5_ERROR (H5Pclose (plist)); return (-1); #else - CACTUS_IOHDF5_ERROR (H5Pset_fapl_stream (fapl, 0, -1)); + /* set VFD to stream and open the file */ + fapl.increment = 0; + fapl.socket = -1; + fapl.do_socket_io = 1; + fapl.backlog = 5; + fapl.broadcast_fn = NULL; + fapl.broadcast_arg = NULL; + + CACTUS_IOHDF5_ERROR (H5Pset_fapl_stream (plist, &fapl)); sliceInfo = NULL; #endif - } else + } + else + { sliceInfo = (sliceInfo_t *) GetNamedData (isoFilesList, filename); + } /* create/open the file */ if (! sliceInfo) CACTUS_IOHDF5_ERROR (h5file = H5Fcreate (filename, H5F_ACC_TRUNC, - H5P_DEFAULT, fapl)); + H5P_DEFAULT, plist)); else - CACTUS_IOHDF5_ERROR (h5file = H5Fopen (filename, H5F_ACC_RDWR, fapl)); + CACTUS_IOHDF5_ERROR (h5file = H5Fopen (filename, H5F_ACC_RDWR, plist)); if (h5file < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "Could not create/open output file '%s'", filename); |