[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-61-g64d9f79
Service Account
git at mcs.anl.gov
Tue Mar 24 19:41:30 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 64d9f7962af76ea6782347d008f428bd92fd6fba (commit)
from 5ae8039b11deea5fe88140bb9dba0c496521a62d (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 64d9f7962af76ea6782347d008f428bd92fd6fba
Author: Phil Carns <carns at mcs.anl.gov>
Date: Tue Mar 24 20:41:21 2015 -0400
stub in mpiio module
-----------------------------------------------------------------------
Summary of changes:
darshan-runtime/Makefile.in | 10 ++-
.../lib/{darshan-posix.c => darshan-mpiio.c} | 134 +++++++++++++-------
2 files changed, 94 insertions(+), 50 deletions(-)
copy darshan-runtime/lib/{darshan-posix.c => darshan-mpiio.c} (86%)
Diff of changes:
diff --git a/darshan-runtime/Makefile.in b/darshan-runtime/Makefile.in
index 83a1591..ee650f0 100644
--- a/darshan-runtime/Makefile.in
+++ b/darshan-runtime/Makefile.in
@@ -51,6 +51,12 @@ lib/darshan-posix.o: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
lib/darshan-posix.po: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
+lib/darshan-mpiio.o: lib/darshan-mpiio.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
+ $(CC) $(CFLAGS) -c $< -o $@
+
+lib/darshan-mpiio.po: lib/darshan-mpiio.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
+ $(CC) $(CFLAGS_SHARED) -c $< -o $@
+
lib/lookup3.o: lib/lookup3.c
$(CC) $(CFLAGS) -c $< -o $@
@@ -66,10 +72,10 @@ lib/lookup8.po: lib/lookup8.c
#%.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
+lib/libdarshan.a: lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-core.o lib/darshan-common.o lib/lookup3.o lib/lookup8.o
ar rcs $@ $^
-lib/libdarshan.so: lib/darshan-core.po lib/darshan-common.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po
+lib/libdarshan.so: lib/darshan-core.po lib/darshan-common.po lib/darshan-posix.po lib/darshan-mpiio.po lib/lookup3.po lib/lookup8.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
install:: all
diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-mpiio.c
similarity index 86%
copy from darshan-runtime/lib/darshan-posix.c
copy to darshan-runtime/lib/darshan-mpiio.c
index 0a5ae13..489acd3 100644
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -25,81 +25,49 @@
#include "uthash.h"
#include "darshan.h"
-#include "darshan-posix-log-format.h"
-
-#ifndef HAVE_OFF64_T
-typedef int64_t off64_t;
-#endif
-#ifndef HAVE_AIOCB64
-#define aiocb64 aiocb
-#endif
+#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_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 mpiio_runtime_file
{
- struct darshan_posix_file* file_record;
+ struct darshan_mpiio_file* file_record;
UT_hash_handle hlink;
};
-struct posix_runtime_file_ref
+struct mpiio_runtime_file_ref
{
- struct posix_runtime_file* file;
+ struct mpiio_runtime_file* file;
int fd;
UT_hash_handle hlink;
};
-struct posix_runtime
+struct mpiio_runtime
{
- struct posix_runtime_file* file_runtime_array;
- struct darshan_posix_file* file_record_array;
+ struct mpiio_runtime_file* file_runtime_array;
+ struct darshan_mpiio_file* file_record_array;
int file_array_size;
int file_array_ndx;
- struct posix_runtime_file* file_hash;
- struct posix_runtime_file_ref* fd_hash;
+ struct mpiio_runtime_file* file_hash;
+ struct mpiio_runtime_file_ref* fd_hash;
void *red_buf;
int shared_rec_count;
};
-static struct posix_runtime *posix_runtime = NULL;
-static pthread_mutex_t posix_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+static struct mpiio_runtime *mpiio_runtime = NULL;
+static pthread_mutex_t mpiio_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static int instrumentation_disabled = 0;
static int my_rank = -1;
@@ -119,6 +87,77 @@ static char* exclusions[] = {
NULL
};
+#define MPIIO_LOCK() pthread_mutex_lock(&mpiio_runtime_mutex)
+#define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex)
+
+#ifdef HAVE_MPIIO_CONST
+int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh)
+#else
+int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh)
+#endif
+{
+ int ret;
+ struct darshan_file_runtime* file;
+ char* tmp;
+ int comm_size;
+ double tm1, tm2;
+
+ tm1 = darshan_core_wtime();
+ ret = DARSHAN_MPI_CALL(PMPI_File_open)(comm, filename, amode, info, fh);
+ tm2 = darshan_core_wtime();
+
+ if(ret == MPI_SUCCESS)
+ {
+ MPIIO_LOCK();
+ /* TODO: initialize fn */
+
+ /* use ROMIO approach to strip prefix if present */
+ /* strip off prefix if there is one, but only skip prefixes
+ * if they are greater than length one to allow for windows
+ * drive specifications (e.g. c:\...)
+ */
+ tmp = strchr(filename, ':');
+ if (tmp > filename + 1) {
+ filename = tmp + 1;
+ }
+
+ /* TODO: record statistics */
+ printf("HELLO WORLD!\n");
+
+#if 0
+ file = darshan_file_by_name_setfh(filename, (*fh));
+ if(file)
+ {
+ CP_SET(file, CP_MODE, amode);
+ CP_F_INC_NO_OVERLAP(file, tm1, tm2, file->last_mpi_meta_end, CP_F_MPI_META_TIME);
+ if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0)
+ CP_F_SET(file, CP_F_OPEN_TIMESTAMP,
+ tm1);
+ DARSHAN_MPI_CALL(PMPI_Comm_size)(comm, &comm_size);
+ if(comm_size == 1)
+ {
+ CP_INC(file, CP_INDEP_OPENS, 1);
+ }
+ else
+ {
+ CP_INC(file, CP_COLL_OPENS, 1);
+ }
+ if(info != MPI_INFO_NULL)
+ {
+ CP_INC(file, CP_HINTS, 1);
+ }
+ }
+#endif
+
+ MPIIO_UNLOCK();
+ }
+
+ return(ret);
+}
+
+
+
+#if 0
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);
@@ -133,9 +172,6 @@ static void posix_reduce_records(void* infile_v, void* inoutfile_v,
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)
-
#define POSIX_SET(__file, __counter, __value) do {\
(__file)->file_record->counters[__counter] = __value; \
} while(0)
@@ -647,6 +683,8 @@ static void posix_shutdown()
return;
}
+#endif
+
/*
* Local variables:
* c-indent-level: 4
hooks/post-receive
--
More information about the Darshan-commits
mailing list