<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>

</head>
<body>
<style type="text/css">
img {
max-width: 100%; height: auto;
}
</style>
<div class="content">
<h3>
Glenn K. Lockwood 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/a2a9e135d34d2ac0109afe2421d0104369b41b1c">a2a9e135</a></strong>
<div>
<span>by Glenn K. Lockwood</span>
<i>at 2016-05-25T13:02:53-07:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap">don't pull in the full Lustre API just for a few consts</pre>
</li>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/a61ebca2580f403acfd8c472d2fbb1356003a6b3">a61ebca2</a></strong>
<div>
<span>by Glenn K. Lockwood</span>
<i>at 2016-06-02T16:54:11-07:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap">added some infrastructure to facilitate unit testing of the darshan lustre module</pre>
</li>
</ul>
<h4>7 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#620f2ecad2bb6f74b2fcd0134963a841" style="text-decoration: none">
darshan-runtime/lib/darshan-core.c
</a>
</li>
<li class="file-stats">
<a href="#ad29afc395839758d41094872298bd0d" style="text-decoration: none">
darshan-runtime/lib/darshan-lustre.c
</a>
</li>
<li class="file-stats">
<a href="#c0b0bf6d71bc5fc7e6d50d69c8aa2413" style="text-decoration: none">
<span class="new-file" style="color: #090">
+
darshan-test/lustre/.gitignore
</span>
</a>
</li>
<li class="file-stats">
<a href="#2ace16276b68c7d5aef163bb260bd9f7" style="text-decoration: none">
<span class="new-file" style="color: #090">
+
darshan-test/lustre/Makefile
</span>
</a>
</li>
<li class="file-stats">
<a href="#4dfe7e78b540daa005ea4b5f0458c90d" style="text-decoration: none">
<span class="new-file" style="color: #090">
+
darshan-test/lustre/darshan-core-stub.c
</span>
</a>
</li>
<li class="file-stats">
<a href="#172f4bf093caeeba24730a1adff8f15a" style="text-decoration: none">
<span class="new-file" style="color: #090">
+
darshan-test/lustre/mpi.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#a453f91a0a4af7575917fad54f4ac1d0" style="text-decoration: none">
<span class="new-file" style="color: #090">
+
darshan-test/lustre/test-darshan.sh
</span>
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="620f2ecad2bb6f74b2fcd0134963a841">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-0">
<strong>
darshan-runtime/lib/darshan-core.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/darshan-runtime/lib/darshan-core.c
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-runtime/lib/darshan-core.c
</span><span style="color: #aaaaaa">@@ -33,7 +33,7 @@
</span> #include "darshan-dynamic.h"
 
 /* XXX stick this into autoconf .h */
<span style="background: #ffdddd; color: #000000">-#include <lustre/lustreapi.h>
</span><span style="background: #ddffdd; color: #000000">+#include <lustre/lustre_user.h>
</span> 
 extern char* __progname;
 extern char* __progname_full;
</code></pre>

<br>
</li>
<li id="ad29afc395839758d41094872298bd0d">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-1">
<strong>
darshan-runtime/lib/darshan-lustre.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/darshan-runtime/lib/darshan-lustre.c
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-runtime/lib/darshan-lustre.c
</span><span style="color: #aaaaaa">@@ -19,7 +19,7 @@
</span> #include <sys/ioctl.h>
 
 /* XXX stick this into autoconf .h */
<span style="background: #ffdddd; color: #000000">-#include <lustre/lustreapi.h>
</span><span style="background: #ddffdd; color: #000000">+#include <lustre/lustre_user.h>
</span> 
 #include "uthash.h"
 
</code></pre>

<br>
</li>
<li id="c0b0bf6d71bc5fc7e6d50d69c8aa2413">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-2">
<strong>
darshan-test/lustre/.gitignore
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- /dev/null
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-test/lustre/.gitignore
</span><span style="color: #aaaaaa">@@ -0,0 +1,2 @@
</span><span style="background: #ddffdd; color: #000000">+*.o
+darshan-tester
</span></code></pre>

<br>
</li>
<li id="2ace16276b68c7d5aef163bb260bd9f7">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-3">
<strong>
darshan-test/lustre/Makefile
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- /dev/null
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-test/lustre/Makefile
</span><span style="color: #aaaaaa">@@ -0,0 +1,19 @@
</span><span style="background: #ddffdd; color: #000000">+.PHONY: clean
+BINS = darshan-tester darshan-tester-mpi
+OBJS = darshan-core-stub.o darshan-lustre.o
+CFLAGS = -O0 -g -I../.. -I../../darshan-runtime
+
+### Include -I. when building non-MPI tests to include the mpi.h stub header
+CFLAGS += -I.
+
+darshan-tester: $(OBJS)
+       $(CC) $(LDFLAGS) $? $(LOADLIBES) $(LDLIBS) -o $@
+
+darshan-tester-mpi: $(OBJS)
+       $(CC) $(LDFLAGS) $? $(LOADLIBES) $(LDLIBS) -o $@
+
+darshan-lustre.o: ../../darshan-runtime/lib/darshan-lustre.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c $? -o $@
+
+clean:
+       -@rm -v $(OBJS) $(BINS)
</span></code></pre>

