[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-71-g1110d3a

Service Account git at mcs.anl.gov
Thu Mar 26 16:51:19 CDT 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  1110d3a68ddd47537460b6e07f32125188bf6391 (commit)
      from  1592fd9f9c1e2a511fa9a4277f9a148d1b646688 (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 1110d3a68ddd47537460b6e07f32125188bf6391
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Thu Mar 26 16:50:42 2015 -0500

    refactor exclusions list and macros out of modules

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

Summary of changes:
 darshan-runtime/darshan-core.h      |    3 -
 darshan-runtime/darshan.h           |   44 +++++++++++++++++++
 darshan-runtime/lib/darshan-core.c  |   15 ++++++
 darshan-runtime/lib/darshan-mpiio.c |   32 +-------------
 darshan-runtime/lib/darshan-posix.c |   81 ++++++----------------------------
 5 files changed, 75 insertions(+), 100 deletions(-)


Diff of changes:
diff --git a/darshan-runtime/darshan-core.h b/darshan-runtime/darshan-core.h
index 55fb657..1f53307 100644
--- a/darshan-runtime/darshan-core.h
+++ b/darshan-runtime/darshan-core.h
@@ -13,9 +13,6 @@
 
 #include "darshan.h"
 
-/* TODO: this goes where ? -- shared libs */
-#define DARSHAN_MPI_CALL(func) func
-
 #define DARSHAN_CORE_MAX_RECORDS 1024
 
 /* TODO: revisit this default size if we change memory per module */
diff --git a/darshan-runtime/darshan.h b/darshan-runtime/darshan.h
index e9a8f33..c378fb5 100644
--- a/darshan-runtime/darshan.h
+++ b/darshan-runtime/darshan.h
@@ -26,6 +26,47 @@
 /* Environment variable to override __CP_MEM_ALIGNMENT */
 #define CP_MEM_ALIGNMENT_OVERRIDE "DARSHAN_MEMALIGN"
 
+/* macros for declaring wrapper functions and calling MPI routines
+ * consistently regardless of whether static or dynamic linking is used
+ */
+#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
+
+/* macros for manipulating module's counter variables */
+/* NOTE: */
+
 /* module developers provide the following functions to darshan-core */
 struct darshan_module_funcs
 {
@@ -55,6 +96,9 @@ struct darshan_module_funcs
     void (*shutdown)(void);
 };
 
+/* paths that darshan will not trace */
+extern char* darshan_path_exclusions[]; /* defined in lib/darshan-core.c */
+
 /*****************************************************
 * darshan-core functions exported to darshan modules *
 *****************************************************/
diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c
index d62d308..1393b15 100644
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -37,6 +37,21 @@ static pthread_mutex_t darshan_core_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_
 static int my_rank = -1;
 static int nprocs = -1;
 
+/* paths prefixed with the following directories are not traced by darshan */
+char* darshan_path_exclusions[] = {
+"/etc/",
+"/dev/",
+"/usr/",
+"/bin/",
+"/boot/",
+"/lib/",
+"/opt/",
+"/sbin/",
+"/sys/",
+"/proc/",
+NULL
+};
+
 #define DARSHAN_CORE_LOCK() pthread_mutex_lock(&darshan_core_mutex)
 #define DARSHAN_CORE_UNLOCK() pthread_mutex_unlock(&darshan_core_mutex)
 
diff --git a/darshan-runtime/lib/darshan-mpiio.c b/darshan-runtime/lib/darshan-mpiio.c
index 72654b2..76a1bb1 100644
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -28,20 +28,6 @@
 #include "darshan.h"
 #include "darshan-mpiio-log-format.h"
 
-/* TODO: move this stuff to a shared header somewhere */
-#ifdef DARSHAN_PRELOAD
-#define __USE_GNU
-#include <dlfcn.h>
-#include <stdlib.h>
-
-#define DARSHAN_MPI_CALL(func) __real_ ## func
-
-#else
-
-#define DARSHAN_MPI_CALL(func) func
-
-#endif
-
 struct mpiio_runtime_file
 {
     struct darshan_mpiio_file* file_record;
@@ -72,22 +58,6 @@ static pthread_mutex_t mpiio_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER
 static int instrumentation_disabled = 0;
 static int my_rank = -1;
 
-/* TODO: I'm sure these should be applied on all modules */
-/* these are paths that we will not trace */
-static char* exclusions[] = {
-"/etc/",
-"/dev/",
-"/usr/",
-"/bin/",
-"/boot/",
-"/lib/",
-"/opt/",
-"/sbin/",
-"/sys/",
-"/proc/",
-NULL
-};
-
 #define MPIIO_LOCK() pthread_mutex_lock(&mpiio_runtime_mutex)
 #define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex)
 
@@ -323,7 +293,7 @@ static void posix_shutdown(void);
     char* exclude; \
     int tmp_index = 0; \
     if(__ret < 0) break; \
-    while((exclude = exclusions[tmp_index])) { \
+    while((exclude = darshan_path_exclusions[tmp_index])) { \
         if(!(strncmp(exclude, __path, strlen(exclude)))) \
             break; \
         tmp_index++; \
diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c
index 3852a98..a1301d0 100644
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -35,41 +35,6 @@ typedef int64_t off64_t;
 #define aiocb64 aiocb
 #endif
 
-#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
-
 /* TODO: more libc, fgetc, etc etc etc. */
 
 DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
@@ -86,6 +51,20 @@ DARSHAN_FORWARD_DECL(readv, ssize_t, (int fd, const struct iovec *iov, int iovcn
 DARSHAN_FORWARD_DECL(writev, ssize_t, (int fd, const struct iovec *iov, int iovcnt));
 DARSHAN_FORWARD_DECL(close, int, (int fd));
 
+static void posix_runtime_initialize(void);
+static struct posix_file_runtime* posix_file_by_name(const char *name);
+static struct posix_file_runtime* posix_file_by_name_setfd(const char* name, int fd);
+static struct posix_file_runtime* posix_file_by_fd(int fd);
+static void posix_file_close_fd(int fd);
+
+static void posix_disable_instrumentation(void);
+static void posix_prepare_for_reduction(darshan_record_id *shared_recs,
+    int *shared_rec_count, void **send_buf, void **recv_buf, int *rec_size);
+static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
+    int *len, MPI_Datatype *datatype);
+static void posix_get_output_data(void **buffer, int *size);
+static void posix_shutdown(void);
+
 struct posix_file_runtime
 {
     struct darshan_posix_file* file_record;
@@ -119,36 +98,6 @@ static pthread_mutex_t posix_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER
 static int instrumentation_disabled = 0;
 static int my_rank = -1;
 
-/* TODO: I'm sure these should be applied on all modules */
-/* these are paths that we will not trace */
-static char* exclusions[] = {
-"/etc/",
-"/dev/",
-"/usr/",
-"/bin/",
-"/boot/",
-"/lib/",
-"/opt/",
-"/sbin/",
-"/sys/",
-"/proc/",
-NULL
-};
-
-static void posix_runtime_initialize(void);
-static struct posix_file_runtime* posix_file_by_name(const char *name);
-static struct posix_file_runtime* posix_file_by_name_setfd(const char* name, int fd);
-static struct posix_file_runtime* posix_file_by_fd(int fd);
-static void posix_file_close_fd(int fd);
-
-static void posix_disable_instrumentation(void);
-static void posix_prepare_for_reduction(darshan_record_id *shared_recs,
-    int *shared_rec_count, void **send_buf, void **recv_buf, int *rec_size);
-static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
-    int *len, MPI_Datatype *datatype);
-static void posix_get_output_data(void **buffer, int *size);
-static void posix_shutdown(void);
-
 #define POSIX_LOCK() pthread_mutex_lock(&posix_runtime_mutex)
 #define POSIX_UNLOCK() pthread_mutex_unlock(&posix_runtime_mutex)
 
@@ -195,7 +144,7 @@ static void posix_shutdown(void);
     char* exclude; \
     int tmp_index = 0; \
     if(__ret < 0) break; \
-    while((exclude = exclusions[tmp_index])) { \
+    while((exclude = darshan_path_exclusions[tmp_index])) { \
         if(!(strncmp(exclude, __path, strlen(exclude)))) \
             break; \
         tmp_index++; \


hooks/post-receive
--



More information about the Darshan-commits mailing list