<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/cb1c7ace68ba67e8c8283e16936d5372c2380ab5">cb1c7ace</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2015-12-08T15:04:41Z</i>
</div>
<pre class='commit-message'>change runtime darshan record_ref struct</pre>
</li>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/9d7f638b74cd1af45794253b31f576b30f6ad949">9d7f638b</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2015-12-08T15:16:19Z</i>
</div>
<pre class='commit-message'>change util record ref structure def</pre>
</li>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/05acb6d4ad326dbcf96288bc4248107b27ec4406">05acb6d4</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2015-12-08T16:07:43Z</i>
</div>
<pre class='commit-message'>introduce base record concept in posix mod</pre>
</li>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/ed103a2ae7a9c396eb0a21642de5c3c9db5de18a">ed103a2a</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2015-12-08T16:22:23Z</i>
</div>
<pre class='commit-message'>add base record concept to utilities</pre>
</li>
</ul>
<h4>12 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-log-format.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
darshan-posix-log-format.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
darshan-runtime/darshan-core.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
darshan-runtime/lib/darshan-core.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
darshan-runtime/lib/darshan-posix.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
darshan-util/darshan-analyzer.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
darshan-util/darshan-convert.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
darshan-util/darshan-logutils.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
darshan-util/darshan-logutils.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
darshan-util/darshan-parser.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-10'>
darshan-util/darshan-posix-logutils.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-11'>
darshan-util/darshan-stitch-logs.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-0'>
<strong>
darshan-log-format.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-log-format.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-log-format.h
</span><span style="color: #aaaaaa">@@ -120,11 +120,10 @@ struct darshan_job
</span>     char metadata[DARSHAN_JOB_METADATA_LEN];
 };
 
-/* minimal record stored for each file/object accessed by Darshan */
-struct darshan_record
<span style="color: #000000;background-color: #ddffdd">+struct darshan_base_record
</span> {
<span style="color: #000000;background-color: #ffdddd">-    char* name;
</span>     darshan_record_id id;
<span style="color: #000000;background-color: #ddffdd">+    int64_t rank;
</span> };
 
 #endif /* __DARSHAN_LOG_FORMAT_H */
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-1'>
<strong>
darshan-posix-log-format.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-posix-log-format.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-posix-log-format.h
</span><span style="color: #aaaaaa">@@ -170,8 +170,7 @@ enum darshan_posix_f_indices
</span>  */
 struct darshan_posix_file
 {
<span style="color: #000000;background-color: #ffdddd">-    darshan_record_id f_id;
-    int64_t rank;
</span><span style="color: #000000;background-color: #ddffdd">+    struct darshan_base_record base_rec;
</span>     int64_t counters[POSIX_NUM_INDICES];
     double fcounters[POSIX_F_NUM_INDICES];
 };
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-2'>
<strong>
darshan-runtime/darshan-core.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/darshan-core.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/darshan-core.h
</span><span style="color: #aaaaaa">@@ -66,7 +66,8 @@ struct darshan_core_module
</span> 
 struct darshan_core_record_ref
 {
<span style="color: #000000;background-color: #ffdddd">-    struct darshan_record rec;
</span><span style="color: #000000;background-color: #ddffdd">+    char *name;
+    darshan_record_id id;
</span>     uint64_t mod_flags;
     uint64_t global_mod_flags;
     UT_hash_handle hlink;
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-3'>
<strong>
darshan-runtime/lib/darshan-core.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/lib/darshan-core.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/lib/darshan-core.c
</span><span style="color: #aaaaaa">@@ -616,16 +616,16 @@ static void darshan_add_record_hashref(struct darshan_core_runtime *core,
</span>              * appropriate location in the record hash buffer
              */
             tmp_p = (char *)tmp_p + sizeof(darshan_record_id);
<span style="color: #000000;background-color: #ffdddd">-            (*ref)->rec.name = (char *)tmp_p;
</span><span style="color: #000000;background-color: #ddffdd">+            (*ref)->name = (char *)tmp_p;
</span>         }
 
         /* set record ref fields */
<span style="color: #000000;background-color: #ffdddd">-        (*ref)->rec.id = id;
-        if((*ref)->rec.name)
-            strcpy((*ref)->rec.name, name);
</span><span style="color: #000000;background-color: #ddffdd">+        (*ref)->id = id;
+        if((*ref)->name)
+            strcpy((*ref)->name, name);
</span> 
         /* TODO: look at HASH_ADD_KEYPTR, use same strategy (big contig pool) for non-mmap darshan */
<span style="color: #000000;background-color: #ffdddd">-        HASH_ADD(hlink, core->rec_hash, rec.id, sizeof(darshan_record_id), (*ref));
</span><span style="color: #000000;background-color: #ddffdd">+        HASH_ADD(hlink, core->rec_hash, id, sizeof(darshan_record_id), (*ref));
</span>         core->rec_hash_cnt++;
         core->rec_hash_sz += record_size;
         core->log_hdr_p->rec_map.len += record_size;
<span style="color: #aaaaaa">@@ -836,7 +836,7 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
</span>         i = 0;
         HASH_ITER(hlink, core->rec_hash, ref, tmp)
         {
<span style="color: #000000;background-color: #ffdddd">-            id_array[i++] = ref->rec.id;           
</span><span style="color: #000000;background-color: #ddffdd">+            id_array[i++] = ref->id;           
</span>         }
     }
 
