[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-pre2-47-g75eee95

Service Account git at mcs.anl.gov
Thu Mar 5 15:49:51 CST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, dev-modular has been updated
       via  75eee95096b07874b7ad3e95be5c80eccad24d8f (commit)
      from  1c3f36906e32f8acd563d09071a3b3e044ef7c81 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 75eee95096b07874b7ad3e95be5c80eccad24d8f
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Thu Mar 5 15:49:30 2015 -0600

    initial shared lib support + more TODOs

-----------------------------------------------------------------------

Summary of changes:
 darshan-runtime/Makefile.in         |   32 +++++++++++++++++---------
 darshan-runtime/darshan.h           |    3 --
 darshan-runtime/lib/darshan-core.c  |    4 ++-
 darshan-runtime/lib/darshan-posix.c |   43 ++++++++++++++++++++++++++--------
 darshan-util/darshan-logutils.c     |    1 +
 5 files changed, 58 insertions(+), 25 deletions(-)


Diff of changes:
diff --git a/darshan-runtime/Makefile.in b/darshan-runtime/Makefile.in
index 332f69d..08561a2 100644
--- a/darshan-runtime/Makefile.in
+++ b/darshan-runtime/Makefile.in
@@ -28,50 +28,60 @@ CFLAGS = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I ../ -I $(srcdir
 #
 CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir) -I$(srcdir)/../ @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -shared -fpic -DPIC -DDARSHAN_PRELOAD
 
+# TODO: BZ2?
 LIBS = -lz @LIBBZ2@
 
 lib::
 	@mkdir -p $@
 
+# TODO make sure the headers are right in these prereqs
+
 lib/darshan-core.o: lib/darshan-core.c darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
 	$(CC) $(CFLAGS) -c $< -o $@
 
+lib/darshan-core.po: lib/darshan-core.c darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
+	$(CC) $(CFLAGS_SHARED) -c $< -o $@
+
 lib/darshan-common.o: lib/darshan-common.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
 	$(CC) $(CFLAGS) -c $< -o $@
 
+lib/darshan-common.po: lib/darshan-common.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
+	$(CC) $(CFLAGS_SHARED) -c $< -o $@
+
 lib/darshan-posix.o: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
 	$(CC) $(CFLAGS) -c $< -o $@
 
-#lib/darshan-posix.po: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
-#	$(CC) $(CFLAGS_SHARED) -c $< -o $@
+lib/darshan-posix.po: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
+	$(CC) $(CFLAGS_SHARED) -c $< -o $@
 
 lib/lookup3.o: lib/lookup3.c
 	$(CC) $(CFLAGS) -c $< -o $@
 
-#lib/lookup3.po: lib/lookup3.c
-#	$(CC) $(CFLAGS_SHARED) -c $< -o $@
+lib/lookup3.po: lib/lookup3.c
+	$(CC) $(CFLAGS_SHARED) -c $< -o $@
 
 lib/lookup8.o: lib/lookup8.c
 	$(CC) $(CFLAGS) -c $< -o $@
 
-#lib/lookup8.po: lib/lookup8.c
-#	$(CC) $(CFLAGS_SHARED) -c $< -o $@
+lib/lookup8.po: lib/lookup8.c
+	$(CC) $(CFLAGS_SHARED) -c $< -o $@
 
+# TODO: huh?
 #%.i: %.c
 #	$(CC) -E $(CFLAGS) -c $< -o $@
 
 lib/libdarshan.a: lib/darshan-posix.o lib/darshan-core.o lib/darshan-common.o lib/lookup3.o lib/lookup8.o
 	ar rcs $@ $^
 
-#lib/libdarshan.so: lib/darshan-mpi-io.po lib/darshan-mpi-init-finalize.po lib/darshan-pnetcdf.po lib/darshan-hdf5.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po
-#	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
+lib/libdarshan.so: lib/darshan-core.po lib/darshan-common.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po
+	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
 
 install:: all
 	install -d $(libdir)
 	install -m 755 lib/libdarshan.a $(libdir)
-#ifndef DISABLE_LDPRELOAD
-#	install -m 755 lib/libdarshan.so $(libdir)
-#endif
+ifndef DISABLE_LDPRELOAD
+	install -m 755 lib/libdarshan.so $(libdir)
+endif
 	install -d $(bindir)
 #	install -m 755 darshan-mk-log-dirs.pl $(bindir)
 	install -m 755 darshan-gen-cc.pl $(bindir)
diff --git a/darshan-runtime/darshan.h b/darshan-runtime/darshan.h
index 8802b8d..f942a25 100644
--- a/darshan-runtime/darshan.h
+++ b/darshan-runtime/darshan.h
@@ -25,9 +25,6 @@
 /* Environment variable to override __CP_MEM_ALIGNMENT */
 #define CP_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"
 
-/* TODO where does this go? */
-#define DARSHAN_MPI_CALL(func) func
-
 struct darshan_module_funcs
 {
     /* disable futher instrumentation within a module */
diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c
index 740394e..12381b2 100644
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -30,6 +30,8 @@
 /* TODO is __progname_full needed here */
 extern char* __progname;
 
+#define DARSHAN_MPI_CALL(func) func
+
 /* internal variable delcarations */
 static struct darshan_core_runtime *darshan_core = NULL;
 static pthread_mutex_t darshan_core_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -255,7 +257,7 @@ static void darshan_core_shutdown()
     final_core = darshan_core;
     darshan_core = NULL;
 
-    /* we also need to set which modules were registerd on this process and
+    /* we also need to set which modules were registered on this process and
      * disable tracing within those modules while we shutdown
      */
     for(i = 0; i < DARSHAN_MAX_MODS; i++)
diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c
index c1e05ea..5da3534 100644
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -3,10 +3,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#define _GNU_SOURCE
-
 #include "darshan-runtime-config.h"
-
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -23,6 +20,7 @@
 #include <assert.h>
 #include <libgen.h>
 #include <aio.h>
+#define __USE_GNU
 #include <pthread.h>
 
 #include "uthash.h"
@@ -36,15 +34,45 @@ typedef int64_t off64_t;
 #define aiocb64 aiocb
 #endif
 
-/* TODO these go where ? */
+#ifdef DARSHAN_PRELOAD
+#define __USE_GNU
+#include <dlfcn.h>
+#include <stdlib.h>
+
+#define DARSHAN_FORWARD_DECL(name,ret,args) \
+  ret (*__real_ ## name)args = NULL;
+
+#define DARSHAN_DECL(__name) __name
+
+#define DARSHAN_MPI_CALL(func) __real_ ## func
+
+#define MAP_OR_FAIL(func) \
+    if (!(__real_ ## func)) \
+    { \
+        __real_ ## func = dlsym(RTLD_NEXT, #func); \
+        if(!(__real_ ## func)) { \
+           fprintf(stderr, "Darshan failed to map symbol: %s\n", #func); \
+           exit(1); \
+       } \
+    }
+
+#else
 
 #define DARSHAN_FORWARD_DECL(name,ret,args) \
   extern ret __real_ ## name args;
 
 #define DARSHAN_DECL(__name) __wrap_ ## __name
 
+#define DARSHAN_MPI_CALL(func) func
+
 #define MAP_OR_FAIL(func)
 
+#endif
+
+DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
+DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
+DARSHAN_FORWARD_DECL(close, int, (int fd));
+
 struct posix_runtime_file
 {
     struct darshan_posix_file* file_record;
@@ -90,12 +118,7 @@ static char* exclusions[] = {
 NULL
 };
 
-DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
-DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
-DARSHAN_FORWARD_DECL(close, int, (int fd));
-
 static void posix_runtime_initialize(void);
-
 static struct posix_runtime_file* posix_file_by_name(const char *name);
 static struct posix_runtime_file* posix_file_by_name_setfd(const char* name, int fd);
 static struct posix_runtime_file* posix_file_by_fd(int fd);
@@ -216,7 +239,7 @@ int DARSHAN_DECL(open64)(const char *path, int flags, ...)
     int ret;
     double tm1, tm2;
 
-    MAP_OR_FAIL(open);
+    MAP_OR_FAIL(open64);
 
     if(flags & O_CREAT)
     {
diff --git a/darshan-util/darshan-logutils.c b/darshan-util/darshan-logutils.c
index 2df035f..0f9661f 100644
--- a/darshan-util/darshan-logutils.c
+++ b/darshan-util/darshan-logutils.c
@@ -362,6 +362,7 @@ int darshan_log_gethash(darshan_fd fd, struct darshan_record_ref **hash)
     }
     free(comp_buf);
 
+    /* TODO: check for duplicate entries? */
     buf_ptr = hash_buf;
     while(buf_ptr < (hash_buf + hash_buf_sz))
     {


hooks/post-receive
--



More information about the Darshan-commits mailing list