[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2a2-185-g071fd93

Service Account noreply at mpich.org
Fri Feb 27 19:27:33 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 "MPICH primary repository".

The branch, master has been updated
       via  071fd93c51ab7edcc02426967a495ab2bb1cc276 (commit)
       via  78b06634cac587833253fbaacd5a498c46ccee3d (commit)
       via  8ba706d7b5b7bf4699236ceecdefcb96b03541f1 (commit)
       via  e56d9b8f0581770acb05a8aad92e34d25a12c891 (commit)
       via  cc25a421468645c99f0cc5ca8b36b8fa50295875 (commit)
      from  c1df83ef4c7a47cfe4738a48044b00c56deb9761 (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 -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/071fd93c51ab7edcc02426967a495ab2bb1cc276

commit 071fd93c51ab7edcc02426967a495ab2bb1cc276
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Fri Feb 27 13:55:46 2015 -0600

    Add a generic error code MPI_T_ERR_INVALID of MPI-3.1
    
    The error code will be introduced in MPI-3.1. The code is used in
    MPI_T_pvar_read, which has motivated for adding the error code.
    
    See also https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/400
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 230c60c..c78ae17 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -866,12 +866,13 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
 #define MPI_T_ERR_PVAR_NO_WRITE     71  /* Pvar can't be written or reset */
 #define MPI_T_ERR_PVAR_NO_ATOMIC    72  /* Pvar can't be R/W atomically */
 #define MPI_T_ERR_INVALID_NAME      73  /* Name doesn't match */
+#define MPI_T_ERR_INVALID           74  /* Generic error code for MPI_T added in MPI-3.1 */
 
 
 #define MPI_ERR_LASTCODE    0x3fffffff  /* Last valid error code for a 
 					   predefined error class */
 /* WARNING: this is also defined in mpishared.h.  Update both locations */
-#define MPICH_ERR_LAST_CLASS 73     /* It is also helpful to know the
+#define MPICH_ERR_LAST_CLASS 74     /* It is also helpful to know the
 				       last valid class */
 
 #define MPICH_ERR_FIRST_MPIX 100 /* Define a gap here because sock is
diff --git a/src/include/mpishared.h b/src/include/mpishared.h
index 8c73b89..16cf8ed 100644
--- a/src/include/mpishared.h
+++ b/src/include/mpishared.h
@@ -62,7 +62,7 @@
 #include "mpierrs.h"
 
 /* FIXME: This is extracted from mpi.h.in, where it may not be appropriate */
-#define MPICH_ERR_LAST_CLASS 73     /* It is also helpful to know the
+#define MPICH_ERR_LAST_CLASS 74     /* It is also helpful to know the
 				       last valid class */
 
 #include "mpifunc.h"
diff --git a/src/mpi_t/pvar_read.c b/src/mpi_t/pvar_read.c
index 54956ab..de4c718 100644
--- a/src/mpi_t/pvar_read.c
+++ b/src/mpi_t/pvar_read.c
@@ -35,11 +35,11 @@ int MPIR_T_pvar_read_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle,
     int i, mpi_errno = MPI_SUCCESS;
 
     /* Reading a never started pvar, or a stopped and then reset wartermark,
-     * will run into this nasty situation. Wait for an error code to be defined
-     * by the Standard. Currently, use MPI_ERR_OTHER.
+     * will run into this nasty situation. Return a generic MPI_T error code,
+     * which is defined in MPI-3.1.
      */
     if (!MPIR_T_pvar_is_oncestarted(handle)) {
-        mpi_errno = MPI_ERR_OTHER;
+        mpi_errno = MPI_T_ERR_INVALID;
         goto fn_fail;
     }
 

http://git.mpich.org/mpich.git/commitdiff/78b06634cac587833253fbaacd5a498c46ccee3d

commit 78b06634cac587833253fbaacd5a498c46ccee3d
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Fri Feb 27 16:34:07 2015 -0600

    Add a test for the new MPI_T_xxx_get_index() routines
    
    See https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/377
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index bed964d..913d84a 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -911,6 +911,7 @@
 /mpi_t/mpi_t_str
 /mpi_t/mpit_vars
 /mpi_t/cvarwrite
+/mpi_t/getindex
 /perf/allredtrace
 /perf/commcreatep
 /perf/dtpack
diff --git a/test/mpi/mpi_t/Makefile.am b/test/mpi/mpi_t/Makefile.am
index 95088d7..7f6bc88 100644
--- a/test/mpi/mpi_t/Makefile.am
+++ b/test/mpi/mpi_t/Makefile.am
@@ -15,4 +15,5 @@ EXTRA_DIST = testlist
 noinst_PROGRAMS =     \
     mpi_t_str   \
     mpit_vars   \
-    cvarwrite
+    cvarwrite   \
+    getindex
diff --git a/test/mpi/mpi_t/getindex.c b/test/mpi/mpi_t/getindex.c
new file mode 100644
index 0000000..ede43a6
--- /dev/null
+++ b/test/mpi/mpi_t/getindex.c
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* Test MPI_T_xxx_get_index() for cvars, pvars and categories.
+ */
+#include <stdio.h>
+#include "mpi.h"
+
+static int verbose = 0;
+
+int main(int argc, char *argv[])
+{
+    int i;
+    int required, provided, namelen;
+    int num_cvar, num_pvar, num_cat;
+    int cvar_index, pvar_index, cat_index;
+    int pvar_class;
+    char name[128];
+    int errno, errs = 0;
+
+    required = MPI_THREAD_SINGLE;
+    MPI_T_init_thread(required, &provided);
+    MPI_Init(&argc, &argv);
+
+    /* Test MPI_T_cvar_get_index with both valid and bogus names */
+    MPI_T_cvar_get_num(&num_cvar);
+    if (verbose) fprintf(stdout, "%d MPI Control Variables\n", num_cvar);
+    for (i = 0; i < num_cvar; i++) {
+        namelen = sizeof(name);
+        MPI_T_cvar_get_info(i, name, &namelen, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+        if (namelen <= 128) {
+            errno = MPI_T_cvar_get_index(name, &cvar_index);
+            if (errno != MPI_SUCCESS || cvar_index != i) errs++;
+        }
+    }
+    errno = MPI_T_cvar_get_index("AN INVALID CVAR NAME FOR TEST", &cvar_index);
+    if (errno != MPI_T_ERR_INVALID_NAME) errs++;
+
+    if (errs) fprintf(stdout, "Errors found in MPI_T_cvar_get_index\n");
+
+    /* Test MPI_T_pvar_get_index with both valid and bogus names */
+    MPI_T_pvar_get_num(&num_pvar);
+    if (verbose) fprintf(stdout, "%d MPI Performance Variables\n", num_pvar);
+
+    for (i = 0; i < num_pvar; i++) {
+        namelen = sizeof(name);
+        MPI_T_pvar_get_info(i, name, &namelen, NULL, &pvar_class, NULL, NULL, NULL,
+                            NULL, NULL, NULL, NULL, NULL);
+        if (namelen <= 128) {
+            errno = MPI_T_pvar_get_index(name, pvar_class, &pvar_index);
+            if (errno != MPI_SUCCESS || pvar_index != i) errs++;
+        }
+    }
+    errno = MPI_T_pvar_get_index("AN INVALID PVAR NAME FOR TEST", MPI_T_PVAR_CLASS_COUNTER, &cvar_index);
+    if (errno != MPI_T_ERR_INVALID_NAME) errs++;
+    if (errs) fprintf(stdout, "Errors found in MPI_T_cvar_get_index\n");
+
+    /* Test MPI_T_category_get_index with both valid and bogus names */
+    MPI_T_category_get_num(&num_cat);
+    if (verbose) fprintf(stdout, "%d MPI_T categories\n", num_cat);
+    for (i = 0; i < num_cat; i++) {
+        namelen = sizeof(name);
+        MPI_T_category_get_info(i, name, &namelen, NULL, NULL, NULL, NULL, NULL);
+        if (namelen <= 128) {
+            errno = MPI_T_category_get_index(name, &cat_index);
+            if (errno != MPI_SUCCESS || cat_index != i) errs++;
+        }
+    }
+    errno = MPI_T_category_get_index("AN INVALID CATEGORY NAME FOR TEST", &cat_index);
+    if (errno != MPI_T_ERR_INVALID_NAME) errs++;
+    if (errs) fprintf(stdout, "Errors found in MPI_T_cvar_get_index\n");
+
+    MPI_T_finalize();
+    MPI_Finalize();
+
+    if (errs == 0) fprintf(stdout, " No Errors\n");
+    return 0;
+}
diff --git a/test/mpi/mpi_t/testlist b/test/mpi/mpi_t/testlist
index f6e3e6a..752709a 100644
--- a/test/mpi/mpi_t/testlist
+++ b/test/mpi/mpi_t/testlist
@@ -1,3 +1,4 @@
 mpi_t_str 1 mpiversion=3.0
 mpit_vars 1 mpiversion=3.0
 cvarwrite 1 mpiversion=3.0
+getindex  1 mpiversion=3.1

http://git.mpich.org/mpich.git/commitdiff/8ba706d7b5b7bf4699236ceecdefcb96b03541f1

commit 8ba706d7b5b7bf4699236ceecdefcb96b03541f1
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Fri Feb 27 15:01:50 2015 -0600

    Add error names for newly added MPI_T routines
    
    See https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/377
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/src/mpi_t/errnames.txt b/src/mpi_t/errnames.txt
index 1d4ba7f..37c7f3c 100644
--- a/src/mpi_t/errnames.txt
+++ b/src/mpi_t/errnames.txt
@@ -66,3 +66,9 @@
 **mpi_t_category_get_categories %d %d %p: MPI_T_category_get_categories(cat_index=%d, len=%d, indices=%p)
 **mpi_t_category_changed: MPI_T_category_changed failed
 **mpi_t_category_changed %p: MPI_T_category_changed(stamp=%p)
+**mpi_t_cvar_get_index: mpi_t_cvar_get_index failed
+**mpi_t_cvar_get_index %p %p: mpi_t_cvar_get_index(name=%p, cvar_index=%p)
+**mpi_t_pvar_get_index: mpi_t_pvar_get_index failed
+**mpi_t_pvar_get_index %p %d %p: mpi_t_pvar_get_index(name=%p, var_class=%d, pvar_index=%p)
+**mpi_t_category_get_index: mpi_t_category_get_index failed
+**mpi_t_category_get_index %p %p: mpi_t_category_get_index(name=%p, cat_index=%p)

http://git.mpich.org/mpich.git/commitdiff/e56d9b8f0581770acb05a8aad92e34d25a12c891

commit e56d9b8f0581770acb05a8aad92e34d25a12c891
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Fri Feb 27 14:58:06 2015 -0600

    Implement new MPI_T routines to get vars/categories by name
    
    The new routines are defined in upcoming MPI-3.1.
    See https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/377
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/src/mpi_t/Makefile.mk b/src/mpi_t/Makefile.mk
index dd1a0e0..c193ebc 100644
--- a/src/mpi_t/Makefile.mk
+++ b/src/mpi_t/Makefile.mk
@@ -33,7 +33,10 @@ mpi_sources +=                \
         src/mpi_t/pvar_session_free.c   \
         src/mpi_t/pvar_start.c          \
         src/mpi_t/pvar_stop.c           \
-        src/mpi_t/pvar_write.c
+        src/mpi_t/pvar_write.c          \
+        src/mpi_t/cat_get_index.c       \
+        src/mpi_t/cvar_get_index.c      \
+        src/mpi_t/pvar_get_index.c
 
 
 mpi_core_sources += src/mpi_t/mpit.c
diff --git a/src/mpi_t/cat_get_index.c b/src/mpi_t/cat_get_index.c
new file mode 100644
index 0000000..415eaa4
--- /dev/null
+++ b/src/mpi_t/cat_get_index.c
@@ -0,0 +1,89 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+
+/* -- Begin Profiling Symbol Block for routine MPI_T_category_get_index */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPI_T_category_get_index = PMPI_T_category_get_index
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPI_T_category_get_index  MPI_T_category_get_index
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPI_T_category_get_index as PMPI_T_category_get_index
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+   the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPI_T_category_get_index
+#define MPI_T_category_get_index PMPI_T_category_get_index
+#endif /* MPICH_MPI_FROM_PMPI */
+
+#undef FUNCNAME
+#define FUNCNAME MPI_T_category_get_index
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+MPI_T_category_get_index - Get the index of a category
+
+Output Parameters:
+. name - the name of the category (string)
+
+Output Parameters:
+. cat_index - the index of the category (integer)
+
+.N ThreadSafe
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_T_ERR_INVALID_NAME
+.N MPI_T_ERR_NOT_INITIALIZED
+@*/
+int MPI_T_category_get_index(const char *name, int *cat_index)
+{
+    int mpi_errno = MPI_SUCCESS;
+
+    MPID_MPI_STATE_DECL(MPID_STATE_MPI_T_CATEGORY_GET_INDEX);
+    MPIR_ERRTEST_MPIT_INITIALIZED(mpi_errno);
+    MPIR_T_THREAD_CS_ENTER();
+    MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_T_CATEGORY_GET_INDEX);
+
+    /* Validate parameters */
+#   ifdef HAVE_ERROR_CHECKING
+    {
+        MPID_BEGIN_ERROR_CHECKS
+        {
+            MPIR_ERRTEST_ARGNULL(name, "name", mpi_errno);
+            MPIR_ERRTEST_ARGNULL(cat_index, "cat_index", mpi_errno);
+        }
+        MPID_END_ERROR_CHECKS
+    }
+#   endif /* HAVE_ERROR_CHECKING */
+
+    /* ... body of routine ...  */
+
+    name2index_hash_t *hash_entry;
+
+    /* Do hash lookup by the name */
+    HASH_FIND_STR(cat_hash, name, hash_entry);
+    if (hash_entry != NULL) {
+        *cat_index = hash_entry->idx;
+    } else {
+        mpi_errno = MPI_T_ERR_INVALID_NAME;
+        goto fn_fail;
+    }
+
+    /* ... end of body of routine ... */
+
+fn_exit:
+    MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_T_CATEGORY_GET_INDEX);
+    MPIR_T_THREAD_CS_EXIT();
+    return mpi_errno;
+
+fn_fail:
+    goto fn_exit;
+}
diff --git a/src/mpi_t/cvar_get_index.c b/src/mpi_t/cvar_get_index.c
new file mode 100644
index 0000000..c065ea1
--- /dev/null
+++ b/src/mpi_t/cvar_get_index.c
@@ -0,0 +1,89 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+
+/* -- Begin Profiling Symbol Block for routine MPI_T_cvar_get_index */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPI_T_cvar_get_index = PMPI_T_cvar_get_index
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPI_T_cvar_get_index  MPI_T_cvar_get_index
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPI_T_cvar_get_index as PMPI_T_cvar_get_index
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+   the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPI_T_cvar_get_index
+#define MPI_T_cvar_get_index PMPI_T_cvar_get_index
+#endif /* MPICH_MPI_FROM_PMPI */
+
+#undef FUNCNAME
+#define FUNCNAME MPI_T_cvar_get_index
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+MPI_T_cvar_get_index - Get the index of a control variable
+
+Output Parameters:
+. name - name of the control variable (string)
+
+Output Parameters:
+. cvar_index - index of the control variable (integer)
+
+.N ThreadSafe
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_T_ERR_INVALID_NAME
+.N MPI_T_ERR_NOT_INITIALIZED
+@*/
+int MPI_T_cvar_get_index(const char *name, int *cvar_index)
+{
+    int mpi_errno = MPI_SUCCESS;
+
+    MPID_MPI_STATE_DECL(MPID_STATE_MPI_T_CVAR_GET_INDEX);
+    MPIR_ERRTEST_MPIT_INITIALIZED(mpi_errno);
+    MPIR_T_THREAD_CS_ENTER();
+    MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_T_CVAR_GET_INDEX);
+
+    /* Validate parameters */
+#   ifdef HAVE_ERROR_CHECKING
+    {
+        MPID_BEGIN_ERROR_CHECKS
+        {
+            MPIR_ERRTEST_ARGNULL(name, "name", mpi_errno);
+            MPIR_ERRTEST_ARGNULL(cvar_index, "cvar_index", mpi_errno);
+        }
+        MPID_END_ERROR_CHECKS
+    }
+#   endif /* HAVE_ERROR_CHECKING */
+
+    /* ... body of routine ...  */
+
+    name2index_hash_t *hash_entry;
+
+    /* Do hash lookup by the name */
+    HASH_FIND_STR(cvar_hash, name, hash_entry);
+    if (hash_entry != NULL) {
+        *cvar_index = hash_entry->idx;
+    } else {
+        mpi_errno = MPI_T_ERR_INVALID_NAME;
+        goto fn_fail;
+    }
+
+    /* ... end of body of routine ... */
+
+fn_exit:
+    MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_T_CVAR_GET_INDEX);
+    MPIR_T_THREAD_CS_EXIT();
+    return mpi_errno;
+
+fn_fail:
+    goto fn_exit;
+}
diff --git a/src/mpi_t/pvar_get_index.c b/src/mpi_t/pvar_get_index.c
new file mode 100644
index 0000000..b785bea
--- /dev/null
+++ b/src/mpi_t/pvar_get_index.c
@@ -0,0 +1,97 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpiimpl.h"
+
+/* -- Begin Profiling Symbol Block for routine MPI_T_pvar_get_index */
+#if defined(HAVE_PRAGMA_WEAK)
+#pragma weak MPI_T_pvar_get_index = PMPI_T_pvar_get_index
+#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
+#pragma _HP_SECONDARY_DEF PMPI_T_pvar_get_index  MPI_T_pvar_get_index
+#elif defined(HAVE_PRAGMA_CRI_DUP)
+#pragma _CRI duplicate MPI_T_pvar_get_index as PMPI_T_pvar_get_index
+#endif
+/* -- End Profiling Symbol Block */
+
+/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
+   the MPI routines */
+#ifndef MPICH_MPI_FROM_PMPI
+#undef MPI_T_pvar_get_index
+#define MPI_T_pvar_get_index PMPI_T_pvar_get_index
+#endif /* MPICH_MPI_FROM_PMPI */
+
+#undef FUNCNAME
+#define FUNCNAME MPI_T_pvar_get_index
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+/*@
+MPI_T_pvar_get_index - Get the index of a performance variable
+
+Input Parameters:
+. name - the name of the performance variable (string)
+. var_class - the class of the performance variable (integer)
+
+Output Parameters:
+. pvar_index - the index of the performance variable (integer)
+
+.N ThreadSafe
+
+.N Errors
+.N MPI_SUCCESS
+.N MPI_T_ERR_INVALID_NAME
+.N MPI_T_ERR_NOT_INITIALIZED
+@*/
+int MPI_T_pvar_get_index(const char *name, int var_class, int *pvar_index)
+{
+    int mpi_errno = MPI_SUCCESS;
+
+    MPID_MPI_STATE_DECL(MPID_STATE_MPI_T_PVAR_GET_INDEX);
+    MPIR_ERRTEST_MPIT_INITIALIZED(mpi_errno);
+    MPIR_T_THREAD_CS_ENTER();
+    MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_T_PVAR_GET_INDEX);
+
+    /* Validate parameters */
+#   ifdef HAVE_ERROR_CHECKING
+    {
+        MPID_BEGIN_ERROR_CHECKS
+        {
+            MPIR_ERRTEST_ARGNULL(name, "name", mpi_errno);
+            MPIR_ERRTEST_ARGNULL(pvar_index, "pvar_index", mpi_errno);
+            if (var_class < MPIR_T_PVAR_CLASS_FIRST ||
+                var_class >= MPIR_T_PVAR_CLASS_LAST)
+            {
+               mpi_errno = MPI_T_ERR_INVALID_NAME;
+               goto fn_fail;
+            }
+        }
+        MPID_END_ERROR_CHECKS
+    }
+#   endif /* HAVE_ERROR_CHECKING */
+
+    /* ... body of routine ...  */
+
+    int seq = var_class - MPIR_T_PVAR_CLASS_FIRST;
+    name2index_hash_t *hash_entry;
+
+    /* Do hash lookup by the name */
+    HASH_FIND_STR(pvar_hashs[seq], name, hash_entry);
+    if (hash_entry != NULL) {
+        *pvar_index = hash_entry->idx;
+    } else {
+        mpi_errno = MPI_T_ERR_INVALID_NAME;
+        goto fn_fail;
+    }
+
+    /* ... end of body of routine ... */
+
+fn_exit:
+    MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_T_PVAR_GET_INDEX);
+    MPIR_T_THREAD_CS_EXIT();
+    return mpi_errno;
+
+fn_fail:
+    goto fn_exit;
+}