<span style="color: #aaaaaa">@@ -1060,7 +1060,7 @@ static int darshan_log_write_record_hash(MPI_File log_fh, struct darshan_core_ru
</span>         if(my_rank > 0 && ref->global_mod_flags)
             continue;
 
<span style="color: #000000;background-color: #ffdddd">-        name_len = strlen(ref->rec.name);
</span><span style="color: #000000;background-color: #ddffdd">+        name_len = strlen(ref->name);
</span>         record_sz = sizeof(darshan_record_id) + sizeof(uint32_t) + name_len;
         /* make sure there is room in the buffer for this record */
         if((hash_buf_off + record_sz) > (hash_buf + hash_buf_sz))
<span style="color: #aaaaaa">@@ -1088,11 +1088,11 @@ static int darshan_log_write_record_hash(MPI_File log_fh, struct darshan_core_ru
</span>          * NOTE: darshan record hash serialization method: 
          *          ... darshan_record_id | (uint32_t) path_len | path ...
          */
<span style="color: #000000;background-color: #ffdddd">-        *((darshan_record_id *)hash_buf_off) = ref->rec.id;
</span><span style="color: #000000;background-color: #ddffdd">+        *((darshan_record_id *)hash_buf_off) = ref->id;
</span>         hash_buf_off += sizeof(darshan_record_id);
         *((uint32_t *)hash_buf_off) = name_len;
         hash_buf_off += sizeof(uint32_t);
<span style="color: #000000;background-color: #ffdddd">-        memcpy(hash_buf_off, ref->rec.name, name_len);
</span><span style="color: #000000;background-color: #ddffdd">+        memcpy(hash_buf_off, ref->name, name_len);
</span>         hash_buf_off += name_len;
     }
     hash_buf_sz = hash_buf_off - hash_buf;
<span style="color: #aaaaaa">@@ -1281,7 +1281,7 @@ void darshan_core_unregister_module(
</span>     /* iterate all records and disassociate this module from them */
     HASH_ITER(hlink, darshan_core->rec_hash, ref, tmp)
     {
<span style="color: #000000;background-color: #ffdddd">-        darshan_core_unregister_record(ref->rec.id, mod_id);
</span><span style="color: #000000;background-color: #ddffdd">+        darshan_core_unregister_record(ref->id, mod_id);
</span>     }
 
     free(darshan_core->mod_array[mod_id]);
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#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">@@ -1717,13 +1717,14 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
</span>     /* no existing record, assign a new file record from the global array */
     file = &(posix_runtime->file_runtime_array[posix_runtime->file_array_ndx]);
     file->file_record = &(posix_runtime->file_record_array[posix_runtime->file_array_ndx]);
<span style="color: #000000;background-color: #ffdddd">-    file->file_record->f_id = file_id;
-    file->file_record->rank = my_rank;
</span><span style="color: #000000;background-color: #ddffdd">+    file->file_record->base_rec.id = file_id;
+    file->file_record->base_rec.rank = my_rank;
</span>     file->file_record->counters[POSIX_MEM_ALIGNMENT] = darshan_mem_alignment;
     file->file_record->counters[POSIX_FILE_ALIGNMENT] = file_alignment;
 
     /* add new record to file hash table */
<span style="color: #000000;background-color: #ffdddd">-    HASH_ADD(hlink, posix_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
</span><span style="color: #000000;background-color: #ddffdd">+    HASH_ADD(hlink, posix_runtime->file_hash, file_record->base_rec.id,
+        sizeof(darshan_record_id), file);
</span>     posix_runtime->file_array_ndx++;
 
     if(newname != name)
<span style="color: #aaaaaa">@@ -1816,9 +1817,9 @@ static int posix_record_compare(const void* a_p, const void* b_p)
</span>     const struct darshan_posix_file* a = a_p;
     const struct darshan_posix_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">@@ -1883,8 +1884,8 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
</span>     for(i=0; i<*len; i++)
     {
         memset(&tmp_file, 0, sizeof(struct darshan_posix_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=POSIX_OPENS; j<=POSIX_FDSYNCS; j++)
<span style="color: #aaaaaa">@@ -2265,7 +2266,7 @@ static void posix_get_output_data(
</span> 
             /* initialize fastest/slowest info prior to the reduction */
             file->file_record->counters[POSIX_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[POSIX_FASTEST_RANK_BYTES] =
                 file->file_record->counters[POSIX_BYTES_READ] +
                 file->file_record->counters[POSIX_BYTES_WRITTEN];
<span style="color: #aaaaaa">@@ -2283,7 +2284,7 @@ static void posix_get_output_data(
</span>             file->file_record->fcounters[POSIX_F_SLOWEST_RANK_TIME] =
                 file->file_record->fcounters[POSIX_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 
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-5'>
<strong>
darshan-util/darshan-analyzer.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-analyzer.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-analyzer.c
</span><span style="color: #aaaaaa">@@ -68,7 +68,7 @@ int process_log(const char *fname, double *io_ratio, int *used_mpio, int *used_p
</span>     {
         f_count   += 1;
 
<span style="color: #000000;background-color: #ffdddd">-        if (psx_rec.rank == -1)
</span><span style="color: #000000;background-color: #ddffdd">+        if (psx_rec.base_rec.rank == -1)
</span>             *used_shared = 1;
         else
             *used_fpp = 1;
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-6'>
<strong>
darshan-util/darshan-convert.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-convert.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-convert.c
</span><span style="color: #aaaaaa">@@ -148,13 +148,13 @@ void obfuscate_filenames(int key, struct darshan_record_ref *rec_hash)
</span> 
     HASH_ITER(hlink, rec_hash, ref, tmp)
     {
<span style="color: #000000;background-color: #ffdddd">-        hashed = darshan_hashlittle(ref->rec.name, strlen(ref->rec.name), key);
</span><span style="color: #000000;background-color: #ddffdd">+        hashed = darshan_hashlittle(ref->name, strlen(ref->name), key);
</span>         sprintf(tmp_string, "%u", hashed);
<span style="color: #000000;background-color: #ffdddd">-        free(ref->rec.name);
-        ref->rec.name = malloc(strlen(tmp_string) + 1);
-        assert(ref->rec.name);
-        memcpy(ref->rec.name, tmp_string, strlen(tmp_string));
-        ref->rec.name[strlen(tmp_string)] = '\0';
</span><span style="color: #000000;background-color: #ddffdd">+        free(ref->name);
+        ref->name = malloc(strlen(tmp_string) + 1);
+        assert(ref->name);
+        memcpy(ref->name, tmp_string, strlen(tmp_string));
+        ref->name[strlen(tmp_string)] = '\0';
</span>     }
 
     return;
<span style="color: #aaaaaa">@@ -208,10 +208,10 @@ static void remove_hash_recs(struct darshan_record_ref **rec_hash, darshan_recor
</span> 
     HASH_ITER(hlink, *rec_hash, ref, tmp)
     {
<span style="color: #000000;background-color: #ffdddd">-        if(ref->rec.id != hash)
</span><span style="color: #000000;background-color: #ddffdd">+        if(ref->id != hash)
</span>         {
             HASH_DELETE(hlink, *rec_hash, ref);
<span style="color: #000000;background-color: #ffdddd">-            free(ref->rec.name);
</span><span style="color: #000000;background-color: #ddffdd">+            free(ref->name);
</span>             free(ref);
         }
     }
<span style="color: #aaaaaa">@@ -403,7 +403,7 @@ int main(int argc, char **argv)
</span>     HASH_ITER(hlink, rec_hash, ref, tmp)
     {
         HASH_DELETE(hlink, rec_hash, ref);
<span style="color: #000000;background-color: #ffdddd">-        free(ref->rec.name);
</span><span style="color: #000000;background-color: #ddffdd">+        free(ref->name);
</span>         free(ref);
     }
 
</code></pre>

<br>
</li>
<li id='diff-7'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-7'>
<strong>
darshan-util/darshan-logutils.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-logutils.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-logutils.c
</span><span style="color: #aaaaaa">@@ -589,8 +589,8 @@ int darshan_log_gethash(darshan_fd fd, struct darshan_record_ref **hash)
</span>                     free(hash_buf);
                     return(-1);
                 }
<span style="color: #000000;background-color: #ffdddd">-                ref->rec.name = malloc(strlen(path_ptr) + 1);
-                if(!ref->rec.name)
</span><span style="color: #000000;background-color: #ddffdd">+                ref->name = malloc(strlen(path_ptr) + 1);
+                if(!ref->name)
</span>                 {
                     free(ref);
                     free(hash_buf);
<span style="color: #aaaaaa">@@ -598,11 +598,11 @@ int darshan_log_gethash(darshan_fd fd, struct darshan_record_ref **hash)
</span>                 }
 
                 /* set the fields for this record */
<span style="color: #000000;background-color: #ffdddd">-                ref->rec.id = *rec_id_ptr;
-                strcpy(ref->rec.name, path_ptr);
</span><span style="color: #000000;background-color: #ddffdd">+                ref->id = *rec_id_ptr;
+                strcpy(ref->name, path_ptr);
</span> 
                 /* add this record to the hash */
<span style="color: #000000;background-color: #ffdddd">-                HASH_ADD(hlink, *hash, rec.id, sizeof(darshan_record_id), ref);
</span><span style="color: #000000;background-color: #ddffdd">+                HASH_ADD(hlink, *hash, id, sizeof(darshan_record_id), ref);
</span>             }
 
             buf_ptr += strlen(path_ptr) + 1;
<span style="color: #aaaaaa">@@ -658,10 +658,10 @@ int darshan_log_puthash(darshan_fd fd, struct darshan_record_ref *hash)
</span>          * NOTE: darshan record hash serialization method: 
          *          ... darshan_record_id | path '\0' ...
          */
<span style="color: #000000;background-color: #ffdddd">-        *((darshan_record_id *)buf_ptr) = ref->rec.id;
</span><span style="color: #000000;background-color: #ddffdd">+        *((darshan_record_id *)buf_ptr) = ref->id;
</span>         buf_ptr += sizeof(darshan_record_id);
<span style="color: #000000;background-color: #ffdddd">-        strcpy(buf_ptr, ref->rec.name);
-        buf_ptr += strlen(ref->rec.name) + 1;
</span><span style="color: #000000;background-color: #ddffdd">+        strcpy(buf_ptr, ref->name);
+        buf_ptr += strlen(ref->name) + 1;
</span> 
         /* write this hash entry to log file */
         wrote = darshan_log_dzwrite(fd, DARSHAN_REC_MAP_REGION_ID,
<span style="color: #aaaaaa">@@ -1146,10 +1146,8 @@ static void darshan_log_dzdestroy(darshan_fd fd)
</span>             break;
 #endif
         case DARSHAN_NO_COMP:
<span style="color: #000000;background-color: #ffdddd">-        {
</span>             /* do nothing */
             break;
<span style="color: #000000;background-color: #ffdddd">-        }
</span>         default:
             fprintf(stderr, "Error: invalid compression type.\n");
     }
<span style="color: #aaaaaa">@@ -1192,10 +1190,8 @@ static int darshan_log_dzread(darshan_fd fd, int region_id, void *buf, int len)
</span>             break;
 #endif
         case DARSHAN_NO_COMP:
<span style="color: #000000;background-color: #ffdddd">-        {
</span>             ret = darshan_log_noz_read(fd, map, buf, len, reset_strm_flag);
             break;
<span style="color: #000000;background-color: #ffdddd">-        }
</span>         default:
             fprintf(stderr, "Error: invalid compression type.\n");
             return(-1);
</code></pre>

<br>
</li>
<li id='diff-8'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-8'>
<strong>
darshan-util/darshan-logutils.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-logutils.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-logutils.h
</span><span style="color: #aaaaaa">@@ -43,7 +43,8 @@ typedef struct darshan_fd_s* darshan_fd;
</span> 
 struct darshan_record_ref
 {
<span style="color: #000000;background-color: #ffdddd">-    struct darshan_record rec;
</span><span style="color: #000000;background-color: #ddffdd">+    char *name;
+    darshan_record_id id;
</span>     UT_hash_handle hlink;
 };
 
</code></pre>

<br>
</li>
<li id='diff-9'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-9'>
<strong>
darshan-util/darshan-parser.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-parser.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-parser.c
</span><span style="color: #aaaaaa">@@ -412,7 +412,7 @@ int main(int argc, char **argv)
</span>             /* get mount point and fs type associated with this record */
             for(j=0; j<mount_count; j++)
             {
<span style="color: #000000;background-color: #ffdddd">-                if(strncmp(mnt_pts[j], ref->rec.name, strlen(mnt_pts[j])) == 0)
</span><span style="color: #000000;background-color: #ddffdd">+                if(strncmp(mnt_pts[j], ref->name, strlen(mnt_pts[j])) == 0)
</span>                 {
                     mnt_pt = mnt_pts[j];
                     fs_type = fs_types[j];
<span style="color: #aaaaaa">@@ -427,7 +427,7 @@ int main(int argc, char **argv)
</span>             if(mask & OPTION_BASE)
             {
                 /* print the corresponding module data for this record */
<span style="color: #000000;background-color: #ffdddd">-                mod_logutils[i]->log_print_record(mod_buf, ref->rec.name,
</span><span style="color: #000000;background-color: #ddffdd">+                mod_logutils[i]->log_print_record(mod_buf, ref->name,
</span>                     mnt_pt, fs_type);
             }
 
<span style="color: #aaaaaa">@@ -623,7 +623,7 @@ cleanup:
</span>     HASH_ITER(hlink, rec_hash, ref, tmp_ref)
     {
         HASH_DELETE(hlink, rec_hash, ref);
<span style="color: #000000;background-color: #ffdddd">-        free(ref->rec.name);
</span><span style="color: #000000;background-color: #ddffdd">+        free(ref->name);
</span>         free(ref);
     }
 
<span style="color: #aaaaaa">@@ -654,7 +654,7 @@ void posix_accum_file(struct darshan_posix_file *pfile,
</span> 
     hfile->procs += 1;
 
<span style="color: #000000;background-color: #ffdddd">-    if(pfile->rank == -1)
</span><span style="color: #000000;background-color: #ddffdd">+    if(pfile->base_rec.rank == -1)
</span>     {
         hfile->slowest_time = pfile->fcounters[POSIX_F_SLOWEST_RANK_TIME];
     }
<span style="color: #aaaaaa">@@ -666,7 +666,7 @@ void posix_accum_file(struct darshan_posix_file *pfile,
</span>             pfile->fcounters[POSIX_F_WRITE_TIME]));
     }
 
<span style="color: #000000;background-color: #ffdddd">-    if(pfile->rank == -1)
</span><span style="color: #000000;background-color: #ddffdd">+    if(pfile->base_rec.rank == -1)
</span>     {
         hfile->procs = nprocs;
         hfile->type |= FILETYPE_SHARED;
<span style="color: #aaaaaa">@@ -1029,7 +1029,7 @@ void posix_accum_perf(struct darshan_posix_file *pfile,
</span>      *     by_slowest: use slowest rank time from log data
      *                 (most accurate but requires newer log version)
      */
<span style="color: #000000;background-color: #ffdddd">-    if(pfile->rank == -1)
</span><span style="color: #000000;background-color: #ddffdd">+    if(pfile->base_rec.rank == -1)
</span>     {
         /* by_open */
         if(pfile->fcounters[POSIX_F_CLOSE_TIMESTAMP] >
<span style="color: #aaaaaa">@@ -1080,11 +1080,12 @@ void posix_accum_perf(struct darshan_posix_file *pfile,
</span>      */
     else
     {
<span style="color: #000000;background-color: #ffdddd">-        pdata->rank_cumul_io_time[pfile->rank] +=
</span><span style="color: #000000;background-color: #ddffdd">+        pdata->rank_cumul_io_time[pfile->base_rec.rank] +=
</span>             (pfile->fcounters[POSIX_F_META_TIME] +
             pfile->fcounters[POSIX_F_READ_TIME] +
             pfile->fcounters[POSIX_F_WRITE_TIME]);
<span style="color: #000000;background-color: #ffdddd">-        pdata->rank_cumul_md_time[pfile->rank] += pfile->fcounters[POSIX_F_META_TIME];
</span><span style="color: #000000;background-color: #ddffdd">+        pdata->rank_cumul_md_time[pfile->base_rec.rank] +=
+            pfile->fcounters[POSIX_F_META_TIME];
</span>     }
 
     return;
<span style="color: #aaaaaa">@@ -1461,7 +1462,7 @@ void posix_file_list(hash_entry_t *file_hash,
</span> 
         printf("%" PRIu64 "\t%s\t%" PRId64 "\t%f\t%f",
             curr->rec_id,
<span style="color: #000000;background-color: #ffdddd">-            ref->rec.name,
</span><span style="color: #000000;background-color: #ddffdd">+            ref->name,
</span>             curr->procs,
             curr->slowest_time,
             curr->cumul_time/(double)curr->procs);
<span style="color: #aaaaaa">@@ -1555,7 +1556,7 @@ void mpiio_file_list(hash_entry_t *file_hash,
</span> 
         printf("%" PRIu64 "\t%s\t%" PRId64 "\t%f\t%f",
             curr->rec_id,
<span style="color: #000000;background-color: #ffdddd">-            ref->rec.name,
</span><span style="color: #000000;background-color: #ddffdd">+            ref->name,
</span>             curr->procs,
             curr->slowest_time,
             curr->cumul_time/(double)curr->procs);
</code></pre>

<br>
</li>
<li id='diff-10'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-10'>
<strong>
darshan-util/darshan-posix-logutils.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-posix-logutils.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-posix-logutils.c
</span><span style="color: #aaaaaa">@@ -62,15 +62,15 @@ static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf,
</span>         if(fd->swap_flag)
         {
             /* swap bytes if necessary */
<span style="color: #000000;background-color: #ffdddd">-            DARSHAN_BSWAP64(&file->f_id);
-            DARSHAN_BSWAP64(&file->rank);
</span><span style="color: #000000;background-color: #ddffdd">+            DARSHAN_BSWAP64(&file->base_rec.id);
+            DARSHAN_BSWAP64(&file->base_rec.rank);
</span>             for(i=0; i<POSIX_NUM_INDICES; i++)
                 DARSHAN_BSWAP64(&file->counters[i]);
             for(i=0; i<POSIX_F_NUM_INDICES; i++)
                 DARSHAN_BSWAP64(&file->fcounters[i]);
         }
 
<span style="color: #000000;background-color: #ffdddd">-        *rec_id = file->f_id;
</span><span style="color: #000000;background-color: #ddffdd">+        *rec_id = file->base_rec.id;
</span>         return(1);
     }
 }
<span style="color: #aaaaaa">@@ -98,15 +98,17 @@ static void darshan_log_print_posix_file(void *file_rec, char *file_name,
</span>     for(i=0; i<POSIX_NUM_INDICES; i++)
     {
         DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
<span style="color: #000000;background-color: #ffdddd">-            posix_file_rec->rank, posix_file_rec->f_id, posix_counter_names[i],
-            posix_file_rec->counters[i], file_name, mnt_pt, fs_type);
</span><span style="color: #000000;background-color: #ddffdd">+            posix_file_rec->base_rec.rank, posix_file_rec->base_rec.id,
+            posix_counter_names[i], posix_file_rec->counters[i],
+            file_name, mnt_pt, fs_type);
</span>     }
 
     for(i=0; i<POSIX_F_NUM_INDICES; i++)
     {
         DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
<span style="color: #000000;background-color: #ffdddd">-            posix_file_rec->rank, posix_file_rec->f_id, posix_f_counter_names[i],
-            posix_file_rec->fcounters[i], file_name, mnt_pt, fs_type);
</span><span style="color: #000000;background-color: #ddffdd">+            posix_file_rec->base_rec.rank, posix_file_rec->base_rec.id,
+            posix_f_counter_names[i], posix_file_rec->fcounters[i],
+            file_name, mnt_pt, fs_type);
</span>     }
 
     return;
</code></pre>

<br>
</li>
<li id='diff-11'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a#diff-11'>
<strong>
darshan-util/darshan-stitch-logs.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-util/darshan-stitch-logs.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-util/darshan-stitch-logs.c
</span><span style="color: #aaaaaa">@@ -1,13 +1,71 @@
</span><span style="color: #000000;background-color: #ffdddd">-    #include <stdio.h>
</span><span style="color: #000000;background-color: #ddffdd">+#include <stdio.h>
</span> #include <stdlib.h>
 #include <fcntl.h>
-#include <glob.h>
 #include <string.h>
<span style="color: #000000;background-color: #ddffdd">+#include <getopt.h>
+#include <glob.h>
</span> 
 #include "darshan-logutils.h"
 
 #define DEF_MOD_BUF_SIZE 1024 /* 1 KiB is enough for all current mod records ... */
 
<span style="color: #000000;background-color: #ddffdd">+/* TODO: are there any checks we should do to ensure tmp logs belong to the same job */
+/* we can't specifically check the job id, since the pid is used if no job scheduler */
+
+/* TODO: how do we set the output logfile name to be unique, and have necessary semantic info contained */
+
+void usage(char *exename)
+{
+    fprintf(stderr, "Usage: %s [options] <tmp_dir> <job_id>\n", exename);
+    fprintf(stderr, "       TODO: description.\n");
+    fprintf(stderr, "       --shared-redux Reduce globally shared records into a single record.\n");
+
+    exit(1);
+}
+
+void parse_args(int argc, char **argv, char **tmplog_dir, int *tmplog_jobid,
+    int *shared_redux)
+{
+    int index;
+    static struct option long_opts[] =
+    {
+        {"shared-redux", no_argument, NULL, 's'},
+        {0, 0, 0, 0}
+    };
+
+    *shared_redux = 0;
+
+    while(1)
+    {
+        int c = getopt_long(argc, argv, "", long_opts, &index);
+
+        if(c == -1) break;
+
+        switch(c)
+        {
+            case 's':
+                *shared_redux = 1;
+                break;
+            case '?':
+            default:
+                usage(argv[0]);
+                break;
+        }
+    }
+
+    if(optind + 2 == argc)
+    {
+        *tmplog_dir = argv[optind];
+        *tmplog_jobid = atoi(argv[optind+1]);
+    }
+    else
+    {
+        usage(argv[0]);
+    }
+
+    return;
+}
+
</span> int logfile_path_comp(const void *a, const void *b)
 {
     char *pathA = *(char **)a;
<span style="color: #aaaaaa">@@ -31,6 +89,7 @@ int logfile_path_comp(const void *a, const void *b)
</span> 
 int main(int argc, char *argv[])
 {
<span style="color: #000000;background-color: #ddffdd">+    int shared_redux;
</span>     char *tmplog_dir;
     int job_id;
     glob_t globbuf;
<span style="color: #aaaaaa">@@ -50,22 +109,8 @@ int main(int argc, char *argv[])
</span>     int i, j;
     int ret;
 
<span style="color: #000000;background-color: #ffdddd">-    /* TODO: are there any checks we should do to ensure tmp logs belong to the same job */
-    /* we can't specifically check the job id, since the pid is used if no job scheduler */
</span>-
<span style="color: #000000;background-color: #ffdddd">-    /* TODO: how do we set the output logfile name to be unique, and have necessary semantic info contained */
</span>-
<span style="color: #000000;background-color: #ffdddd">-    if(argc != 3)
-    {
-        fprintf(stderr, "Usage: ./darshan-stitch-tmplogs <tmp_dir> <job_id>\n"
-            "\t<tmp_dir> is the directory containing the temporary Darshan logs\n"
-            "\t<job_id> is the job id of the logs we are trying to stitch\n");
-        return(0);
-    }
</span>-
     /* grab command line arguments */
<span style="color: #000000;background-color: #ffdddd">-    tmplog_dir = argv[1];
-    job_id = atoi(argv[2]);
</span><span style="color: #000000;background-color: #ddffdd">+    parse_args(argc, argv, &tmplog_dir, &job_id, &shared_redux);
</span> 
     /* construct the list of input log files to stitch together */
     snprintf(glob_pstr, 512, "%s/darshan_job%d*", tmplog_dir, job_id);
<span style="color: #aaaaaa">@@ -169,14 +214,12 @@ int main(int argc, char *argv[])
</span>          */
         HASH_ITER(hlink, in_hash, ref, tmp)
         {
<span style="color: #000000;background-color: #ffdddd">-            HASH_FIND(hlink, stitch_hash, &(ref->rec.id),
-                sizeof(darshan_record_id), found);
</span><span style="color: #000000;background-color: #ddffdd">+            HASH_FIND(hlink, stitch_hash, &(ref->id), sizeof(darshan_record_id), found);
</span>             if(!found)
             {
<span style="color: #000000;background-color: #ffdddd">-                HASH_ADD(hlink, stitch_hash, rec.id,
-                    sizeof(darshan_record_id), ref);
</span><span style="color: #000000;background-color: #ddffdd">+                HASH_ADD(hlink, stitch_hash, id, sizeof(darshan_record_id), ref);
</span>             }
<span style="color: #000000;background-color: #ffdddd">-            else if(strcmp(ref->rec.name, found->rec.name))
</span><span style="color: #000000;background-color: #ddffdd">+            else if(strcmp(ref->name, found->name))
</span>             {
                 fprintf(stderr,
                     "Error: invalid Darshan record table entry.\n");
<span style="color: #aaaaaa">@@ -250,25 +293,30 @@ int main(int argc, char *argv[])
</span>     }
     memset(mod_buf, 0, DEF_MOD_BUF_SIZE);
 
<span style="color: #000000;background-color: #ddffdd">+    /* iterate over active darshan modules and gather module data to write
+     * to the stitched together output log
+     */
</span>     for(i = 0; i < DARSHAN_MPIIO_MOD; i++)
     {
         if(!mod_logutils[i]) continue;
 
-#if 0
<span style="color: #000000;background-color: #ffdddd">-        /* XXX first build shared record list? */
-        for(j = 0; j < globbuf.gl_pathc; j++)
</span><span style="color: #000000;background-color: #ddffdd">+        if(shared_redux)
</span>         {
<span style="color: #000000;background-color: #ddffdd">+            /* copy all root's file records into an array */
</span> 
<span style="color: #000000;background-color: #ffdddd">-        }
</span><span style="color: #000000;background-color: #ddffdd">+            /* compare and updated shared records? */
+            for(j = 1; j < globbuf.gl_pathc; j++)
+            {
+            }
</span> 
<span style="color: #000000;background-color: #ffdddd">-        /* XXX second aggregate shared records ? */
-        for(j = 0; j < globbuf.gl_pathc; j++)
-        {
</span><span style="color: #000000;background-color: #ddffdd">+            /* XXX aggregate shared records? */
+            for(j = 0; j < globbuf.gl_pathc; j++)
+            {
</span> 
<span style="color: #000000;background-color: #ddffdd">+            }
</span>         }
-#endif
 
<span style="color: #000000;background-color: #ffdddd">-        /* XXX third write each rank's blobs, with rank 0 writing the shared ones ? */
</span><span style="color: #000000;background-color: #ddffdd">+        /* XXX third write each rank's blobs, with rank 0 writing the shared ones? */
</span>         for(j = 0; j < globbuf.gl_pathc; j++)
         {
             in_fd = darshan_log_open(globbuf.gl_pathv[j]);
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a">View it on GitLab</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://xgitlab.cels.anl.gov/darshan/darshan/compare/66a83b0382dade07f600a43bf50707be39e63ef2...ed103a2ae7a9c396eb0a21642de5c3c9db5de18a"}}</script>
</p>
</div>
</body>
</html>