[Darshan-commits] [Git][darshan/darshan][dev-detailed-hdf5-mod] 2 commits: update autoconf support for hdf5 module

Shane Snyder xgitlab at cels.anl.gov
Fri Apr 3 16:51:28 CDT 2020



Shane Snyder pushed to branch dev-detailed-hdf5-mod at darshan / darshan


Commits:
e1618f83 by Shane Snyder at 2020-04-03T16:50:43-05:00
update autoconf support for hdf5 module

- - - - -
bd18bb02 by Shane Snyder at 2020-04-03T16:51:03-05:00
hdf5 hyperslab fns only supported 1.10+

- - - - -


4 changed files:

- darshan-runtime/configure
- darshan-runtime/configure.in
- darshan-runtime/darshan-runtime-config.h.in
- darshan-runtime/lib/darshan-hdf5.c


Changes:

=====================================
darshan-runtime/configure
=====================================
@@ -720,9 +720,8 @@ enable_posix_mod
 enable_stdio_mod
 enable_dxt_mod
 enable_mpiio_mod
+enable_hdf5_mod
 enable_pnetcdf_mod
-enable_HDF5_post_1_10
-enable_HDF5_pre_1_10
 enable_bgq_mod
 enable_lustre_mod
 enable_mdhim
@@ -1368,12 +1367,9 @@ Optional Features:
   --disable-dxt-mod       Disables compilation and use of DXT module
   --disable-mpiio-mod     Disables compilation and use of MPI-IO module
                           (requires MPI)
+  --enable-hdf5-mod       Enables compilation and use of HDF5 module
   --disable-pnetcdf-mod   Disables compilation and use of PnetCDF module
                           (requires MPI)
-  --enable-HDF5-post-1.10
-                          Enable HDF5 module for HDF5 version 1.10 or later
-  --enable-HDF5-pre-1.10
-                          Enable HDF5 module for HDF5 versions earlier than 1.10
   --disable-bgq-mod       Disables compilation and use of BG/Q module (for
                           BG/Q systems)
   --disable-lustre-mod    Disables compilation and use of Lustre module
@@ -4106,6 +4102,19 @@ if test "x$enable_mpiio_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
       DARSHAN_MPIIO_LD_OPTS=
 fi
 
+# HDF5 module (disabled by default)
+BUILD_HDF5_MODULE=
+DARSHAN_HDF5_LD_OPTS=
+# Check whether --enable-hdf5-mod was given.
+if test "${enable_hdf5_mod+set}" = set; then :
+  enableval=$enable_hdf5_mod;
+fi
+
+if test "x$enable_hdf5_mod" = "xyes"; then :
+  BUILD_HDF5_MODULE=1
+    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
+fi
+
 # PNETCDF module
 BUILD_PNETCDF_MODULE=1
 DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
@@ -4119,41 +4128,6 @@ if test "x$enable_pnetcdf_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
       DARSHAN_PNETCDF_LD_OPTS=
 fi
 
-# HDF5 module
-BUILD_HDF5_MODULE=
-BUILD_HDF5_POST110=
-DARSHAN_HDF5_LD_OPTS=
-
-# see if user explicitly enabled support for an HDF5 API
-# Check whether --enable-HDF5-post-1.10 was given.
-if test "${enable_HDF5_post_1_10+set}" = set; then :
-  enableval=$enable_HDF5_post_1_10; if test "x$enableval" = "xyes" ; then
-
-$as_echo "#define __DARSHAN_ENABLE_HDF5110 1" >>confdefs.h
-
-    if test "x$BUILD_HDF5_MODULE" = "x1"; then
-        as_fn_error $? "Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10" "$LINENO" 5
-    fi
-    BUILD_HDF5_MODULE=1
-    BUILD_HDF5_POST110=1
-    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
-fi
-
-fi
-
-# Check whether --enable-HDF5-pre-1.10 was given.
-if test "${enable_HDF5_pre_1_10+set}" = set; then :
-  enableval=$enable_HDF5_pre_1_10; if test "x$enableval" = "xyes" ; then
-    if test "x$BUILD_HDF5_MODULE" = "x1"; then
-        as_fn_error $? "Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10" "$LINENO" 5
-    fi
-    BUILD_HDF5_MODULE=1
-    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
-fi
-
-fi
-
-
 # BG/Q module
 BUILD_BGQ_MODULE=
 # Check whether --enable-bgq-mod was given.
@@ -6194,25 +6168,19 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: MPIIO module support:   yes" >&5
 $as_echo "$as_me: MPIIO module support:   yes" >&6;}
 fi
+if test "x$BUILD_HDF5_MODULE" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    no" >&5
+$as_echo "$as_me: HDF5 module support:    no" >&6;}
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    yes" >&5
+$as_echo "$as_me: HDF5 module support:    yes" >&6;}
+fi
 if test "x$BUILD_PNETCDF_MODULE" = "x"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: no" >&5
 $as_echo "$as_me: PnetCDF module support: no" >&6;}
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: yes" >&5
 $as_echo "$as_me: PnetCDF module support: yes" >&6;}
