[Darshan-commits] [Git][darshan/darshan][dev-modular] bug fix for modules creating more than max records

Shane Snyder gitlab at xgitlab.cels.anl.gov
Fri Sep 25 15:03:07 CDT 2015


Shane Snyder pushed to branch dev-modular at darshan / darshan


Commits:
928fdff4 by Shane Snyder at 2015-09-25T15:02:25Z
bug fix for modules creating more than max records

- - - - -


7 changed files:

- darshan-runtime/darshan-core.h
- darshan-runtime/lib/darshan-bgq.c
- darshan-runtime/lib/darshan-core.c
- darshan-runtime/lib/darshan-hdf5.c
- darshan-runtime/lib/darshan-mpiio.c
- darshan-runtime/lib/darshan-pnetcdf.c
- darshan-runtime/lib/darshan-posix.c


Changes:

=====================================
darshan-runtime/darshan-core.h
=====================================
--- a/darshan-runtime/darshan-core.h
+++ b/darshan-runtime/darshan-core.h
@@ -26,7 +26,7 @@
 /* Environment variable to override __DARSHAN_MEM_ALIGNMENT */
 #define DARSHAN_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"
 
-#define DARSHAN_CORE_MAX_RECORDS 4096
+#define DARSHAN_CORE_MAX_RECORDS 2048
 
 /* TODO: revisit this default size if we change memory per module */
 #define DARSHAN_CORE_COMP_BUF_SIZE (2 * 1024 * 1024)


=====================================
darshan-runtime/lib/darshan-bgq.c
=====================================
--- a/darshan-runtime/lib/darshan-bgq.c
+++ b/darshan-runtime/lib/darshan-bgq.c
@@ -122,7 +122,7 @@ void bgq_runtime_initialize()
     if(bgq_runtime || instrumentation_disabled)
         return;
 
-    /* register the "NULL" module with the darshan-core component */
+    /* register the BG/Q module with the darshan-core component */
     darshan_core_register_module(
         DARSHAN_BGQ_MOD,
         &bgq_mod_fns,
@@ -161,6 +161,18 @@ void bgq_runtime_initialize()
         &bgq_runtime->record.f_id,
         &bgq_runtime->record.alignment);
 
+    /* if record is set to 0, darshan-core is out of space and will not
+     * track this record, so we should avoid tracking it, too
+     */
+    if(bgq_runtime->record.f_id == 0)
+    {
+        instrumentation_disabled = 1;
+        free(bgq_runtime);
+        bgq_runtime = NULL;
+        BGQ_UNLOCK();
+        return;
+    }
+
     capture(&bgq_runtime->record);
 
     BGQ_UNLOCK();


=====================================
darshan-runtime/lib/darshan-core.c
=====================================
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -1549,6 +1549,8 @@ void darshan_core_register_record(
     darshan_record_id tmp_rec_id;
     struct darshan_core_record_ref *ref;
 
+    *rec_id = 0;
+
     if(!darshan_core)
         return;
 


=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
--- a/darshan-runtime/lib/darshan-hdf5.c
+++ b/darshan-runtime/lib/darshan-hdf5.c
@@ -273,6 +273,16 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
         &file_id,
         NULL);
 
+    /* if record is set to 0, darshan-core is out of space and will not
+     * track this record, so we should avoid tracking it, too
+     */
+    if(file_id == 0)
+    {
+        if(newname != name)
+            free(newname);
+        return(NULL);
+    }
+
     /* search the hash table for this file record, and return if found */
     HASH_FIND(hlink, hdf5_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
     if(file)


=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -895,6 +895,16 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
         &file_id,
         NULL);
 
+    /* if record is set to 0, darshan-core is out of space and will not
+     * track this record, so we should avoid tracking it, too
+     */
+    if(file_id == 0)
+    {
+        if(newname != name)
+            free(newname);
+        return(NULL);
+    }
+
     /* search the hash table for this file record, and return if found */
     HASH_FIND(hlink, mpiio_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
     if(file)


=====================================
darshan-runtime/lib/darshan-pnetcdf.c
=====================================
--- a/darshan-runtime/lib/darshan-pnetcdf.c
+++ b/darshan-runtime/lib/darshan-pnetcdf.c
@@ -285,6 +285,16 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
         &file_id,
         NULL);
 
+    /* if record is set to 0, darshan-core is out of space and will not
+     * track this record, so we should avoid tracking it, too
+     */
+    if(file_id == 0)
+    {
+        if(newname != name)
+            free(newname);
+        return(NULL);
+    }
+
     /* search the hash table for this file record, and return if found */
     HASH_FIND(hlink, pnetcdf_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
     if(file)


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -1526,6 +1526,16 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
         &file_id,
         &file_alignment);
 
+    /* if record is set to 0, darshan-core is out of space and will not
+     * track this record, so we should avoid tracking it, too
+     */
+    if(file_id == 0)
+    {
+        if(newname != name)
+            free(newname);
+        return(NULL);
+    }
+
     /* search the hash table for this file record, and return if found */
     HASH_FIND(hlink, posix_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
     if(file)



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


More information about the Darshan-commits mailing list