[FLASH-USERS] Patch for FLASH4.5 with HDF5 1.10.x

Klaus Weide klaus at flash.uchicago.edu
Thu Dec 14 14:26:06 EST 2017


On Tue, 12 Dec 2017, Yingchao Lu wrote:

> I tried to build and run lasslab problem in FLASH4.5. The HDF5 version I
> used is 1.10.0-patch. I got the error as attached.

I have attached a patch, and would appreciate if you could try whether it 
solves the reported problems.

Apply with

  patch -p0 <FLASH4.5-a.diff

in the top FLASH directory (above "source").

Note this applies only to FLASH using HDF5 of versions > 1.8 for I/O.
People not using such a version of HDF5 (and not planning to) can 
disregard.

IF there are remaining problems when using HDF5 1.10, they might
be related to the LaserIO feature of the EnergyDeposition unit.
If that applies, please try turning it off (by setting 
runtime parameter ed_useLaserIO = .FALSE.)

Klaus
-------------- next part --------------
Index: source/IO/IOTypes/hdf5/io_h5_read_file_format.c
===================================================================
--- source/IO/IOTypes/hdf5/io_h5_read_file_format.c	(revision 26135)
+++ source/IO/IOTypes/hdf5/io_h5_read_file_format.c	(revision 26136)
@@ -2,11 +2,11 @@
 #define DEBUG_IO
 
 void FTOC(io_h5_read_file_format)(const int * const pMyPE,
-				  const int * const pFileID,
+				  const hid_t * const pFileID,
 				  int *pFileFormat)
 {
   const int myPE = *pMyPE;
-  const hid_t fileID = (hid_t) *pFileID;
+  const hid_t fileID = *pFileID;
   hid_t dset, dtypeInt;
   int err;
 #ifdef DEBUG_IO
Index: source/IO/IOTypes/hdf5/io_h5_read_file_format.h
===================================================================
--- source/IO/IOTypes/hdf5/io_h5_read_file_format.h	(revision 26135)
+++ source/IO/IOTypes/hdf5/io_h5_read_file_format.h	(revision 26136)
@@ -19,7 +19,7 @@
 #endif
 
 void FTOC(io_h5_read_file_format)(const int * const pMyPE,
-				  const int * const pFileID,
+				  const hid_t * const pFileID,
 				  int *pFileFormat);
 
 #endif
Index: source/IO/IOMain/hdf5/io_h5_read_present_dims.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5_read_present_dims.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5_read_present_dims.c	(revision 26136)
@@ -4,7 +4,7 @@
 #include "constants.h"
 #include "Flash.h"
 
-void FTOC(io_h5read_present_dims)(const int * const pFileID,
+void FTOC(io_h5read_present_dims)(const hid_t * const pFileID,
 				  int *pDims)
 {
   hsize_t dimens_2d[2], maxdimens_2d[2];
@@ -12,8 +12,10 @@
   herr_t herr;
   int ierr;
 
-  assert (sizeof(int) == sizeof(hid_t));
-  fileID = (hid_t) *pFileID;
+  /* We used to make the assumption hid_t == int everywhere in FLASH.
+     This used to be okay because hid_t was a typedef of int in HDF5 up to 1.8.x */
+  /*assert (sizeof(int) == sizeof(hid_t));*/
+  fileID = *pFileID;
 
   dataset = H5Dopen(fileID, "coordinates");
   assert (dataset >= 0);
Index: source/IO/IOMain/hdf5/io_h5create_dataset_protons.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5create_dataset_protons.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5create_dataset_protons.c	(revision 26136)
@@ -4,7 +4,7 @@
 #include <hdf5.h>
 
 
-void FTOC(io_h5create_dataset_protons)(const int * const pFileID)
+void FTOC(io_h5create_dataset_protons)(const hid_t * const pFileID)
 {
   /* Create the data space with unlimited 1st dimension,
      since we don't know how many protons will be written
Index: source/IO/IOMain/hdf5/io_h5_xfer_wrapper.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5_xfer_wrapper.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5_xfer_wrapper.c	(revision 26136)
@@ -22,7 +22,7 @@
   char nullTermDebugStr[1000];
 
 
-  /* We used to make the assumption hid_t == int assumption everywhere in FLASH.
+  /* We used to make the assumption hid_t == int everywhere in FLASH.
      This used to be okay because hid_t was a typedef of int in HDF5.
      The next assert notified us when hid_t changed in HDF5 1.10.x. */
   /*assert (sizeof(int) == sizeof(hid_t));*/
Index: source/IO/IOMain/hdf5/io_h5write_protondata.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5write_protondata.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5write_protondata.c	(revision 26136)
@@ -5,7 +5,7 @@
 #include "constants.h"
 #include "hdf5_flash.h"
 
-void FTOC(io_h5write_protondata)(int *pFileID,
+void FTOC(io_h5write_protondata)(hid_t *pFileID,
                                  int *rank,
 			         int *localPoints,
 			         int *globalPoints,
Index: source/IO/IOMain/hdf5/io_h5create_raydset.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5create_raydset.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5create_raydset.c	(revision 26136)
@@ -4,7 +4,7 @@
 #include <hdf5.h>
 
 
-void FTOC(io_h5create_raydset)(const int * const pFileID)
+void FTOC(io_h5create_raydset)(const hid_t * const pFileID)
 {
   /* Create the data space with unlimited dimensions. */
   hsize_t dims[2] = {0, 5};
Index: source/IO/IOMain/hdf5/io_h5write_raydata.c
===================================================================
--- source/IO/IOMain/hdf5/io_h5write_raydata.c	(revision 26135)
+++ source/IO/IOMain/hdf5/io_h5write_raydata.c	(revision 26136)
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include "hdf5_flash.h"
 
-void FTOC(io_h5write_raydata)(int * pFileID,
+void FTOC(io_h5write_raydata)(hid_t * pFileID,
 			      int * totalPos,
 			      int *ierr,
 			      int *startPos,


More information about the flash-users mailing list