-fi
-if test "x$BUILD_HDF5_MODULE" = "x"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    no" >&5
-$as_echo "$as_me: HDF5 module support:    no" >&6;}
-elif if test "x$BUILD_HDF5_POST110" = "x1"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    1.10+" >&5
-$as_echo "$as_me: HDF5 module support:    1.10+" >&6;}
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support:    pre-1.10" >&5
-$as_echo "$as_me: HDF5 module support:    pre-1.10" >&6;}
-
-fi; then :
-
 fi
 if test "x$BUILD_BGQ_MODULE" = "x"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: BG/Q module support:    no" >&5


=====================================
darshan-runtime/configure.in
=====================================
@@ -219,6 +219,15 @@ AS_IF([test "x$enable_mpiio_mod" = "xno" || test "x$ENABLE_MPI" = "x"],
       BUILD_MPIIO_MODULE=
       DARSHAN_MPIIO_LD_OPTS=)
 
+# HDF5 module (disabled by default)
+BUILD_HDF5_MODULE=
+DARSHAN_HDF5_LD_OPTS=
+AC_ARG_ENABLE(hdf5-mod,
+              AS_HELP_STRING([--enable-hdf5-mod], [Enables compilation and use of HDF5 module]))
+AS_IF([test "x$enable_hdf5_mod" = "xyes"],
+    BUILD_HDF5_MODULE=1
+    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts")
+
 # PNETCDF module
 BUILD_PNETCDF_MODULE=1
 DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
@@ -228,37 +237,6 @@ AS_IF([test "x$enable_pnetcdf_mod" = "xno" || test "x$ENABLE_MPI" = "x"],
       BUILD_PNETCDF_MODULE=
       DARSHAN_PNETCDF_LD_OPTS=)
 
-# HDF5 module
-BUILD_HDF5_MODULE=
-BUILD_HDF5_POST110=
-DARSHAN_HDF5_LD_OPTS=
-
-# see if user explicitly enabled support for an HDF5 API
-AC_ARG_ENABLE(HDF5-post-1.10,
-[  --enable-HDF5-post-1.10
-                          Enable HDF5 module for HDF5 version 1.10 or later],
-[if test "x$enableval" = "xyes" ; then
-    AC_DEFINE(__DARSHAN_ENABLE_HDF5110, 1, Set for compatibility with HDF5 1.10.x, breaks use with versions earlier than 1.10)
-    if test "x$BUILD_HDF5_MODULE" = "x1"; then
-        AC_MSG_ERROR([Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10])
-    fi
-    BUILD_HDF5_MODULE=1
-    BUILD_HDF5_POST110=1
-    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
-fi]
-,)
-AC_ARG_ENABLE(HDF5-pre-1.10,
-[  --enable-HDF5-pre-1.10
-                          Enable HDF5 module for HDF5 versions earlier than 1.10],
-[if test "x$enableval" = "xyes" ; then
-    if test "x$BUILD_HDF5_MODULE" = "x1"; then
-        AC_MSG_ERROR([Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10])
-    fi
-    BUILD_HDF5_MODULE=1
-    DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
-fi]
-,)
-
 # BG/Q module
 BUILD_BGQ_MODULE=
 AC_ARG_ENABLE(bgq-mod,
@@ -532,16 +510,8 @@ AS_IF([test "x$BUILD_POSIX_MODULE" = "x"],   [AC_MSG_NOTICE(POSIX module support
 AS_IF([test "x$BUILD_STDIO_MODULE" = "x"],   [AC_MSG_NOTICE(STDIO module support:   no)], [AC_MSG_NOTICE(STDIO module support:   yes)])
 AS_IF([test "x$BUILD_DXT_MODULE" = "x"],    [AC_MSG_NOTICE(DXT module support:     no)], [AC_MSG_NOTICE(DXT module support:     yes)])
 AS_IF([test "x$BUILD_MPIIO_MODULE" = "x"],   [AC_MSG_NOTICE(MPIIO module support:   no)], [AC_MSG_NOTICE(MPIIO module support:   yes)])
+AS_IF([test "x$BUILD_HDF5_MODULE" = "x"], [AC_MSG_NOTICE(HDF5 module support:    no)], [AC_MSG_NOTICE(HDF5 module support:    yes)])
 AS_IF([test "x$BUILD_PNETCDF_MODULE" = "x"], [AC_MSG_NOTICE(PnetCDF module support: no)], [AC_MSG_NOTICE(PnetCDF module support: yes)])
-AS_IF(
-    [test "x$BUILD_HDF5_MODULE" = "x"],
-    [AC_MSG_NOTICE(HDF5 module support:    no)],
-    [AS_IF(
-        [test "x$BUILD_HDF5_POST110" = "x1"],
-        [AC_MSG_NOTICE(HDF5 module support:    1.10+)],
-        [AC_MSG_NOTICE(HDF5 module support:    pre-1.10)]
-    )],
-)
 AS_IF([test "x$BUILD_BGQ_MODULE" = "x"],     [AC_MSG_NOTICE(BG/Q module support:    no)], [AC_MSG_NOTICE(BG/Q module support:    yes)])
 AS_IF([test "x$BUILD_LUSTRE_MODULE" = "x"],  [AC_MSG_NOTICE(Lustre module support:  no)], [AC_MSG_NOTICE(Lustre module support:  yes)])
 AS_IF([test "x$BUILD_MDHIM_MODULE" = "x"],   [AC_MSG_NOTICE(MDHIM module support:   no)], [AC_MSG_NOTICE(MDHIM module support:   yes)])


=====================================
darshan-runtime/darshan-runtime-config.h.in
=====================================
@@ -93,9 +93,6 @@
 /* Define if cuserid() should be disabled */
 #undef __DARSHAN_DISABLE_CUSERID
 
-/* Set for compatibility with HDF5 1.10.x */
-#undef __DARSHAN_ENABLE_HDF5110
-
 /* Define if Darshan should mmap data structures to log file */
 #undef __DARSHAN_ENABLE_MMAP_LOGS
 


=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -165,15 +165,10 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
     hid_t ret;
     char* tmp;
     double tm1, tm2;
-#if 0
     unsigned majnum, minnum, relnum;
 
     H5get_libversion(&majnum, &minnum, &relnum);
-#ifdef __DARSHAN_ENABLE_HDF5110
-    if(majnum < 1 || (majnum == 1 && minnum < 10))
-#else
-    if(majnum > 1 || (majnum == 1 && minnum >= 10))
-#endif
+    if((majnum != H5_VERS_MAJOR) && (minnum != H5_VERS_MINOR))
     {
         if(my_rank < 0)
             MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
@@ -183,7 +178,6 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
         }
         return(-1);
     }
-#endif
 
     MAP_OR_FAIL(H5Fcreate);
 
@@ -217,15 +211,10 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
     hid_t ret;
     char* tmp;
     double tm1, tm2;
-#if 0
     unsigned majnum, minnum, relnum;
 
     H5get_libversion(&majnum, &minnum, &relnum);
-#ifdef __DARSHAN_ENABLE_HDF5110
-    if(majnum < 1 || (majnum == 1 && minnum < 10))
-#else
-    if(majnum > 1 || (majnum == 1 && minnum >= 10))
-#endif
+    if((majnum != H5_VERS_MAJOR) && (minnum != H5_VERS_MINOR))
     {
         if(my_rank < 0)
             MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
@@ -235,7 +224,6 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
         }
         return(-1);
     }
-#endif
 
     MAP_OR_FAIL(H5Fopen);
 
@@ -599,6 +587,7 @@ herr_t H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
                 file_sel_npoints = H5Sget_select_npoints(file_space_id);
                 file_sel_type = H5Sget_select_type(file_space_id);
             }
+#if (H5_VERS_MAJOR > 1) || ((H5_VERS_MAJOR == 1) && (H5_VERS_MINOR >= 10))
             if(file_sel_type == H5S_SEL_ALL)
                 rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
             else if(file_sel_type == H5S_SEL_POINTS)
@@ -621,6 +610,16 @@ herr_t H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
                 else
                     rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
             }
+#else
+            rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] = -1;
+            rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] = -1;
+            rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] = -1;
+            for(i = 0; i < H5D_MAX_NDIMS; i++)
+            {
+                common_access_vals[1+i] = -1;
+                common_access_vals[1+i+H5D_MAX_NDIMS] = -1;
+            }
+#endif
             type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
             access_size = file_sel_npoints * type_size;
             rec_ref->dataset_rec->counters[H5D_BYTES_READ] += access_size;
