<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/a22233d71f256a142c0ddc2729e8d5cc0d59de45">a22233d7</a></strong>
<div>
<span>by Shane Snyder</span>
<i>at 2016-01-29T15:40:17-06:00</i>
</div>
<pre class='commit-message'>improve slurm epilog script

epilog will now skip on-node compression if only a single compute
node is used and will generate the final log file instead</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
darshan-runtime/lib/darshan-core.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
darshan-runtime/share/darshan-mmap-epilog.sh.in
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/a22233d71f256a142c0ddc2729e8d5cc0d59de45#diff-0'>
<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">@@ -391,8 +391,7 @@ void darshan_core_shutdown()
</span>     if(getenv("DARSHAN_INTERNAL_TIMING"))
         internal_timing_flag = 1;
 
<span style="color: #000000;background-color: #ffdddd">-    if(internal_timing_flag)
-        start_log_time = DARSHAN_MPI_CALL(PMPI_Wtime)();
</span><span style="color: #000000;background-color: #ddffdd">+    start_log_time = DARSHAN_MPI_CALL(PMPI_Wtime)();
</span> 
     /* disable darhan-core while we shutdown */
     DARSHAN_CORE_LOCK();
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://xgitlab.cels.anl.gov/darshan/darshan/commit/a22233d71f256a142c0ddc2729e8d5cc0d59de45#diff-1'>
<strong>
darshan-runtime/share/darshan-mmap-epilog.sh.in
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/darshan-runtime/share/darshan-mmap-epilog.sh.in
</span><span style="color: #000000;background-color: #ddffdd">+++ b/darshan-runtime/share/darshan-mmap-epilog.sh.in
</span><span style="color: #aaaaaa">@@ -11,8 +11,6 @@ DARSHAN_INSTALL_DIR=@prefix@
</span> # use the log dir specified at configure time
 DARSHAN_LOG_DIR=@__DARSHAN_LOG_PATH@
 
<span style="color: #000000;background-color: #ffdddd">-NODE_NAME=$(uname -n)
-
</span> # use the default mmap log directory (/tmp), unless the 
 # env variable is set to something
 if [ -z "$DARSHAN_MMAP_LOGPATH" ]; then
