diff --git a/ompi/mpi/c/init.c b/ompi/mpi/c/init.c index 0c2ee9ff44..aff8547c1a 100644 --- a/ompi/mpi/c/init.c +++ b/ompi/mpi/c/init.c @@ -5,7 +5,7 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. @@ -20,6 +20,7 @@ #include +#include "opal/util/show_help.h" #include "ompi/mpi/c/bindings.h" #include "ompi/constants.h" @@ -44,12 +45,18 @@ int MPI_Init(int *argc, char ***argv) /* Ensure that we were not already initialized or finalized */ if (ompi_mpi_finalized) { - /* JMS show_help */ + if (0 == ompi_comm_rank(MPI_COMM_WORLD)) { + opal_show_help("help-mpi-api.txt", "mpi-function-after-finalize", + true, FUNC_NAME); + } return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM, MPI_ERR_OTHER, FUNC_NAME); } else if (ompi_mpi_initialized) { - /* JMS show_help */ - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); + if (0 == ompi_comm_rank(MPI_COMM_WORLD)) { + opal_show_help("help-mpi-api.txt", "mpi-initialize-twice", + true, FUNC_NAME); + } + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } /* check for environment overrides for required thread level. If diff --git a/ompi/mpi/c/init_thread.c b/ompi/mpi/c/init_thread.c index 5f93b394c2..870c76368a 100644 --- a/ompi/mpi/c/init_thread.c +++ b/ompi/mpi/c/init_thread.c @@ -5,7 +5,7 @@ * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. @@ -18,6 +18,7 @@ #include "ompi_config.h" +#include "opal/util/show_help.h" #include "ompi/mpi/c/bindings.h" #include "ompi/constants.h" @@ -52,11 +53,17 @@ int MPI_Init_thread(int *argc, char ***argv, int required, /* Ensure that we were not already initialized or finalized */ if (ompi_mpi_finalized) { - /* JMS show_help */ + if (0 == ompi_comm_rank(MPI_COMM_WORLD)) { + opal_show_help("help-mpi-api.txt", "mpi-function-after-finalize", + true, FUNC_NAME); + } return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM, MPI_ERR_OTHER, FUNC_NAME); } else if (ompi_mpi_initialized) { - /* JMS show_help */ + if (0 == ompi_comm_rank(MPI_COMM_WORLD)) { + opal_show_help("help-mpi-api.txt", "mpi-initialize-twice", + true, FUNC_NAME); + } return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/ompi/mpi/help-mpi-api.txt b/ompi/mpi/help-mpi-api.txt index 1dd4ad5650..69ffa6f562 100644 --- a/ompi/mpi/help-mpi-api.txt +++ b/ompi/mpi/help-mpi-api.txt @@ -1,5 +1,7 @@ # -*- text -*- # +# Copyright (c) 2006 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. # Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # @@ -9,6 +11,13 @@ # # This is the US/English general help file for Open MPI. # +[mpi-function-after-finalize] +Calling any MPI-function after calling MPI_Finalize is erroneous. +The only exceptions are MPI_Initialized, MPI_Finalized and MPI_Get_version. + +[mpi-initialize-twice] +Calling MPI_Init or MPI_Init_thread twice is erroneous. + [spawn-from-singleton] This version of Open MPI does not support %s from a "singleton" application. Specifically, you cannot invoke an MPI