<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Shane Snyder pushed to branch mmap-dev at <a href="https://xgitlab.cels.anl.gov/darshan/darshan">darshan / darshan</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691">f78c456f</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2016-01-19T12:57:25Z</i>
</div>
<pre class='commit-message'>apply mmap code changes to other i/o modules</pre>
</li>
</ul>
<h4>5 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-runtime/Makefile.in
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
darshan-runtime/lib/darshan-hdf5.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
darshan-runtime/lib/darshan-mpiio.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
darshan-runtime/lib/darshan-pnetcdf.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
darshan-runtime/lib/darshan-posix.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691#diff-0'>
<strong>
darshan-runtime/Makefile.in
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/Makefile.in
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/Makefile.in
</span><span style="color: #aaaaaa">@@ -23,8 +23,9 @@ DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
</span> DARSHAN_VERSION = @DARSHAN_VERSION@
ifndef DISABLE_LDPRELOAD
-all: lib/libdarshan.so lib/darshan-null.po
<span style="color: #000000;background-color: #ddffdd">+all: lib/libdarshan.so
</span> endif
<span style="color: #000000;background-color: #ddffdd">+#TODO: lib/darshan-null.po
</span>
VPATH = $(srcdir)
<span style="color: #aaaaaa">@@ -34,8 +35,8 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
</span>
LIBS = -lz @LIBBZ2@
-static-mod-objs = lib/darshan-posix.o
-dynamic-mod-objs = lib/darshan-posix.po
<span style="color: #000000;background-color: #ddffdd">+static-mod-objs = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o
+dynamic-mod-objs = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po
</span>
lib::
@mkdir -p $@
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691#diff-1'>
<strong>
darshan-runtime/lib/darshan-hdf5.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-hdf5.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-hdf5.c
</span><span style="color: #aaaaaa">@@ -55,12 +55,9 @@ struct hdf5_runtime
</span> {
struct hdf5_file_runtime* file_runtime_array;
struct darshan_hdf5_file* file_record_array;
<span style="color: #000000;background-color: #ffdddd">- int file_array_size;
</span> int file_array_ndx;
struct hdf5_file_runtime *file_hash;
struct hdf5_file_runtime_ref* hid_hash;
-
<span style="color: #000000;background-color: #ffdddd">- struct darshan_hdf5_file *total_file;
</span> };
static struct hdf5_runtime *hdf5_runtime = NULL;
<span style="color: #aaaaaa">@@ -205,9 +202,9 @@ static void hdf5_runtime_initialize()
</span> .get_output_data = &hdf5_get_output_data,
.shutdown = &hdf5_shutdown
};
<span style="color: #000000;background-color: #ffdddd">- void *mmap_buf;
- int mmap_buf_size;
- int mem_limit;
</span><span style="color: #000000;background-color: #ddffdd">+ void *hdf5_buf;
+ int hdf5_buf_size;
+ int file_array_size;
</span>
/* don't do anything if already initialized or instrumenation is disabled */
if(hdf5_runtime || instrumentation_disabled)
<span style="color: #aaaaaa">@@ -217,14 +214,13 @@ static void hdf5_runtime_initialize()
</span> darshan_core_register_module(
DARSHAN_HDF5_MOD,
&hdf5_mod_fns,
<span style="color: #000000;background-color: #ddffdd">+ &hdf5_buf_size,
+ &hdf5_buf,
</span> &my_rank,
<span style="color: #000000;background-color: #ffdddd">- &mem_limit,
- &mmap_buf,
- &mmap_buf_size,
</span> NULL);
<span style="color: #000000;background-color: #ffdddd">- /* return if no memory assigned by darshan-core */
- if(mem_limit == 0)
</span><span style="color: #000000;background-color: #ddffdd">+ /* return if darshan-core does not provide enough module memory */
+ if(hdf5_buf_size < sizeof(struct darshan_hdf5_file))
</span> return;
hdf5_runtime = malloc(sizeof(*hdf5_runtime));
<span style="color: #aaaaaa">@@ -232,27 +228,27 @@ static void hdf5_runtime_initialize()
</span> return;
memset(hdf5_runtime, 0, sizeof(*hdf5_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* set maximum number of file records according to max memory limit */
- /* NOTE: maximum number of records is based on the size of a hdf5 file record */
- /* TODO: should we base memory usage off file record or total runtime structure sizes? */
- hdf5_runtime->file_array_size = mem_limit / sizeof(struct darshan_hdf5_file);
</span><span style="color: #000000;background-color: #ddffdd">+ /* set number of trackable files for the HDF5 module according to the
+ * amount of memory returned by darshan-core
+ */
+ file_array_size = hdf5_buf_size / sizeof(struct darshan_hdf5_file);
</span> hdf5_runtime->file_array_ndx = 0;
<span style="color: #000000;background-color: #ddffdd">+ /* store pointer to HDF5 record buffer given by darshan-core */
+ hdf5_runtime->file_record_array = (struct darshan_hdf5_file *)hdf5_buf;
+
</span> /* allocate array of runtime file records */
<span style="color: #000000;background-color: #ffdddd">- hdf5_runtime->file_runtime_array = malloc(hdf5_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ hdf5_runtime->file_runtime_array = malloc(file_array_size *
</span> sizeof(struct hdf5_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* XXX-MMAP */
- hdf5_runtime->file_record_array = malloc(hdf5_runtime->file_array_size *
- sizeof(struct darshan_hdf5_file));
- if(!hdf5_runtime->file_runtime_array || !hdf5_runtime->file_record_array)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!hdf5_runtime->file_runtime_array)
</span> {
<span style="color: #000000;background-color: #ffdddd">- hdf5_runtime->file_array_size = 0;
</span><span style="color: #000000;background-color: #ddffdd">+ free(hdf5_runtime);
+ hdf5_runtime = NULL;
+ darshan_core_unregister_module(DARSHAN_HDF5_MOD);
</span> return;
}
<span style="color: #000000;background-color: #ffdddd">- memset(hdf5_runtime->file_runtime_array, 0, hdf5_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ memset(hdf5_runtime->file_runtime_array, 0, file_array_size *
</span> sizeof(struct hdf5_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- memset(hdf5_runtime->file_record_array, 0, hdf5_runtime->file_array_size *
- sizeof(struct darshan_hdf5_file));
</span>
return;
}
<span style="color: #aaaaaa">@@ -261,9 +257,10 @@ static void hdf5_runtime_initialize()
</span> static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
{
struct hdf5_file_runtime *file = NULL;
<span style="color: #000000;background-color: #ddffdd">+ struct darshan_hdf5_file *file_rec;
</span> char *newname = NULL;
darshan_record_id file_id;
<span style="color: #000000;background-color: #ffdddd">- int limit_flag;
</span><span style="color: #000000;background-color: #ddffdd">+ int ret;
</span>
if(!hdf5_runtime || instrumentation_disabled)
return(NULL);
<span style="color: #aaaaaa">@@ -272,46 +269,36 @@ static struct hdf5_file_runtime* hdf5_file_by_name(const char *name)
</span> if(!newname)
newname = (char*)name;
<span style="color: #000000;background-color: #ffdddd">- limit_flag = (hdf5_runtime->file_array_ndx >= hdf5_runtime->file_array_size);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* get a unique id for this file from darshan core */
- darshan_core_register_record(
</span><span style="color: #000000;background-color: #ddffdd">+ /* lookup the unique id for this filename */
+ darshan_core_lookup_record(
</span> (void*)newname,
strlen(newname),
<span style="color: #000000;background-color: #ffdddd">- DARSHAN_HDF5_MOD,
- 1,
- limit_flag,
- &file_id,
- NULL);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* 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);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ &file_id);
</span>
/* 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);
<span style="color: #000000;background-color: #ffdddd">- if(file)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!file)
</span> {
<span style="color: #000000;background-color: #ffdddd">- if(newname != name)
- free(newname);
- return(file);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ /* register the record with the darshan core component */
+ ret = darshan_core_register_record(file_id, (void *)newname, DARSHAN_HDF5_MOD,
+ sizeof(struct darshan_hdf5_file), NULL);
+ if(ret == 1)
+ {
+ /* register was successful */
+ file = &(hdf5_runtime->file_runtime_array[hdf5_runtime->file_array_ndx]);
+ file->file_record =
+ &(hdf5_runtime->file_record_array[hdf5_runtime->file_array_ndx]);
+ file_rec = file->file_record;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* no existing record, assign a new file record from the global array */
- file = &(hdf5_runtime->file_runtime_array[hdf5_runtime->file_array_ndx]);
- file->file_record = &(hdf5_runtime->file_record_array[hdf5_runtime->file_array_ndx]);
- file->file_record->f_id = file_id;
- file->file_record->rank = my_rank;
</span><span style="color: #000000;background-color: #ddffdd">+ file_rec->base_rec.id = file_id;
+ file_rec->base_rec.rank = my_rank;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* add new record to file hash table */
- HASH_ADD(hlink, hdf5_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
- hdf5_runtime->file_array_ndx++;
</span><span style="color: #000000;background-color: #ddffdd">+ /* add new record to file hash table */
+ HASH_ADD(hlink, hdf5_runtime->file_hash, file_record->base_rec.id,
+ sizeof(darshan_record_id), file);
+ hdf5_runtime->file_array_ndx++;
+ }
+ }
</span>
if(newname != name)
free(newname);
<span style="color: #aaaaaa">@@ -403,9 +390,9 @@ static int hdf5_record_compare(const void* a_p, const void* b_p)
</span> const struct darshan_hdf5_file* a = a_p;
const struct darshan_hdf5_file* b = b_p;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank < b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank < b->base_rec.rank)
</span> return 1;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank > b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank > b->base_rec.rank)
</span> return -1;
return 0;
<span style="color: #aaaaaa">@@ -424,8 +411,8 @@ static void hdf5_record_reduction_op(void* infile_v, void* inoutfile_v,
</span> for(i=0; i<*len; i++)
{
memset(&tmp_file, 0, sizeof(struct darshan_hdf5_file));
<span style="color: #000000;background-color: #ffdddd">- tmp_file.f_id = infile->f_id;
- tmp_file.rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ tmp_file.base_rec.id = infile->base_rec.id;
+ tmp_file.base_rec.rank = -1;
</span>
/* sum */
for(j=HDF5_OPENS; j<=HDF5_OPENS; j++)
<span style="color: #aaaaaa">@@ -505,7 +492,7 @@ static void hdf5_get_output_data(
</span> sizeof(darshan_record_id), file);
assert(file);
<span style="color: #000000;background-color: #ffdddd">- file->file_record->rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ file->file_record->base_rec.rank = -1;
</span> }
/* sort the array of files descending by rank so that we get all of the
</code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691#diff-2'>
<strong>
darshan-runtime/lib/darshan-mpiio.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-mpiio.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-mpiio.c
</span><span style="color: #aaaaaa">@@ -99,12 +99,9 @@ struct mpiio_runtime
</span> {
struct mpiio_file_runtime* file_runtime_array;
struct darshan_mpiio_file* file_record_array;
<span style="color: #000000;background-color: #ffdddd">- int file_array_size;
</span> int file_array_ndx;
struct mpiio_file_runtime* file_hash;
struct mpiio_file_runtime_ref* fh_hash;
-
<span style="color: #000000;background-color: #ffdddd">- struct darshan_mpiio_file* total_file;
</span> };
static struct mpiio_runtime *mpiio_runtime = NULL;
<span style="color: #aaaaaa">@@ -828,26 +825,28 @@ static void mpiio_runtime_initialize()
</span> .get_output_data = &mpiio_get_output_data,
.shutdown = &mpiio_shutdown
};
<span style="color: #000000;background-color: #ffdddd">- void *mmap_buf;
- int mmap_buf_size;
- int mem_limit;
</span><span style="color: #000000;background-color: #ddffdd">+ void *mpiio_buf;
+ int mpiio_buf_size;
+ int file_array_size;
</span>
/* don't do anything if already initialized or instrumenation is disabled */
if(mpiio_runtime || instrumentation_disabled)
return;
<span style="color: #000000;background-color: #ddffdd">+ /* try and store the default number of records for this module */
+ mpiio_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct darshan_mpiio_file);
+
</span> /* register the mpiio module with darshan core */
darshan_core_register_module(
DARSHAN_MPIIO_MOD,
&mpiio_mod_fns,
<span style="color: #000000;background-color: #ddffdd">+ &mpiio_buf_size,
+ &mpiio_buf,
</span> &my_rank,
<span style="color: #000000;background-color: #ffdddd">- &mem_limit,
- &mmap_buf,
- &mmap_buf_size,
</span> NULL);
<span style="color: #000000;background-color: #ffdddd">- /* return if no memory assigned by darshan core */
- if(mem_limit == 0)
</span><span style="color: #000000;background-color: #ddffdd">+ /* return if darshan-core does not provide enough module memory */
+ if(mpiio_buf_size < sizeof(struct darshan_mpiio_file))
</span> return;
mpiio_runtime = malloc(sizeof(*mpiio_runtime));
<span style="color: #aaaaaa">@@ -855,25 +854,27 @@ static void mpiio_runtime_initialize()
</span> return;
memset(mpiio_runtime, 0, sizeof(*mpiio_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* set maximum number of file records according to max memory limit */
- /* NOTE: maximum number of records is based on the size of a mpiio file record */
- mpiio_runtime->file_array_size = mem_limit / sizeof(struct darshan_mpiio_file);
</span><span style="color: #000000;background-color: #ddffdd">+ /* set number of trackable files for the MPIIO module according to the
+ * amount of memory returned by darshan-core
+ */
+ file_array_size = mpiio_buf_size / sizeof(struct darshan_mpiio_file);
</span> mpiio_runtime->file_array_ndx = 0;
<span style="color: #000000;background-color: #ddffdd">+ /* store pointer to MPIIO record buffer given by darshan-core */
+ mpiio_runtime->file_record_array = (struct darshan_mpiio_file *)mpiio_buf;
+
</span> /* allocate array of runtime file records */
<span style="color: #000000;background-color: #ffdddd">- mpiio_runtime->file_runtime_array = malloc(mpiio_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ mpiio_runtime->file_runtime_array = malloc(file_array_size *
</span> sizeof(struct mpiio_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- mpiio_runtime->file_record_array = malloc(mpiio_runtime->file_array_size *
- sizeof(struct darshan_mpiio_file));
- if(!mpiio_runtime->file_runtime_array || !mpiio_runtime->file_record_array)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!mpiio_runtime->file_runtime_array)
</span> {
<span style="color: #000000;background-color: #ffdddd">- mpiio_runtime->file_array_size = 0;
</span><span style="color: #000000;background-color: #ddffdd">+ free(mpiio_runtime);
+ mpiio_runtime = NULL;
+ darshan_core_unregister_module(DARSHAN_MPIIO_MOD);
</span> return;
}
<span style="color: #000000;background-color: #ffdddd">- memset(mpiio_runtime->file_runtime_array, 0, mpiio_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ memset(mpiio_runtime->file_runtime_array, 0, file_array_size *
</span> sizeof(struct mpiio_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- memset(mpiio_runtime->file_record_array, 0, mpiio_runtime->file_array_size *
- sizeof(struct darshan_mpiio_file));
</span>
return;
}
<span style="color: #aaaaaa">@@ -882,9 +883,10 @@ static void mpiio_runtime_initialize()
</span> static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
{
struct mpiio_file_runtime *file = NULL;
<span style="color: #000000;background-color: #ddffdd">+ struct darshan_mpiio_file *file_rec;
</span> char *newname = NULL;
darshan_record_id file_id;
<span style="color: #000000;background-color: #ffdddd">- int limit_flag;
</span><span style="color: #000000;background-color: #ddffdd">+ int ret;
</span>
if(!mpiio_runtime || instrumentation_disabled)
return(NULL);
<span style="color: #aaaaaa">@@ -893,46 +895,36 @@ static struct mpiio_file_runtime* mpiio_file_by_name(const char *name)
</span> if(!newname)
newname = (char*)name;
<span style="color: #000000;background-color: #ffdddd">- limit_flag = (mpiio_runtime->file_array_ndx >= mpiio_runtime->file_array_size);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* get a unique id for this file from darshan core */
- darshan_core_register_record(
</span><span style="color: #000000;background-color: #ddffdd">+ /* lookup the unique id for this filename */
+ darshan_core_lookup_record(
</span> (void*)newname,
strlen(newname),
<span style="color: #000000;background-color: #ffdddd">- DARSHAN_MPIIO_MOD,
- 1,
- limit_flag,
- &file_id,
- NULL);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* the file record id is set to 0 if no memory is available for tracking
- * new records -- just fall through and ignore this record
- */
- if(file_id == 0)
- {
- if(newname != name)
- free(newname);
- return(NULL);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ &file_id);
</span>
/* 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);
<span style="color: #000000;background-color: #ffdddd">- if(file)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!file)
</span> {
<span style="color: #000000;background-color: #ffdddd">- if(newname != name)
- free(newname);
- return(file);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ /* register the record with the darshan core component */
+ ret = darshan_core_register_record(file_id, (void *)newname, DARSHAN_MPIIO_MOD,
+ sizeof(struct darshan_mpiio_file), NULL);
+ if(ret == 1)
+ {
+ /* register was successful */
+ file = &(mpiio_runtime->file_runtime_array[mpiio_runtime->file_array_ndx]);
+ file->file_record =
+ &(mpiio_runtime->file_record_array[mpiio_runtime->file_array_ndx]);
+ file_rec = file->file_record;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* no existing record, assign a new file record from the global array */
- file = &(mpiio_runtime->file_runtime_array[mpiio_runtime->file_array_ndx]);
- file->file_record = &(mpiio_runtime->file_record_array[mpiio_runtime->file_array_ndx]);
- file->file_record->f_id = file_id;
- file->file_record->rank = my_rank;
</span><span style="color: #000000;background-color: #ddffdd">+ file_rec->base_rec.id = file_id;
+ file_rec->base_rec.rank = my_rank;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* add new record to file hash table */
- HASH_ADD(hlink, mpiio_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
- mpiio_runtime->file_array_ndx++;
</span><span style="color: #000000;background-color: #ddffdd">+ /* add new record to file hash table */
+ HASH_ADD(hlink, mpiio_runtime->file_hash, file_record->base_rec.id,
+ sizeof(darshan_record_id), file);
+ mpiio_runtime->file_array_ndx++;
+ }
+ }
</span>
if(newname != name)
free(newname);
<span style="color: #aaaaaa">@@ -1024,9 +1016,9 @@ static int mpiio_record_compare(const void* a_p, const void* b_p)
</span> const struct darshan_mpiio_file* a = a_p;
const struct darshan_mpiio_file* b = b_p;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank < b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank < b->base_rec.rank)
</span> return 1;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank > b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank > b->base_rec.rank)
</span> return -1;
return 0;
<span style="color: #aaaaaa">@@ -1048,9 +1040,8 @@ static void mpiio_record_reduction_op(
</span> for(i=0; i<*len; i++)
{
memset(&tmp_file, 0, sizeof(struct darshan_mpiio_file));
-
<span style="color: #000000;background-color: #ffdddd">- tmp_file.f_id = infile->f_id;
- tmp_file.rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ tmp_file.base_rec.id = infile->base_rec.id;
+ tmp_file.base_rec.rank = -1;
</span>
/* sum */
for(j=MPIIO_INDEP_OPENS; j<=MPIIO_VIEWS; j++)
<span style="color: #aaaaaa">@@ -1358,7 +1349,7 @@ static void mpiio_get_output_data(
</span>
/* initialize fastest/slowest info prior to the reduction */
file->file_record->counters[MPIIO_FASTEST_RANK] =
<span style="color: #000000;background-color: #ffdddd">- file->file_record->rank;
</span><span style="color: #000000;background-color: #ddffdd">+ file->file_record->base_rec.rank;
</span> file->file_record->counters[MPIIO_FASTEST_RANK_BYTES] =
file->file_record->counters[MPIIO_BYTES_READ] +
file->file_record->counters[MPIIO_BYTES_WRITTEN];
<span style="color: #aaaaaa">@@ -1376,7 +1367,7 @@ static void mpiio_get_output_data(
</span> file->file_record->fcounters[MPIIO_F_SLOWEST_RANK_TIME] =
file->file_record->fcounters[MPIIO_F_FASTEST_RANK_TIME];
<span style="color: #000000;background-color: #ffdddd">- file->file_record->rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ file->file_record->base_rec.rank = -1;
</span> }
/* sort the array of files descending by rank so that we get all of the
<span style="color: #aaaaaa">@@ -1454,7 +1445,6 @@ static void mpiio_shutdown()
</span> HASH_CLEAR(hlink, mpiio_runtime->file_hash); /* these entries are freed all at once below */
free(mpiio_runtime->file_runtime_array);
<span style="color: #000000;background-color: #ffdddd">- free(mpiio_runtime->file_record_array);
</span> free(mpiio_runtime);
mpiio_runtime = NULL;
</code></pre>
<br>
</li>
<li id='diff-3'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691#diff-3'>
<strong>
darshan-runtime/lib/darshan-pnetcdf.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-pnetcdf.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-pnetcdf.c
</span><span style="color: #aaaaaa">@@ -51,12 +51,9 @@ struct pnetcdf_runtime
</span> {
struct pnetcdf_file_runtime* file_runtime_array;
struct darshan_pnetcdf_file* file_record_array;
<span style="color: #000000;background-color: #ffdddd">- int file_array_size;
</span> int file_array_ndx;
struct pnetcdf_file_runtime *file_hash;
struct pnetcdf_file_runtime_ref* ncid_hash;
-
<span style="color: #000000;background-color: #ffdddd">- struct darshan_pnetcdf_file *total_file;
</span> };
static struct pnetcdf_runtime *pnetcdf_runtime = NULL;
<span style="color: #aaaaaa">@@ -217,26 +214,28 @@ static void pnetcdf_runtime_initialize()
</span> .get_output_data = &pnetcdf_get_output_data,
.shutdown = &pnetcdf_shutdown
};
<span style="color: #000000;background-color: #ffdddd">- void *mmap_buf;
- int mmap_buf_size;
- int mem_limit;
</span><span style="color: #000000;background-color: #ddffdd">+ void *pnetcdf_buf;
+ int pnetcdf_buf_size;
+ int file_array_size;
</span>
/* don't do anything if already initialized or instrumenation is disabled */
if(pnetcdf_runtime || instrumentation_disabled)
return;
<span style="color: #000000;background-color: #ddffdd">+ /* try and store the default number of records for this module */
+ pnetcdf_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct darshan_pnetcdf_file);
+
</span> /* register pnetcdf module with darshan-core */
darshan_core_register_module(
DARSHAN_PNETCDF_MOD,
&pnetcdf_mod_fns,
<span style="color: #000000;background-color: #ddffdd">+ &pnetcdf_buf_size,
+ &pnetcdf_buf,
</span> &my_rank,
<span style="color: #000000;background-color: #ffdddd">- &mem_limit,
- &mmap_buf,
- &mmap_buf_size,
</span> NULL);
<span style="color: #000000;background-color: #ffdddd">- /* return if no memory assigned by darshan-core */
- if(mem_limit == 0)
</span><span style="color: #000000;background-color: #ddffdd">+ /* return if darshan-core does not provide enough module memory */
+ if(pnetcdf_buf_size < sizeof(struct darshan_pnetcdf_file))
</span> return;
pnetcdf_runtime = malloc(sizeof(*pnetcdf_runtime));
<span style="color: #aaaaaa">@@ -244,27 +243,27 @@ static void pnetcdf_runtime_initialize()
</span> return;
memset(pnetcdf_runtime, 0, sizeof(*pnetcdf_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* set maximum number of file records according to max memory limit */
- /* NOTE: maximum number of records is based on the size of a pnetcdf file record */
- /* TODO: should we base memory usage off file record or total runtime structure sizes? */
- pnetcdf_runtime->file_array_size = mem_limit / sizeof(struct darshan_pnetcdf_file);
</span><span style="color: #000000;background-color: #ddffdd">+ /* set number of trackable files for the PNETCDF module according to the
+ * amount of memory returned by darshan-core
+ */
+ file_array_size = pnetcdf_buf_size / sizeof(struct darshan_pnetcdf_file);
</span> pnetcdf_runtime->file_array_ndx = 0;
<span style="color: #000000;background-color: #ddffdd">+ /* store pointer to PNETCDF record buffer given by darshan-core */
+ pnetcdf_runtime->file_record_array = (struct darshan_pnetcdf_file *)pnetcdf_buf;
+
</span> /* allocate array of runtime file records */
<span style="color: #000000;background-color: #ffdddd">- pnetcdf_runtime->file_runtime_array = malloc(pnetcdf_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ pnetcdf_runtime->file_runtime_array = malloc(file_array_size *
</span> sizeof(struct pnetcdf_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* XXX-MMAP */
- pnetcdf_runtime->file_record_array = malloc(pnetcdf_runtime->file_array_size *
- sizeof(struct darshan_pnetcdf_file));
- if(!pnetcdf_runtime->file_runtime_array || !pnetcdf_runtime->file_record_array)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!pnetcdf_runtime->file_runtime_array)
</span> {
<span style="color: #000000;background-color: #ffdddd">- pnetcdf_runtime->file_array_size = 0;
</span><span style="color: #000000;background-color: #ddffdd">+ free(pnetcdf_runtime);
+ pnetcdf_runtime = NULL;
+ darshan_core_unregister_module(DARSHAN_PNETCDF_MOD);
</span> return;
}
<span style="color: #000000;background-color: #ffdddd">- memset(pnetcdf_runtime->file_runtime_array, 0, pnetcdf_runtime->file_array_size *
</span><span style="color: #000000;background-color: #ddffdd">+ memset(pnetcdf_runtime->file_runtime_array, 0, file_array_size *
</span> sizeof(struct pnetcdf_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- memset(pnetcdf_runtime->file_record_array, 0, pnetcdf_runtime->file_array_size *
- sizeof(struct darshan_pnetcdf_file));
</span>
return;
}
<span style="color: #aaaaaa">@@ -273,9 +272,10 @@ static void pnetcdf_runtime_initialize()
</span> static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
{
struct pnetcdf_file_runtime *file = NULL;
<span style="color: #000000;background-color: #ddffdd">+ struct darshan_pnetcdf_file *file_rec;
</span> char *newname = NULL;
darshan_record_id file_id;
<span style="color: #000000;background-color: #ffdddd">- int limit_flag;
</span><span style="color: #000000;background-color: #ddffdd">+ int ret;
</span>
if(!pnetcdf_runtime || instrumentation_disabled)
return(NULL);
<span style="color: #aaaaaa">@@ -284,46 +284,36 @@ static struct pnetcdf_file_runtime* pnetcdf_file_by_name(const char *name)
</span> if(!newname)
newname = (char*)name;
<span style="color: #000000;background-color: #ffdddd">- limit_flag = (pnetcdf_runtime->file_array_ndx >= pnetcdf_runtime->file_array_size);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* get a unique id for this file from darshan core */
- darshan_core_register_record(
</span><span style="color: #000000;background-color: #ddffdd">+ /* lookup the unique id for this filename */
+ darshan_core_lookup_record(
</span> (void*)newname,
strlen(newname),
<span style="color: #000000;background-color: #ffdddd">- DARSHAN_PNETCDF_MOD,
- 1,
- limit_flag,
- &file_id,
- NULL);
</span>-
<span style="color: #000000;background-color: #ffdddd">- /* the file record id is set to 0 if no memory is available for tracking
- * new records -- just fall through and ignore this record
- */
- if(file_id == 0)
- {
- if(newname != name)
- free(newname);
- return(NULL);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ &file_id);
</span>
/* 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);
<span style="color: #000000;background-color: #ffdddd">- if(file)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!file)
</span> {
<span style="color: #000000;background-color: #ffdddd">- if(newname != name)
- free(newname);
- return(file);
- }
</span><span style="color: #000000;background-color: #ddffdd">+ /* register the record with the darshan core component */
+ ret = darshan_core_register_record(file_id, (void *)newname, DARSHAN_PNETCDF_MOD,
+ sizeof(struct darshan_pnetcdf_file), NULL);
+ if(ret == 1)
+ {
+ /* register was successful */
+ file = &(pnetcdf_runtime->file_runtime_array[pnetcdf_runtime->file_array_ndx]);
+ file->file_record =
+ &(pnetcdf_runtime->file_record_array[pnetcdf_runtime->file_array_ndx]);
+ file_rec = file->file_record;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* no existing record, assign a new file record from the global array */
- file = &(pnetcdf_runtime->file_runtime_array[pnetcdf_runtime->file_array_ndx]);
- file->file_record = &(pnetcdf_runtime->file_record_array[pnetcdf_runtime->file_array_ndx]);
- file->file_record->f_id = file_id;
- file->file_record->rank = my_rank;
</span><span style="color: #000000;background-color: #ddffdd">+ file_rec->base_rec.id = file_id;
+ file_rec->base_rec.rank = my_rank;
</span>
<span style="color: #000000;background-color: #ffdddd">- /* add new record to file hash table */
- HASH_ADD(hlink, pnetcdf_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
- pnetcdf_runtime->file_array_ndx++;
</span><span style="color: #000000;background-color: #ddffdd">+ /* add new record to file hash table */
+ HASH_ADD(hlink, pnetcdf_runtime->file_hash, file_record->base_rec.id,
+ sizeof(darshan_record_id), file);
+ pnetcdf_runtime->file_array_ndx++;
+ }
+ }
</span>
if(newname != name)
free(newname);
<span style="color: #aaaaaa">@@ -415,9 +405,9 @@ static int pnetcdf_record_compare(const void* a_p, const void* b_p)
</span> const struct darshan_pnetcdf_file* a = a_p;
const struct darshan_pnetcdf_file* b = b_p;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank < b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank < b->base_rec.rank)
</span> return 1;
<span style="color: #000000;background-color: #ffdddd">- if(a->rank > b->rank)
</span><span style="color: #000000;background-color: #ddffdd">+ if(a->base_rec.rank > b->base_rec.rank)
</span> return -1;
return 0;
<span style="color: #aaaaaa">@@ -436,8 +426,8 @@ static void pnetcdf_record_reduction_op(void* infile_v, void* inoutfile_v,
</span> for(i=0; i<*len; i++)
{
memset(&tmp_file, 0, sizeof(struct darshan_pnetcdf_file));
<span style="color: #000000;background-color: #ffdddd">- tmp_file.f_id = infile->f_id;
- tmp_file.rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ tmp_file.base_rec.id = infile->base_rec.id;
+ tmp_file.base_rec.rank = -1;
</span>
/* sum */
for(j=PNETCDF_INDEP_OPENS; j<=PNETCDF_COLL_OPENS; j++)
<span style="color: #aaaaaa">@@ -517,7 +507,7 @@ static void pnetcdf_get_output_data(
</span> sizeof(darshan_record_id), file);
assert(file);
<span style="color: #000000;background-color: #ffdddd">- file->file_record->rank = -1;
</span><span style="color: #000000;background-color: #ddffdd">+ file->file_record->base_rec.rank = -1;
</span> }
/* sort the array of files descending by rank so that we get all of the
</code></pre>
<br>
</li>
<li id='diff-4'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691#diff-4'>
<strong>
darshan-runtime/lib/darshan-posix.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-posix.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-posix.c
</span><span style="color: #aaaaaa">@@ -1651,8 +1651,9 @@ static void posix_runtime_initialize()
</span> return;
memset(posix_runtime, 0, sizeof(*posix_runtime));
<span style="color: #000000;background-color: #ffdddd">- /* set maximum number of file records according to max memory limit */
- /* NOTE: maximum number of records is based on the size of a posix file record */
</span><span style="color: #000000;background-color: #ddffdd">+ /* set number of trackable files for the POSIX module according to the
+ * amount of memory returned by darshan-core
+ */
</span> file_array_size = psx_buf_size / sizeof(struct darshan_posix_file);
posix_runtime->file_array_ndx = 0;
<span style="color: #aaaaaa">@@ -1671,8 +1672,6 @@ static void posix_runtime_initialize()
</span> }
memset(posix_runtime->file_runtime_array, 0, file_array_size *
sizeof(struct posix_file_runtime));
<span style="color: #000000;background-color: #ffdddd">- memset(posix_runtime->file_record_array, 0, file_array_size *
- sizeof(struct darshan_posix_file));
</span>
return;
}
<span style="color: #aaaaaa">@@ -1694,7 +1693,7 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
</span> if(!newname)
newname = (char*)name;
<span style="color: #000000;background-color: #ffdddd">- /* lookup the unique id for this file */
</span><span style="color: #000000;background-color: #ddffdd">+ /* lookup the unique id for this filename */
</span> darshan_core_lookup_record(
(void*)newname,
strlen(newname),
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691">View it on GitLab</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://xgitlab.cels.anl.gov/darshan/darshan/commit/f78c456f736a007d5efc644293836f9bfc431691"}}</script>
</p>
</div>
</body>
</html>