http://git.mpich.org/mpich.git/commitdiff/cc25a421468645c99f0cc5ca8b36b8fa50295875

commit cc25a421468645c99f0cc5ca8b36b8fa50295875
Author: Junchao Zhang <jczhang at mcs.anl.gov>
Date:   Fri Feb 27 14:54:49 2015 -0600

    Add new MPI_T routines and an error code in headers
    
    They are defined in upcoming MPI-3.1.
    See https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/377
    
    Signed-off-by: Antonio J. Pena <apenya at mcs.anl.gov>

diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index b2963d1..230c60c 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -865,12 +865,13 @@ typedef int (MPIX_Grequest_wait_function)(int, void **, double, MPI_Status *);
 #define MPI_T_ERR_PVAR_NO_STARTSTOP 70  /* Pvar can't be started or stopped */
 #define MPI_T_ERR_PVAR_NO_WRITE     71  /* Pvar can't be written or reset */
 #define MPI_T_ERR_PVAR_NO_ATOMIC    72  /* Pvar can't be R/W atomically */
+#define MPI_T_ERR_INVALID_NAME      73  /* Name doesn't match */
 
 
 #define MPI_ERR_LASTCODE    0x3fffffff  /* Last valid error code for a 
 					   predefined error class */
 /* WARNING: this is also defined in mpishared.h.  Update both locations */
