[Darshan-commits] [Git][darshan/darshan][master] bug fix in bgq back compat code

Shane Snyder xgitlab at cels.anl.gov
Thu Jul 7 15:03:50 CDT 2016


Shane Snyder pushed to branch master at darshan / darshan


Commits:
cc619189 by Shane Snyder at 2016-07-07T20:03:10+00:00
bug fix in bgq back compat code

- - - - -


1 changed file:

- darshan-util/darshan-bgq-logutils.c


Changes:

=====================================
darshan-util/darshan-bgq-logutils.c
=====================================
--- a/darshan-util/darshan-bgq-logutils.c
+++ b/darshan-util/darshan-bgq-logutils.c
@@ -30,7 +30,9 @@ char *bgq_f_counter_names[] = {
 };
 #undef X
 
-#define DARSHAN_BGQ_FILE_SIZE_1 (112 + sizeof(int))
+/* NOTE:
+ */
+#define DARSHAN_BGQ_FILE_SIZE_1 (112 + 8)
 
 static int darshan_log_get_bgq_rec(darshan_fd fd, void* bgq_buf);
 static int darshan_log_put_bgq_rec(darshan_fd fd, void* bgq_buf, int ver);
@@ -70,16 +72,18 @@ static int darshan_log_get_bgq_rec(darshan_fd fd, void* bgq_buf)
 
         rec_len = DARSHAN_BGQ_FILE_SIZE_1;
         ret = darshan_log_get_mod(fd, DARSHAN_BGQ_MOD, buffer, rec_len);
-        if(ret == rec_len)
+        if(ret > 0)
         {
             /* up-convert old BGQ format to new format */
             p = buffer;
             memcpy(&(rec->base_rec), p, sizeof(struct darshan_base_record));
-            p += sizeof(struct darshan_base_record);
-            p += sizeof(int);
+            /* skip however long int+padding is */
+            p += (rec_len - (BGQ_NUM_INDICES * sizeof(int64_t)) -
+                (BGQ_F_NUM_INDICES * sizeof(double)));
             memcpy(&(rec->counters[0]), p, BGQ_NUM_INDICES * sizeof(int64_t));
             p += (BGQ_NUM_INDICES * sizeof(int64_t));
             memcpy(&(rec->fcounters[0]), p, BGQ_F_NUM_INDICES * sizeof(double));
+            ret = rec_len;
         }
         free(buffer);
     }



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/cc6191892c87ca3c70c4477992547989c4c28da6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160707/b527ee25/attachment-0001.html>


More information about the Darshan-commits mailing list