<br>
</li>
<li id="4dfe7e78b540daa005ea4b5f0458c90d">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-4">
<strong>
darshan-test/lustre/darshan-core-stub.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- /dev/null
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-test/lustre/darshan-core-stub.c
</span><span style="color: #aaaaaa">@@ -0,0 +1,98 @@
</span><span style="background: #ddffdd; color: #000000">+#define _XOPEN_SOURCE 500
+#define _GNU_SOURCE
+
+#include "darshan-runtime-config.h"
+#include "darshan.h"
+#include "darshan-core.h"
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <fcntl.h>
+
+/*
+ *  Global variables
+ */
+static darshan_record_id next_rec_id = 0;
+static int my_rank = 0;
+static struct darshan_module_funcs mod_funcs;
+
+/*
+ *  Import routines from Lustre module
+ */
+
+void darshan_core_register_record(
+    void *name,
+    int len,
+    darshan_module_id mod_id,
+    int printable_flag,
+    int mod_limit_flag,
+    darshan_record_id *rec_id,
+    struct darshan_fs_info *fs_info)
+{
+    *rec_id = next_rec_id++;

+    if (fs_info)
+    {
+        memset( fs_info, 0, sizeof(struct darshan_fs_info) );
+        fs_info->fs_type = -1;
+    }
+
+    return;
+}
+
+void darshan_core_register_module(
+    darshan_module_id mod_id,
+    struct darshan_module_funcs *funcs,
+    int *rank,
+    int *mod_mem_limit,
+    int *sys_mem_alignment)
+{
+/*  if (sys_mem_alignment) *sys_mem_alignment = darshan_mem_alignment; */
+    if (rank) *rank = my_rank;
+    *mod_mem_limit = DARSHAN_MOD_MEM_MAX;
+    mod_funcs = *funcs;
+
+    return;
+}
+
+void darshan_core_shutdown()
+{
+    darshan_record_id *mod_shared_recs = NULL;
+    int mod_shared_rec_cnt = 0;
+    void* mod_buf = NULL;
+    int mod_buf_sz = 0;
+
+    mod_funcs.begin_shutdown();
+    mod_funcs.get_output_data( MPI_COMM_WORLD, mod_shared_recs, mod_shared_rec_cnt, &mod_buf, &mod_buf_sz );
+
+    print_lustre_runtime();
+
+    mod_funcs.shutdown();
+
+    return;
+}
+
+int main( int argc, char **argv )
+{
+    int fd, i;
+    char *fname;
+
+    srand(234);
+
+    /* build Darshan records */
+    for ( i = 1; i < argc; i++ )
+    {
+        fname = argv[i];
+        printf( "\nProcessing %s\n", fname );
+        fd = open( fname, O_RDONLY );
+        darshan_instrument_lustre_file( fname, fd );
+        close(fd);
+    }
+
+    print_lustre_runtime();
+
+    darshan_core_shutdown();
+
+    return 0;
+}
</span></code></pre>

<br>
</li>
<li id="172f4bf093caeeba24730a1adff8f15a">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-5">
<strong>
darshan-test/lustre/mpi.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- /dev/null
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-test/lustre/mpi.h
</span><span style="color: #aaaaaa">@@ -0,0 +1,8 @@
</span><span style="background: #ddffdd; color: #000000">+/*
+ *  VERY primitive stubs that allow darshan.h to be included in non-MPI
+ *  applications like darshan-tester
+ */
+typedef int MPI_Comm;
+typedef int MPI_Datatype;
+typedef int MPI_Op;
+#define MPI_COMM_WORLD 0
</span></code></pre>

<br>
</li>
<li id="a453f91a0a4af7575917fad54f4ac1d0">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3#diff-6">
<strong>
darshan-test/lustre/test-darshan.sh
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- /dev/null
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-test/lustre/test-darshan.sh
</span><span style="color: #aaaaaa">@@ -0,0 +1,32 @@
</span><span style="background: #ddffdd; color: #000000">+#!/bin/bash
+#
+#  Run the test program through Valgrind to expose memory leaks and buffer
+#  overflows on a variety of different file locations and geometries
+#
+
+### Make some files to test.  Assume $SCRATCH points at Lustre
+for stripe in 1 2 4 8 16 32
+do
+    if [ ! -f $SCRATCH/stripe${stripe} ]; then
+        lfs setstripe -c $stripe $SCRATCH/stripe${stripe}
+    fi
+done
+
+set -x
+
+valgrind --tool=memcheck \
+         --leak-check=yes \
+         --show-reachable=yes \
+         --num-callers=20 \
+         --track-fds=yes \
+         --read-var-info=yes \
+         ./darshan-tester \
+         $SCRATCH/stripe4 \
+         $SCRATCH/stripe32 \
+         $SCRATCH/stripe1 \
+         $SCRATCH/stripe16 \
+         $SCRATCH/stripe8 \
+         $HOME/.bashrc \
+         $SCRATCH/stripe2
+
+set +x
</span></code></pre>

<br>
</li>

</div>
<div class="footer" style="margin-top: 10px">
<p style="color: #777; font-size: small">

<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/compare/3e5753e437f9572fc8efc06af98a07dbafa17812...a61ebca2580f403acfd8c472d2fbb1356003a6b3">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.

</p>
</div>
</body>
</html>