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 b38571fb59ab8a08a7a75c1057f5015b59931070 (commit) via 120dde4cfd7077c6a70b84ee31e83f669daa8373 (commit) via 449eab8d30a5cee33b78052f10e84a15153972c2 (commit) from 87de5b090b505993b7519cf01900e0fedf3e352f (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/b38571fb59ab8a08a7a75c1057f5015b59... commit b38571fb59ab8a08a7a75c1057f5015b59931070 Author: Lisandro Dalcin <[email protected]> Date: Wed Apr 23 14:34:34 2014 -0500 Deal with empty error class/code strings The standard says a user-defined error code without a string should return "", not NULL. Closes #2067 Signed-off-by: Rob Latham <[email protected]> diff --git a/src/mpi/errhan/dynerrutil.c b/src/mpi/errhan/dynerrutil.c index 943e8c3..2e3bb27 100644 --- a/src/mpi/errhan/dynerrutil.c +++ b/src/mpi/errhan/dynerrutil.c @@ -48,6 +48,7 @@ static const char *(user_class_msgs[ERROR_MAX_NCLASS]) = { 0 }; static const char *(user_code_msgs[ERROR_MAX_NCODE]) = { 0 }; static int first_free_class = 0; static int first_free_code = 1; /* code 0 is reserved */ +static const char empty_error_string[1] = { 0 }; /* Forward reference */ const char *MPIR_Err_get_dynerr_string( int code ); @@ -297,11 +298,13 @@ const char *MPIR_Err_get_dynerr_string( int code ) if (errcode) { if (errcode < first_free_code) { errstr = user_code_msgs[errcode]; + if (!errstr) errstr = empty_error_string; } } else { if (errclass < first_free_class) { errstr = user_class_msgs[errclass]; + if (!errstr) errstr = empty_error_string; } } http://git.mpich.org/mpich.git/commitdiff/120dde4cfd7077c6a70b84ee31e83f669d... commit 120dde4cfd7077c6a70b84ee31e83f669daa8373 Author: Rob Latham <[email protected]> Date: Tue Apr 22 21:34:16 2014 -0500 update errstring2 for MPICH test harness a successful test gives ' No Errors' diff --git a/test/mpi/errhan/errstring2.c b/test/mpi/errhan/errstring2.c index 262491c..5e9761c 100644 --- a/test/mpi/errhan/errstring2.c +++ b/test/mpi/errhan/errstring2.c @@ -1,5 +1,7 @@ #include <stdio.h> #include <mpi.h> +#include <string.h> + int main(int argc, char *argv[]) { int errorclass; @@ -8,8 +10,12 @@ int main(int argc, char *argv[]) MPI_Init(&argc, &argv); MPI_Add_error_class(&errorclass); MPI_Error_string(errorclass, errorstring, &slen); - printf("errorclass:%d errorstring:'%s' len:%d\n", errorclass, + if (strncmp(errorstring, "", 1)) { + fprintf(stderr, "errorclass:%d errorstring:'%s' len:%d\n", errorclass, errorstring, slen); + } else { + printf(" No Errors\n"); + } MPI_Finalize(); return 0; } http://git.mpich.org/mpich.git/commitdiff/449eab8d30a5cee33b78052f10e84a1515... commit 449eab8d30a5cee33b78052f10e84a15153972c2 Author: Lisandro Dalcin <[email protected]> Date: Tue Apr 22 14:31:02 2014 -0500 testcase for MPI_Error_string() The MPI-3 standard says (pp.354, lines 39-40): """ If MPI_ERROR_STRING is called when no string has been set, it will return a empty string (all spaces in Fortran, "" in C). """ RobL added bits to hook into the test infrastrucutre. Signed-off-by: Rob Latham <[email protected]> diff --git a/test/mpi/errhan/Makefile.am b/test/mpi/errhan/Makefile.am index 46e2d49..2d28fa9 100644 --- a/test/mpi/errhan/Makefile.am +++ b/test/mpi/errhan/Makefile.am @@ -18,7 +18,8 @@ noinst_PROGRAMS = \ adderr \ commcall \ errfatal \ - predef_eh + predef_eh \ + errstring2 EXTRA_PROGRAMS = errcode errring errstring diff --git a/test/mpi/errhan/errstring2.c b/test/mpi/errhan/errstring2.c new file mode 100644 index 0000000..262491c --- /dev/null +++ b/test/mpi/errhan/errstring2.c @@ -0,0 +1,15 @@ +#include <stdio.h> +#include <mpi.h> +int main(int argc, char *argv[]) +{ + int errorclass; + char errorstring[MPI_MAX_ERROR_STRING] = {64,0}; + int slen; + MPI_Init(&argc, &argv); + MPI_Add_error_class(&errorclass); + MPI_Error_string(errorclass, errorstring, &slen); + printf("errorclass:%d errorstring:'%s' len:%d\n", errorclass, + errorstring, slen); + MPI_Finalize(); + return 0; +} diff --git a/test/mpi/errhan/testlist b/test/mpi/errhan/testlist index 9bee2b4..8ddc826 100644 --- a/test/mpi/errhan/testlist +++ b/test/mpi/errhan/testlist @@ -3,3 +3,4 @@ commcall 2 errfatal 1 resultTest=TestErrFatal predef_eh 1 predef_eh 2 +errstring2 1 ----------------------------------------------------------------------- Summary of changes: src/mpi/errhan/dynerrutil.c | 3 +++ test/mpi/errhan/Makefile.am | 3 ++- test/mpi/errhan/errstring2.c | 21 +++++++++++++++++++++ test/mpi/errhan/testlist | 1 + 4 files changed, 27 insertions(+), 1 deletions(-) create mode 100644 test/mpi/errhan/errstring2.c hooks/post-receive -- MPICH primary repository