@@ -707,10 +706,11 @@ herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
                 file_sel_npoints = H5Sget_select_npoints(file_space_id);
                 file_sel_type = H5Sget_select_type(file_space_id);
             }
-            if(file_sel_type == H5S_SEL_POINTS)
-                rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
-            else if(file_sel_type == H5S_SEL_ALL)
+#if (H5_VERS_MAJOR > 1) || ((H5_VERS_MAJOR == 1) && (H5_VERS_MINOR >= 10))
+            if(file_sel_type == H5S_SEL_ALL)
                 rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
+            else if(file_sel_type == H5S_SEL_POINTS)
+                rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
             else
             {
                 if(H5Sis_regular_hyperslab(file_space_id))
@@ -729,6 +729,16 @@ herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
                 else
                     rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
             }
+#else
+            rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] = -1;
+            rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] = -1;
+            rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] = -1;
+            for(i = 0; i < H5D_MAX_NDIMS; i++)
+            {
+                common_access_vals[1+i] = -1;
+                common_access_vals[1+i+H5D_MAX_NDIMS] = -1;
+            }
+#endif
             type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
             access_size = file_sel_npoints * type_size;
             rec_ref->dataset_rec->counters[H5D_BYTES_WRITTEN] += access_size;



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/8e0847f7006225ff6f700156ff62cfbb066e5e0c...bd18bb02cddc54d5450d6d91098e4ac19d60222e

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/8e0847f7006225ff6f700156ff62cfbb066e5e0c...bd18bb02cddc54d5450d6d91098e4ac19d60222e
You're receiving this email because of your account on xgitlab.cels.anl.gov.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20200403/fdabe3bd/attachment-0001.html>


More information about the Darshan-commits mailing list