[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-63-g43cfa9b

Service Account git at mcs.anl.gov
Tue Mar 24 19:56:04 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  43cfa9bf3b3c49cb32fd3cfba8a9b4324922eefe (commit)
      from  91a27d657ce9f8b2421762039d5308c4dbfbf1d2 (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 43cfa9bf3b3c49cb32fd3cfba8a9b4324922eefe
Author: Phil Carns <carns at mcs.anl.gov>
Date:   Tue Mar 24 20:55:56 2015 -0400

    stub in more mpiio module code

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

Summary of changes:
 darshan-runtime/lib/darshan-mpiio.c |  122 +++++++++++++++++++++++++++++++----
 1 files changed, 109 insertions(+), 13 deletions(-)


Diff of changes:
diff --git a/darshan-runtime/lib/darshan-mpiio.c b/darshan-runtime/lib/darshan-mpiio.c
index b80a3e8..68b6eb0 100644
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -90,6 +90,13 @@ NULL
 #define MPIIO_LOCK() pthread_mutex_lock(&mpiio_runtime_mutex)
 #define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex)
 
+static void mpiio_runtime_initialize(void);
+static void mpiio_disable_instrumentation(void);
+static void mpiio_shutdown(void);
+static void mpiio_get_output_data(
+    void **buffer,
+    int *size);
+
 #ifdef HAVE_MPIIO_CONST
 int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh) 
 #else
@@ -155,16 +162,116 @@ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_F
     return(ret);
 }
 
+static void mpiio_runtime_initialize()
+{
+    int ret;
+    int mem_limit;
+    struct darshan_module_funcs mpiio_mod_fns =
+    {
+        .disable_instrumentation = &mpiio_disable_instrumentation,
+        .prepare_for_reduction = NULL,
+        .reduce_records = NULL,
+        .get_output_data = &mpiio_get_output_data,
+        .shutdown = &mpiio_shutdown
+    };
+
+    /* don't do anything if already initialized or instrumenation is disabled */
+    if(mpiio_runtime || instrumentation_disabled)
+        return;
+
+    /* register the mpiio module with darshan core */
+    darshan_core_register_module(
+        DARSHAN_MPIIO_MOD,
+        &mpiio_mod_fns,
+        &mem_limit);
+
+    /* return if no memory assigned by darshan core */
+    if(mem_limit == 0)
+        return;
+
+    mpiio_runtime = malloc(sizeof(*mpiio_runtime));
+    if(!mpiio_runtime)
+        return;
+    memset(mpiio_runtime, 0, sizeof(*mpiio_runtime));
+
+    /* set maximum number of file records according to max memory limit */
+    /* NOTE: maximum number of records is based on the size of a mpiio file record */
+    mpiio_runtime->file_array_size = mem_limit / sizeof(struct darshan_mpiio_file);
+    mpiio_runtime->file_array_ndx = 0;
+
+    /* allocate array of runtime file records */
+    mpiio_runtime->file_runtime_array = malloc(mpiio_runtime->file_array_size *
+                                               sizeof(struct mpiio_runtime_file));
+    mpiio_runtime->file_record_array = malloc(mpiio_runtime->file_array_size *
+                                              sizeof(struct darshan_mpiio_file));
+    if(!mpiio_runtime->file_runtime_array || !mpiio_runtime->file_record_array)
+    {
+        mpiio_runtime->file_array_size = 0;
+        return;
+    }
+    memset(mpiio_runtime->file_runtime_array, 0, mpiio_runtime->file_array_size *
+           sizeof(struct mpiio_runtime_file));
+    memset(mpiio_runtime->file_record_array, 0, mpiio_runtime->file_array_size *
+           sizeof(struct darshan_mpiio_file));
+
+    /* TODO: can we move this out of here? perhaps register_module returns rank? */
+    DARSHAN_MPI_CALL(PMPI_Comm_rank)(MPI_COMM_WORLD, &my_rank);
+
+    return;
+}
+
+static void mpiio_disable_instrumentation()
+{
+    assert(mpiio_runtime);
+
+    MPIIO_LOCK();
+    instrumentation_disabled = 1;
+    MPIIO_UNLOCK();
+
+    return;
+}
+
+static void mpiio_get_output_data(
+    void **buffer,
+    int *size)
+{
+    assert(mpiio_runtime);
+
+    /* TODO: clean up reduction stuff */
+
+    *buffer = (void *)(mpiio_runtime->file_record_array);
+    *size = mpiio_runtime->file_array_ndx * sizeof(struct darshan_mpiio_file);
+
+    return;
+}
+
+static void mpiio_shutdown()
+{
+    struct mpiio_runtime_file_ref *ref, *tmp;
+
+    HASH_ITER(hlink, mpiio_runtime->fd_hash, ref, tmp)
+    {
+        HASH_DELETE(hlink, mpiio_runtime->fd_hash, ref);
+        free(ref);
+    }
+
+    HASH_CLEAR(hlink, mpiio_runtime->file_hash); /* these entries are freed all at once below */
+
+    free(mpiio_runtime->file_runtime_array);
+    free(mpiio_runtime->file_record_array);
+    free(mpiio_runtime);
+    mpiio_runtime = NULL;
+
+    return;
+}
 
 
 #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);
 static struct posix_runtime_file* 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_reduce_records(void* infile_v, void* inoutfile_v,
@@ -530,17 +637,6 @@ static int posix_file_compare(const void* a, const void* b)
 
 /* ***************************************************** */
 
-static void posix_disable_instrumentation()
-{
-    assert(posix_runtime);
-
-    POSIX_LOCK();
-    instrumentation_disabled = 1;
-    POSIX_UNLOCK();
-
-    return;
-}
-
 static void posix_prepare_for_reduction(
     darshan_record_id *shared_recs,
     int *shared_rec_count,


hooks/post-receive
--



More information about the Darshan-commits mailing list