[Darshan-commits] [Git][darshan/darshan][dev-detailed-hdf5-mod] more back-compat code for h5d logutils

Shane Snyder xgitlab at cels.anl.gov
Thu Apr 2 12:08:40 CDT 2020



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


Commits:
a3e75fe8 by Shane Snyder at 2020-04-01T21:19:44-05:00
more back-compat code for h5d logutils

- - - - -


1 changed file:

- darshan-util/darshan-logutils.c


Changes:

=====================================
darshan-util/darshan-logutils.c
=====================================
@@ -872,6 +872,7 @@ static int darshan_log_get_namerecs(void *name_rec_buf, int buf_len,
 static int darshan_log_get_header(darshan_fd fd)
 {
     struct darshan_header header;
+    double log_ver_val;
     int i;
     int ret;
 
@@ -895,11 +896,8 @@ static int darshan_log_get_header(darshan_fd fd)
     {
         fd->state->get_namerecs = darshan_log_get_namerecs_3_00;
     }
-    else if(strcmp(fd->version, "3.10") == 0)
-    {
-        /* XXX */
-    }
-    else if(strcmp(fd->version, "3.20") == 0)
+    else if((strcmp(fd->version, "3.10") == 0) ||
+            (strcmp(fd->version, "3.20") == 0))
     {
         fd->state->get_namerecs = darshan_log_get_namerecs;
     }
@@ -967,6 +965,18 @@ static int darshan_log_get_header(darshan_fd fd)
     memcpy(&fd->name_map, &(header.name_map), sizeof(struct darshan_log_map));
     memcpy(&fd->mod_map, &(header.mod_map), DARSHAN_MAX_MODS * sizeof(struct darshan_log_map));
 
+    log_ver_val = atof(fd->version);
+    if(log_ver_val < 3.2)
+    {
+        /* perform module index shift to account for H5D module from 3.2.0 */
+        memmove(&fd->mod_map[DARSHAN_H5D_MOD+1], &fd->mod_map[DARSHAN_H5D_MOD],
+            (DARSHAN_MAX_MODS-DARSHAN_H5D_MOD-1) * sizeof(struct darshan_log_map));
+        memmove(&fd->mod_ver[DARSHAN_H5D_MOD+1], &fd->mod_ver[DARSHAN_H5D_MOD],
+            (DARSHAN_MAX_MODS-DARSHAN_H5D_MOD-1) * sizeof(uint32_t));
+        fd->mod_map[DARSHAN_H5D_MOD].len = fd->mod_map[DARSHAN_H5D_MOD].off = 0;
+        fd->mod_ver[DARSHAN_H5D_MOD] = 0;
+    }
+
     /* there may be nothing following the job data, so safety check map */
     fd->job_map.off = sizeof(struct darshan_header);
     if(fd->name_map.off == 0)



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/a3e75fe8b657da3ffdb72abef3a8dadf95da8145

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/a3e75fe8b657da3ffdb72abef3a8dadf95da8145
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/20200402/2884c78d/attachment-0001.html>


More information about the Darshan-commits mailing list