Commit 928fdff4 authored by Shane Snyder's avatar Shane Snyder

bug fix for modules creating more than max records

parent d0c50a3b
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* Environment variable to override __DARSHAN_MEM_ALIGNMENT */ /* Environment variable to override __DARSHAN_MEM_ALIGNMENT */
#define DARSHAN_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN" #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 */ /* TODO: revisit this default size if we change memory per module */
#define DARSHAN_CORE_COMP_BUF_SIZE (2 * 1024 * 1024) #define DARSHAN_CORE_COMP_BUF_SIZE (2 * 1024 * 1024)
......
...@@ -122,7 +122,7 @@ void bgq_runtime_initialize() ...@@ -122,7 +122,7 @@ void bgq_runtime_initialize()
if(bgq_runtime || instrumentation_disabled) if(bgq_runtime || instrumentation_disabled)
return; 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_core_register_module(
DARSHAN_BGQ_MOD, DARSHAN_BGQ_MOD,
&bgq_mod_fns, &bgq_mod_fns,
...@@ -161,6 +161,18 @@ void bgq_runtime_initialize() ...@@ -161,6 +161,18 @@ void bgq_runtime_initialize()
&bgq_runtime->record.f_id, &bgq_runtime->record.f_id,
&bgq_runtime->record.alignment); &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); capture(&bgq_runtime->record);
BGQ_UNLOCK(); BGQ_UNLOCK();
......
...@@ -1549,6 +1549,8 @@ void darshan_core_register_record( ...@@ -1549,6 +1549,8 @@ void darshan_core_register_record(
darshan_record_id tmp_rec_id; darshan_record_id tmp_rec_id;
struct darshan_core_record_ref *ref; struct darshan_core_record_ref *ref;
*rec_id = 0;
if(!darshan_core) if(!darshan_core)
return; return;
......
...@@ -273,6 +273,16 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name) ...@@ -273,6 +273,16 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
&file_id, &file_id,
NULL); 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 */ /* 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); HASH_FIND(hlink, hdf5_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
if(file) if(file)
......
...@@ -895,6 +895,16 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name) ...@@ -895,6 +895,16 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
&file_id, &file_id,
NULL); 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 */ /* 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); HASH_FIND(hlink, mpiio_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
if(file) if(file)
......
...@@ -285,6 +285,16 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name) ...@@ -285,6 +285,16 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
&file_id, &file_id,
NULL); 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 */ /* 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); HASH_FIND(hlink, pnetcdf_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
if(file) if(file)
......
...@@ -1526,6 +1526,16 @@ static struct posix_file_runtime* posix_file_by_name(const char *name) ...@@ -1526,6 +1526,16 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
&file_id, &file_id,
&file_alignment); &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 */ /* 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); HASH_FIND(hlink, posix_runtime->file_hash, &file_id, sizeof(darshan_record_id), file);
if(file) if(file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment