[Darshan-commits] [Git][darshan/darshan][master] 2 commits: bug fix in writing of name records

Shane Snyder xgitlab at cels.anl.gov
Wed Aug 17 21:32:18 CDT 2016


Shane Snyder pushed to branch master at darshan / darshan


Commits:
d4dc84f4 by Shane Snyder at 2016-08-17T21:30:12-05:00
bug fix in writing of name records

- - - - -
49ebb1b4 by Shane Snyder at 2016-08-17T21:30:47-05:00
make sure to write records in current version

- - - - -


9 changed files:

- darshan-util/darshan-bgq-logutils.c
- darshan-util/darshan-hdf5-logutils.c
- darshan-util/darshan-logutils.c
- darshan-util/darshan-lustre-logutils.c
- darshan-util/darshan-mpiio-logutils.c
- darshan-util/darshan-null-logutils.c
- darshan-util/darshan-pnetcdf-logutils.c
- darshan-util/darshan-posix-logutils.c
- darshan-util/darshan-stdio-logutils.c


Changes:

=====================================
darshan-util/darshan-bgq-logutils.c
=====================================
--- a/darshan-util/darshan-bgq-logutils.c
+++ b/darshan-util/darshan-bgq-logutils.c
@@ -120,7 +120,7 @@ static int darshan_log_put_bgq_rec(darshan_fd fd, void* bgq_buf, int ver)
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_BGQ_MOD, rec,
-        sizeof(struct darshan_bgq_record), ver);
+        sizeof(struct darshan_bgq_record), DARSHAN_BGQ_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-hdf5-logutils.c
=====================================
--- a/darshan-util/darshan-hdf5-logutils.c
+++ b/darshan-util/darshan-hdf5-logutils.c
@@ -85,7 +85,7 @@ static int darshan_log_put_hdf5_file(darshan_fd fd, void* hdf5_buf, int ver)
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_HDF5_MOD, file,
-        sizeof(struct darshan_hdf5_file), ver);
+        sizeof(struct darshan_hdf5_file), DARSHAN_HDF5_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-logutils.c
=====================================
--- a/darshan-util/darshan-logutils.c
+++ b/darshan-util/darshan-logutils.c
@@ -593,15 +593,15 @@ int darshan_log_put_namehash(darshan_fd fd, struct darshan_name_record_ref *hash
     assert(state);
 
     /* allocate memory for largest possible hash record */
-    name_rec = malloc(sizeof(struct darshan_name_record) + PATH_MAX);
+    name_rec = malloc(sizeof(darshan_record_id) + PATH_MAX + 1);
     if(!name_rec)
         return(-1);
-    memset(name_rec, 0, sizeof(struct darshan_name_record) + PATH_MAX);
+    memset(name_rec, 0, sizeof(darshan_record_id) + PATH_MAX + 1);
 
     /* individually serialize each hash record and write to log file */
     HASH_ITER(hlink, hash, ref, tmp)
     {
-        name_rec_len = sizeof(struct darshan_name_record) + strlen(ref->name_record->name);
+        name_rec_len = sizeof(darshan_record_id) + strlen(ref->name_record->name) + 1;
         memcpy(name_rec, ref->name_record, name_rec_len);
 
         /* write this hash entry to log file */


=====================================
darshan-util/darshan-lustre-logutils.c
=====================================
--- a/darshan-util/darshan-lustre-logutils.c
+++ b/darshan-util/darshan-lustre-logutils.c
@@ -94,7 +94,7 @@ static int darshan_log_put_lustre_record(darshan_fd fd, void* lustre_buf, int ve
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_LUSTRE_MOD, rec,
-        LUSTRE_RECORD_SIZE(rec->counters[LUSTRE_STRIPE_WIDTH]), ver);
+        LUSTRE_RECORD_SIZE(rec->counters[LUSTRE_STRIPE_WIDTH]), DARSHAN_LUSTRE_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-mpiio-logutils.c
=====================================
--- a/darshan-util/darshan-mpiio-logutils.c
+++ b/darshan-util/darshan-mpiio-logutils.c
@@ -85,7 +85,7 @@ static int darshan_log_put_mpiio_file(darshan_fd fd, void* mpiio_buf, int ver)
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_MPIIO_MOD, file,
-        sizeof(struct darshan_mpiio_file), ver);
+        sizeof(struct darshan_mpiio_file), DARSHAN_MPIIO_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-null-logutils.c
=====================================
--- a/darshan-util/darshan-null-logutils.c
+++ b/darshan-util/darshan-null-logutils.c
@@ -102,7 +102,7 @@ static int darshan_log_put_null_record(darshan_fd fd, void* null_buf, int ver)
 
     /* append NULL record to darshan log file */
     ret = darshan_log_put_mod(fd, DARSHAN_NULL_MOD, rec,
-        sizeof(struct darshan_null_record), ver);
+        sizeof(struct darshan_null_record), DARSHAN_NULL_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-pnetcdf-logutils.c
=====================================
--- a/darshan-util/darshan-pnetcdf-logutils.c
+++ b/darshan-util/darshan-pnetcdf-logutils.c
@@ -85,7 +85,7 @@ static int darshan_log_put_pnetcdf_file(darshan_fd fd, void* pnetcdf_buf, int ve
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_PNETCDF_MOD, file,
-        sizeof(struct darshan_pnetcdf_file), ver);
+        sizeof(struct darshan_pnetcdf_file), DARSHAN_PNETCDF_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-posix-logutils.c
=====================================
--- a/darshan-util/darshan-posix-logutils.c
+++ b/darshan-util/darshan-posix-logutils.c
@@ -120,7 +120,7 @@ static int darshan_log_put_posix_file(darshan_fd fd, void* posix_buf, int ver)
     int ret;
 
     ret = darshan_log_put_mod(fd, DARSHAN_POSIX_MOD, file,
-        sizeof(struct darshan_posix_file), ver);
+        sizeof(struct darshan_posix_file), DARSHAN_POSIX_VER);
     if(ret < 0)
         return(-1);
 


=====================================
darshan-util/darshan-stdio-logutils.c
=====================================
--- a/darshan-util/darshan-stdio-logutils.c
+++ b/darshan-util/darshan-stdio-logutils.c
@@ -99,7 +99,7 @@ static int darshan_log_put_stdio_record(darshan_fd fd, void* stdio_buf, int ver)
 
     /* append STDIO record to darshan log file */
     ret = darshan_log_put_mod(fd, DARSHAN_STDIO_MOD, rec,
-        sizeof(struct darshan_stdio_file), ver);
+        sizeof(struct darshan_stdio_file), DARSHAN_STDIO_VER);
     if(ret < 0)
         return(-1);
 



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/def2fe28c7684ac6662866baac07737df019c54f...49ebb1b4302c52588cf1d42d0132a36bedc9a50d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160817/856103d9/attachment-0001.html>


More information about the Darshan-commits mailing list