-#define MPICH_ERR_LAST_CLASS 72     /* It is also helpful to know the
+#define MPICH_ERR_LAST_CLASS 73     /* It is also helpful to know the
 				       last valid class */
 
 #define MPICH_ERR_FIRST_MPIX 100 /* Define a gap here because sock is
@@ -1530,6 +1531,9 @@ int MPI_T_category_get_cvars(int cat_index, int len, int indices[]);
 int MPI_T_category_get_pvars(int cat_index, int len, int indices[]);
 int MPI_T_category_get_categories(int cat_index, int len, int indices[]);
 int MPI_T_category_changed(int *stamp);
+int MPI_T_cvar_get_index(const char *name, int *cvar_index);
+int MPI_T_pvar_get_index(const char *name, int var_class, int *pvar_index);
+int MPI_T_category_get_index(const char *name, int *cat_index);
 /* End Skip Prototypes */
 
 
@@ -2173,6 +2177,9 @@ int PMPI_T_category_get_cvars(int cat_index, int len, int indices[]);
 int PMPI_T_category_get_pvars(int cat_index, int len, int indices[]);
 int PMPI_T_category_get_categories(int cat_index, int len, int indices[]);
 int PMPI_T_category_changed(int *stamp);
+int PMPI_T_cvar_get_index(const char *name, int *cvar_index);
+int PMPI_T_pvar_get_index(const char *name, int var_class, int *pvar_index);
+int PMPI_T_category_get_index(const char *name, int *cat_index);
 /* End Skip Prototypes */
 
 
