<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 dev-modular 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/c371cdea3257003237f12c63ff688c35934a3464">c371cdea</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2015-12-08T14:25:51Z</i>
</div>
<pre class='commit-message'>fix possible race cond in module locking</pre>
</li>
</ul>
<h4>6 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-runtime/lib/darshan-bgq.c
</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-null.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
darshan-runtime/lib/darshan-pnetcdf.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
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/c371cdea3257003237f12c63ff688c35934a3464#diff-0'>
<strong>
darshan-runtime/lib/darshan-bgq.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-bgq.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-bgq.c
</span><span style="color: #aaaaaa">@@ -212,7 +212,6 @@ static void bgq_get_output_data(
</span> void **buffer,
int *size)
{
-
/* Just set the output buffer to point at the array of the "BGQ" module's
* I/O records, and set the output size according to the number of records
* currently being tracked.
<span style="color: #aaaaaa">@@ -221,6 +220,8 @@ static void bgq_get_output_data(
</span> int result;
uint64_t *ion_ids;
<span style="color: #000000;background-color: #ddffdd">+ BGQ_LOCK();
+
</span> if (my_rank == 0)
{
DARSHAN_MPI_CALL(PMPI_Comm_size)(mod_comm, &nprocs);
<span style="color: #aaaaaa">@@ -268,18 +269,21 @@ static void bgq_get_output_data(
</span> *size = 0;
}
<span style="color: #000000;background-color: #ddffdd">+ BGQ_UNLOCK();
</span> return;
}
/* Shutdown the "BGQ" module by freeing up all data structures. */
static void bgq_shutdown()
{
<span style="color: #000000;background-color: #ddffdd">+ BGQ_LOCK();
</span> if (bgq_runtime)
{
free(bgq_runtime);
bgq_runtime = NULL;
}
<span style="color: #000000;background-color: #ddffdd">+ BGQ_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464#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">@@ -484,6 +484,8 @@ static void hdf5_get_output_data(
</span>
assert(hdf5_runtime);
<span style="color: #000000;background-color: #ddffdd">+ HDF5_LOCK();
+
</span> /* if there are globally shared files, do a shared file reduction */
/* NOTE: the shared file reduction is also skipped if the
* DARSHAN_DISABLE_SHARED_REDUCTION environment variable is set.
<span style="color: #aaaaaa">@@ -516,7 +518,10 @@ static void hdf5_get_output_data(
</span> {
red_recv_buf = malloc(shared_rec_count * sizeof(struct darshan_hdf5_file));
if(!red_recv_buf)
<span style="color: #000000;background-color: #ddffdd">+ {
+ HDF5_UNLOCK();
</span> return;
<span style="color: #000000;background-color: #ddffdd">+ }
</span> }
/* construct a datatype for a HDF5 file record. This is serving no purpose
<span style="color: #aaaaaa">@@ -553,6 +558,7 @@ static void hdf5_get_output_data(
</span> *hdf5_buf = (void *)(hdf5_runtime->file_record_array);
*hdf5_buf_sz = hdf5_runtime->file_array_ndx * sizeof(struct darshan_hdf5_file);
<span style="color: #000000;background-color: #ddffdd">+ HDF5_UNLOCK();
</span> return;
}
<span style="color: #aaaaaa">@@ -562,6 +568,7 @@ static void hdf5_shutdown()
</span>
assert(hdf5_runtime);
<span style="color: #000000;background-color: #ddffdd">+ HDF5_LOCK();
</span> HASH_ITER(hlink, hdf5_runtime->hid_hash, ref, tmp)
{
HASH_DELETE(hlink, hdf5_runtime->hid_hash, ref);
<span style="color: #aaaaaa">@@ -575,6 +582,7 @@ static void hdf5_shutdown()
</span> free(hdf5_runtime);
hdf5_runtime = NULL;
<span style="color: #000000;background-color: #ddffdd">+ HDF5_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464#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">@@ -1320,6 +1320,8 @@ static void mpiio_get_output_data(
</span>
assert(mpiio_runtime);
<span style="color: #000000;background-color: #ddffdd">+ MPIIO_LOCK();
+
</span> /* go through and set the 4 most common access sizes for MPI-IO */
for(i = 0; i < mpiio_runtime->file_array_ndx; i++)
{
<span style="color: #aaaaaa">@@ -1388,7 +1390,10 @@ static void mpiio_get_output_data(
</span> {
red_recv_buf = malloc(shared_rec_count * sizeof(struct darshan_mpiio_file));
if(!red_recv_buf)
<span style="color: #000000;background-color: #ddffdd">+ {
+ MPIIO_UNLOCK();
</span> return;
<span style="color: #000000;background-color: #ddffdd">+ }
</span> }
/* construct a datatype for a MPIIO file record. This is serving no purpose
<span style="color: #aaaaaa">@@ -1429,6 +1434,7 @@ static void mpiio_get_output_data(
</span> *mpiio_buf = (void *)(mpiio_runtime->file_record_array);
*mpiio_buf_sz = mpiio_runtime->file_array_ndx * sizeof(struct darshan_mpiio_file);
<span style="color: #000000;background-color: #ddffdd">+ MPIIO_UNLOCK();
</span> return;
}
<span style="color: #aaaaaa">@@ -1438,6 +1444,7 @@ static void mpiio_shutdown()
</span>
assert(mpiio_runtime);
<span style="color: #000000;background-color: #ddffdd">+ MPIIO_LOCK();
</span> HASH_ITER(hlink, mpiio_runtime->fh_hash, ref, tmp)
{
HASH_DELETE(hlink, mpiio_runtime->fh_hash, ref);
<span style="color: #aaaaaa">@@ -1451,6 +1458,7 @@ static void mpiio_shutdown()
</span> free(mpiio_runtime);
mpiio_runtime = NULL;
<span style="color: #000000;background-color: #ddffdd">+ MPIIO_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
<li id='diff-3'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464#diff-3'>
<strong>
darshan-runtime/lib/darshan-null.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-null.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-null.c
</span><span style="color: #aaaaaa">@@ -349,6 +349,8 @@ static void null_get_output_data(
</span> {
assert(null_runtime);
<span style="color: #000000;background-color: #ddffdd">+ NULL_LOCK();
+
</span> /* NOTE: this function can be used to run collective operations prior to
* shutting down the module, as implied by the MPI communicator passed in
* as the first agrument. Typically, module developers will want to run a
<span style="color: #aaaaaa">@@ -366,6 +368,7 @@ static void null_get_output_data(
</span> *null_buf = (void *)(null_runtime->record_array);
*null_buf_sz = null_runtime->rec_array_ndx * sizeof(struct darshan_null_record);
<span style="color: #000000;background-color: #ddffdd">+ NULL_UNLOCK();
</span> return;
}
<span style="color: #aaaaaa">@@ -374,6 +377,7 @@ static void null_shutdown()
</span> {
assert(null_runtime);
<span style="color: #000000;background-color: #ddffdd">+ NULL_LOCK();
</span> HASH_CLEAR(hlink, null_runtime->record_hash); /* these hash entries are freed all at once below */
free(null_runtime->runtime_record_array);
<span style="color: #aaaaaa">@@ -381,6 +385,7 @@ static void null_shutdown()
</span> free(null_runtime);
null_runtime = NULL;
<span style="color: #000000;background-color: #ddffdd">+ NULL_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
<li id='diff-4'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464#diff-4'>
<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">@@ -496,6 +496,8 @@ static void pnetcdf_get_output_data(
</span>
assert(pnetcdf_runtime);
<span style="color: #000000;background-color: #ddffdd">+ PNETCDF_LOCK();
+
</span> /* if there are globally shared files, do a shared file reduction */
/* NOTE: the shared file reduction is also skipped if the
* DARSHAN_DISABLE_SHARED_REDUCTION environment variable is set.
<span style="color: #aaaaaa">@@ -528,7 +530,10 @@ static void pnetcdf_get_output_data(
</span> {
red_recv_buf = malloc(shared_rec_count * sizeof(struct darshan_pnetcdf_file));
if(!red_recv_buf)
<span style="color: #000000;background-color: #ddffdd">+ {
+ PNETCDF_UNLOCK();
</span> return;
<span style="color: #000000;background-color: #ddffdd">+ }
</span> }
/* construct a datatype for a PNETCDF file record. This is serving no purpose
<span style="color: #aaaaaa">@@ -565,6 +570,7 @@ static void pnetcdf_get_output_data(
</span> *pnetcdf_buf = (void *)(pnetcdf_runtime->file_record_array);
*pnetcdf_buf_sz = pnetcdf_runtime->file_array_ndx * sizeof(struct darshan_pnetcdf_file);
<span style="color: #000000;background-color: #ddffdd">+ PNETCDF_UNLOCK();
</span> return;
}
<span style="color: #aaaaaa">@@ -574,6 +580,7 @@ static void pnetcdf_shutdown()
</span>
assert(pnetcdf_runtime);
<span style="color: #000000;background-color: #ddffdd">+ PNETCDF_LOCK();
</span> HASH_ITER(hlink, pnetcdf_runtime->ncid_hash, ref, tmp)
{
HASH_DELETE(hlink, pnetcdf_runtime->ncid_hash, ref);
<span style="color: #aaaaaa">@@ -587,6 +594,7 @@ static void pnetcdf_shutdown()
</span> free(pnetcdf_runtime);
pnetcdf_runtime = NULL;
<span style="color: #000000;background-color: #ddffdd">+ PNETCDF_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
<li id='diff-5'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464#diff-5'>
<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">@@ -2062,6 +2062,8 @@ static void posix_get_output_data(
</span>
assert(posix_runtime);
<span style="color: #000000;background-color: #ddffdd">+ POSIX_LOCK();
+
</span> /* go through file access data for each record and set the 4 most common
* stride/access size counters.
*/
<span style="color: #aaaaaa">@@ -2136,7 +2138,10 @@ static void posix_get_output_data(
</span> {
red_recv_buf = malloc(shared_rec_count * sizeof(struct darshan_posix_file));
if(!red_recv_buf)
<span style="color: #000000;background-color: #ddffdd">+ {
</span> return;
<span style="color: #000000;background-color: #ddffdd">+ POSIX_UNLOCK();
+ }
</span> }
/* construct a datatype for a POSIX file record. This is serving no purpose
<span style="color: #aaaaaa">@@ -2177,6 +2182,7 @@ static void posix_get_output_data(
</span> *posix_buf = (void *)(posix_runtime->file_record_array);
*posix_buf_sz = posix_runtime->file_array_ndx * sizeof(struct darshan_posix_file);
<span style="color: #000000;background-color: #ddffdd">+ POSIX_UNLOCK();
</span> return;
}
<span style="color: #aaaaaa">@@ -2186,6 +2192,7 @@ static void posix_shutdown()
</span>
assert(posix_runtime);
<span style="color: #000000;background-color: #ddffdd">+ POSIX_LOCK();
</span> HASH_ITER(hlink, posix_runtime->fd_hash, ref, tmp)
{
HASH_DELETE(hlink, posix_runtime->fd_hash, ref);
<span style="color: #aaaaaa">@@ -2198,7 +2205,8 @@ static void posix_shutdown()
</span> free(posix_runtime->file_record_array);
free(posix_runtime);
posix_runtime = NULL;
-
<span style="color: #000000;background-color: #ddffdd">+
+ POSIX_UNLOCK();
</span> return;
}
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/c371cdea3257003237f12c63ff688c35934a3464">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/c371cdea3257003237f12c63ff688c35934a3464"}}</script>
</p>
</div>
</body>
</html>