<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 lustre-mod
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/c3a85a3ebe2097ed33150cf112d30ff2ced7ab46">c3a85a3e</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2016-02-25T11:10:13-08:00</i>
</div>
<pre class='commit-message'>switch lustre to use array instead of hash table</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-runtime/lib/darshan-lustre.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/c3a85a3ebe2097ed33150cf112d30ff2ced7ab46#diff-0'>
<strong>
darshan-runtime/lib/darshan-lustre.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-lustre.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-lustre.c
</span><span style="color: #aaaaaa">@@ -22,27 +22,16 @@
</span> #include "darshan.h"
#include "darshan-dynamic.h"
<span style="color: #000000;background-color: #ffdddd">-/* TODO: once mmap merge is complete, we can just use an array
- * to store record data rather than a hash table -- in that
- * branch, register_record() returns whether the record
- * already exists, at which point we won't need to instrument
- * more data, since the Lustre record data is immutable. records
- * could just be appended to the array if there is no need to
- * search for a specific record.
</span><span style="color: #000000;background-color: #ddffdd">+/* we just use a simple array for storing records. the POSIX module
+ * only calls into the Lustre module for new records, so we will never
+ * have to search for an existing Lustre record (assuming the Lustre
+ * data remains immutable as it is now).
</span> */
<span style="color: #000000;background-color: #ffdddd">-struct lustre_record_ref
-{
- struct darshan_lustre_record *record;
- UT_hash_handle hlink;
-};
-
</span> struct lustre_runtime
{
<span style="color: #000000;background-color: #ffdddd">- struct lustre_record_ref *ref_array;
</span> struct darshan_lustre_record *record_array;
int record_array_size;
int record_array_ndx;
<span style="color: #000000;background-color: #ffdddd">- struct lustre_record_ref *record_hash;
</span> };
static struct lustre_runtime *lustre_runtime = NULL;
<span style="color: #aaaaaa">@@ -69,15 +58,16 @@ static void lustre_shutdown(void);
</span>
void darshan_instrument_lustre_file(char *filepath)
{
<span style="color: #000000;background-color: #ffdddd">- struct lustre_record_ref *lustre_ref;
</span><span style="color: #000000;background-color: #ddffdd">+ struct darshan_lustre_record *rec;
</span> darshan_record_id rec_id;
<span style="color: #000000;background-color: #ffdddd">- int limit_flag;
</span>
LUSTRE_LOCK();
/* make sure the lustre module is already initialized */
lustre_runtime_initialize();
<span style="color: #000000;background-color: #ffdddd">- limit_flag = (lustre_runtime->record_array_ndx >= lustre_runtime->record_array_size);
</span><span style="color: #000000;background-color: #ddffdd">+ /* if the array is full, we just back out */
+ if(lustre_runtime->record_array_ndx >= lustre_runtime->record_array_size)
+ return;
</span>
/* register a Lustre file record with Darshan */
darshan_core_register_record(
<span style="color: #aaaaaa">@@ -85,7 +75,7 @@ void darshan_instrument_lustre_file(char *filepath)
</span> strlen(filepath),
DARSHAN_LUSTRE_MOD,
1,
<span style="color: #000000;background-color: #ffdddd">- limit_flag,
</span><span style="color: #000000;background-color: #ddffdd">+ 0,
</span> &rec_id,
NULL);
<span style="color: #aaaaaa">@@ -93,24 +83,14 @@ void darshan_instrument_lustre_file(char *filepath)
</span> if(rec_id == 0)
return;
<span style="color: #000000;background-color: #ffdddd">- HASH_FIND(hlink, lustre_runtime->record_hash, &rec_id,
- sizeof(darshan_record_id), lustre_ref);
- if(!lustre_ref)
- {
- /* no existing record, allocate a new one and add it to the hash */
- lustre_ref = &(lustre_runtime->ref_array[lustre_runtime->record_array_ndx]);
- lustre_ref->record = &(lustre_runtime->record_array[lustre_runtime->record_array_ndx]);
- lustre_ref->record->rec_id = rec_id;
- lustre_ref->record->rank = my_rank;
-
- /* TODO: gather lustre data, store in record hash */
- /* counters in lustre_ref->record->counters */
- lustre_ref->record->counters[LUSTRE_TEST_COUNTER] = 88;
-
- HASH_ADD(hlink, lustre_runtime->record_hash, record->rec_id,
- sizeof(darshan_record_id), lustre_ref);
- lustre_runtime->record_array_ndx++;
- }
</span><span style="color: #000000;background-color: #ddffdd">+ /* allocate a new lustre record and append it to the array */
+ rec = &(lustre_runtime->record_array[lustre_runtime->record_array_ndx++]);
+ rec->rec_id = rec_id;
+ rec->rank = my_rank;
+
+ /* TODO: gather lustre data, store in record hash */
+ /* counters in lustre_ref->record->counters */
+ rec->counters[LUSTRE_TEST_COUNTER] = 88;
</span>
LUSTRE_UNLOCK();
return;
<span style="color: #aaaaaa">@@ -152,17 +132,13 @@ static void lustre_runtime_initialize()
</span> */
lustre_runtime->record_array_size = mem_limit / sizeof(struct darshan_lustre_record);
<span style="color: #000000;background-color: #ffdddd">- lustre_runtime->ref_array = malloc(lustre_runtime->record_array_size *
- sizeof(struct lustre_record_ref));
</span> lustre_runtime->record_array = malloc(lustre_runtime->record_array_size *
sizeof(struct darshan_lustre_record));
<span style="color: #000000;background-color: #ffdddd">- if(!lustre_runtime->ref_array || !lustre_runtime->record_array)
</span><span style="color: #000000;background-color: #ddffdd">+ if(!lustre_runtime->record_array)
</span> {
lustre_runtime->record_array_size = 0;
return;
}
<span style="color: #000000;background-color: #ffdddd">- memset(lustre_runtime->ref_array, 0, lustre_runtime->record_array_size *
- sizeof(struct lustre_record_ref));
</span> memset(lustre_runtime->record_array, 0, lustre_runtime->record_array_size *
sizeof(struct darshan_lustre_record));
<span style="color: #aaaaaa">@@ -211,9 +187,6 @@ static void lustre_shutdown(void)
</span> assert(lustre_runtime);
/* TODO: free data structures */
<span style="color: #000000;background-color: #ffdddd">- HASH_CLEAR(hlink, lustre_runtime->record_hash);
-
- free(lustre_runtime->ref_array);
</span> free(lustre_runtime->record_array);
free(lustre_runtime);
lustre_runtime = NULL;
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/c3a85a3ebe2097ed33150cf112d30ff2ced7ab46">View it on GitLab</a>.
<br>
You're receiving this email because of your account on xgitlab.cels.anl.gov.
If you'd like to receive fewer emails, you can
adjust your notification settings.
<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/c3a85a3ebe2097ed33150cf112d30ff2ced7ab46"}}</script>
</p>
</div>
</body>
</html>