diff --git a/src/include/mpishared.h b/src/include/mpishared.h
index 46a6bf1..8c73b89 100644
--- a/src/include/mpishared.h
+++ b/src/include/mpishared.h
@@ -62,7 +62,7 @@
 #include "mpierrs.h"
 
 /* FIXME: This is extracted from mpi.h.in, where it may not be appropriate */
-#define MPICH_ERR_LAST_CLASS 72     /* It is also helpful to know the
+#define MPICH_ERR_LAST_CLASS 73     /* It is also helpful to know the
 				       last valid class */
 
 #include "mpifunc.h"

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

Summary of changes:
 src/include/mpi.h.in       |   10 ++++-
 src/include/mpishared.h    |    2 +-
 src/mpi_t/Makefile.mk      |    5 ++-
 src/mpi_t/cat_get_index.c  |   89 ++++++++++++++++++++++++++++++++++++++++
 src/mpi_t/cvar_get_index.c |   89 ++++++++++++++++++++++++++++++++++++++++
 src/mpi_t/errnames.txt     |    6 +++
 src/mpi_t/pvar_get_index.c |   97 ++++++++++++++++++++++++++++++++++++++++++++
 src/mpi_t/pvar_read.c      |    6 +-
 test/mpi/.gitignore        |    1 +
 test/mpi/mpi_t/Makefile.am |    3 +-
 test/mpi/mpi_t/getindex.c  |   81 ++++++++++++++++++++++++++++++++++++
 test/mpi/mpi_t/testlist    |    1 +
 12 files changed, 383 insertions(+), 7 deletions(-)
 create mode 100644 src/mpi_t/cat_get_index.c
 create mode 100644 src/mpi_t/cvar_get_index.c
 create mode 100644 src/mpi_t/pvar_get_index.c
 create mode 100644 test/mpi/mpi_t/getindex.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list