<span style="color: #aaaaaa">@@ -24,36 +22,54 @@ fi
</span> DARSHAN_MMAP_LOG_GLOB=${DARSHAN_MMAP_LOG_DIR}/*id${SLURM_JOB_ID}*.darshan
 
 # if no mmap logs found for this job, we have nothing to do
<span style="color: #000000;background-color: #ffdddd">-DARSHAN_TEST_LOG=$(ls $DARSHAN_MMAP_LOG_GLOB 2>/dev/null | head -n 1)
-if [ -z $DARSHAN_TEST_LOG ]; then
</span><span style="color: #000000;background-color: #ddffdd">+DARSHAN_MMAP_LOG1=$(ls $DARSHAN_MMAP_LOG_GLOB 2>/dev/null | head -n 1)
+if [ -z $DARSHAN_MMAP_LOG1 ]; then
</span>     exit 0
 fi
 
 # get the job start time from the first log file
<span style="color: #000000;background-color: #ffdddd">-JOB_START_DATE=$(${DARSHAN_INSTALL_DIR}/bin/darshan-parser $DARSHAN_TEST_LOG |
</span><span style="color: #000000;background-color: #ddffdd">+JOB_START_DATE=$(${DARSHAN_INSTALL_DIR}/bin/darshan-parser $DARSHAN_MMAP_LOG1 |
</span>     grep "# start_time_asci" | cut -d':' -f 2- | cut -d' ' -f 2-)
<span style="color: #000000;background-color: #ffdddd">-OUTLOG_YEAR=$(date --date="$(printf "$JOB_START_DATE")" +"%Y")
-OUTLOG_MON=$(date --date="$(printf "$JOB_START_DATE")" +"%-m")
-OUTLOG_DAY=$(date --date="$(printf "$JOB_START_DATE")" +"%-d")
-OUTLOG_SECS=$((
</span><span style="color: #000000;background-color: #ddffdd">+OUTPUT_YEAR=$(date --date="$(printf "$JOB_START_DATE")" +"%Y")
+OUTPUT_MON=$(date --date="$(printf "$JOB_START_DATE")" +"%-m")
+OUTPUT_DAY=$(date --date="$(printf "$JOB_START_DATE")" +"%-d")
+OUTPUT_SECS=$((
</span>     ($(date --date="$(printf "$JOB_START_DATE")" +"%-H") * 60 * 60) +
     ($(date --date="$(printf "$JOB_START_DATE")" +"%-M") * 60) +
     ($(date --date="$(printf "$JOB_START_DATE")" +"%-S"))
 ))
 
<span style="color: #000000;background-color: #ffdddd">-MMAP_LOG_PRE=$(basename $DARSHAN_TEST_LOG | cut -d'_' -f 1-3)
</span><span style="color: #000000;background-color: #ddffdd">+LOG_NAME_PRE=$(basename $DARSHAN_MMAP_LOG1 | cut -d'_' -f 1-3)
+
+# construct full name of directory to store output log(s)
+OUTPUT_LOG_DIR=${DARSHAN_LOG_DIR}/${OUTPUT_YEAR}/${OUTPUT_MON}/${OUTPUT_DAY}/
+OUTPUT_NAME_PRE=${LOG_NAME_PRE}_${OUTPUT_MON}-${OUTPUT_DAY}-${OUTPUT_SECS}
+
+if [ $SLURM_NNODES -gt 1 ]; then
+    NODE_LOG_DIR=${OUTPUT_LOG_DIR}/${OUTPUT_NAME_PRE}
+    NODE_NAME=$(uname -n)
</span> 
<span style="color: #000000;background-color: #ffdddd">-# construct full output log directory name
-OUTLOG_DIR=${DARSHAN_LOG_DIR}/${OUTLOG_YEAR}/${OUTLOG_MON}/${OUTLOG_DAY}/
-OUTLOG_DIR=${OUTLOG_DIR}/${MMAP_LOG_PRE}_${OUTLOG_MON}-${OUTLOG_DAY}-${OUTLOG_SECS}
</span><span style="color: #000000;background-color: #ddffdd">+    # multiple nodes, create a node log directory for everyone to write to
+    mkdir -p $NODE_LOG_DIR
</span> 
<span style="color: #000000;background-color: #ffdddd">-# TODO: do shared reduction and skip mkdir if just one compute node?
</span><span style="color: #000000;background-color: #ddffdd">+    # construct the per-node log file and store in the output directory
+    $DARSHAN_INSTALL_DIR/bin/darshan-merge \
+        --output ${NODE_LOG_DIR}/${LOG_NAME_PRE}_${NODE_NAME}.darshan \
+        $DARSHAN_MMAP_LOG_GLOB
+else
+    TMP_LOG=${OUTPUT_NAME_PRE}.darshan
+
+    # single node, just create the final output darshan log
+    LOG_WRITE_START=$(date +%s)
+    $DARSHAN_INSTALL_DIR/bin/darshan-merge
+        --shared-redux --output ${OUTPUT_LOG_DIR}/${TMP_LOG} \
+        $DARSHAN_MMAP_LOG_GLOB
+    LOG_WRITE_END=$(date +%s)
</span> 
<span style="color: #000000;background-color: #ffdddd">-# create the output directory for this job
-mkdir -p $OUTLOG_DIR
</span><span style="color: #000000;background-color: #ddffdd">+    WRITE_TM=$(($LOG_WRITE_END - $LOG_WRITE_START + 1))
+    FINAL_LOG=${OUTPUT_NAME_PRE}-${RANDOM}_${WRITE_TM}.darshan
</span> 
<span style="color: #000000;background-color: #ffdddd">-# construct the per-node log files and store in the output directory
-$DARSHAN_INSTALL_DIR/bin/darshan-merge --output ${OUTLOG_DIR}/${MMAP_LOG_PRE}_${NODE_NAME}.darshan \
-    $DARSHAN_MMAP_LOG_GLOB
</span><span style="color: #000000;background-color: #ddffdd">+    mv ${OUTPUT_LOG_DIR}/${TMP_LOG} ${OUTPUT_LOG_DIR}/${FINAL_LOG}
+fi
</span> 
 exit 0
</code></pre>

<br>
</li>

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

<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/a22233d71f256a142c0ddc2729e8d5cc0d59de45">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/a22233d71f256a142c0ddc2729e8d5cc0d59de45"}}</script>
</p>
</div>
</body>
</html>