From 613a736086de56eaba7c8a06ea131188ae288534 Mon Sep 17 00:00:00 2001 From: David Wootton Date: Tue, 21 Jun 2022 07:31:19 -0400 Subject: [PATCH 1/2] Add Missing MPI_F_XXX C constants Signed-off-by: David Wootton (cherry picked from commit f27c1dea63d869a0baddccdac2408b75fdd3522d) --- ompi/include/mpi.h.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 3e7fe32aeff..45d36f1cd1e 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -529,6 +529,14 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn #define MPI_DISTRIBUTE_NONE 2 /* not distributed */ #define MPI_DISTRIBUTE_DFLT_DARG (-1) /* default distribution arg */ +/* + * Constants for C code to access elements in Fortran MPI status array. + */ +#define MPI_F_STATUS_SIZE OMPI_FORTRAN_STATUS_SIZE /* Size of Fortran MPI status array */ +#define MPI_F_SOURCE 0 /* Index for MPI_SOURCE */ +#define MPI_F_TAG 1 /* Index for MPI_TAG */ +#define MPI_F_ERROR 2 /* Index for MPI_ERROR */ + /* * Since these values are arbitrary to Open MPI, we might as well make * them the same as ROMIO for ease of mapping. These values taken From f27fb8b47e7d428c898576a24518b366e9fe83d8 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 28 Jun 2022 20:54:30 -0400 Subject: [PATCH 2/2] mpi.h.in: update several comments Add some clarifying comments, update some stale comments, and fix some whitespace. No code or logic changes. Signed-off-by: Jeff Squyres (cherry picked from commit d5f871d350e05581b30f6d0e6473ad63b0dd1c10) --- ompi/include/mpi.h.in | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 45d36f1cd1e..0657f7745ef 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -9,7 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2007-2022 Cisco Systems, Inc. All rights reserved * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. @@ -493,6 +493,11 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn /* * Miscellaneous constants + * + * NOTE: Many of the integer constants below *also* appear in + * ompi/include/mpif-values.pl. If you change any of these integer + * values below, make sure to also change the corresponding values in + * mpif-values.pl. */ #define MPI_ANY_SOURCE -1 /* match any source rank */ #define MPI_PROC_NULL -2 /* rank of null process */ @@ -531,9 +536,13 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn /* * Constants for C code to access elements in Fortran MPI status array. + * + * NOTE: The MPI_F_SOURCE, MPI_F_TAG, MPI_F_ERROR are intentionally 1 + * smaller than their Fortran equivalents in mpif-values.pl (because C + * is 0-indexed and Fortran is 1-indexed). */ #define MPI_F_STATUS_SIZE OMPI_FORTRAN_STATUS_SIZE /* Size of Fortran MPI status array */ -#define MPI_F_SOURCE 0 /* Index for MPI_SOURCE */ +#define MPI_F_SOURCE 0 /* Index for MPI_SOURCE */ #define MPI_F_TAG 1 /* Index for MPI_TAG */ #define MPI_F_ERROR 2 /* Index for MPI_ERROR */ @@ -585,7 +594,8 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn * Predefined attribute keyvals * * DO NOT CHANGE THE ORDER WITHOUT ALSO CHANGING THE ORDER IN - * src/attribute/attribute_predefined.c and mpif.h.in. + * ompi/attribute/attribute_predefined.c and mpif-constants.h (which + * is included by mpif.h.in). */ enum { /* MPI-1 */ @@ -699,7 +709,8 @@ enum { /* * Comparison results. Don't change the order of these, the group * comparison functions rely on it. - * Do not change the order of these without also modifying mpif.h.in. + * Do not change the order of these without also modifying + * mpif-values.pl. */ enum { MPI_IDENT, @@ -710,7 +721,8 @@ enum { /* * MPI_Init_thread constants - * Do not change the order of these without also modifying mpif.h.in. + * Do not change the order of these without also modifying + * mpif-values.pl. */ enum { MPI_THREAD_SINGLE, @@ -721,8 +733,8 @@ enum { /* * Datatype combiners. - * Do not change the order of these without also modifying mpif.h.in. - * (see also mpif-common.h.fin). + * Do not change the order of these without also modifying + * mpif-values.pl. */ enum { MPI_COMBINER_NAMED, @@ -774,8 +786,8 @@ enum { /* * Communicator split type constants. - * Do not change the order of these without also modifying mpif.h.in - * (see also mpif-common.h.fin). + * Do not change the order of these without also modifying + * mpif-values.pl. */ enum { MPI_COMM_TYPE_SHARED,