Skip to content

Commit 448b374

Browse files
authored
Merge pull request #10533 from drwootton/mpif_constants_40x
v4.0.x: Add Missing MPI_F_XXX C constants #10530
2 parents cc4be03 + 61a66cd commit 448b374

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

ompi/include/mpi.h.in

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved
12+
* Copyright (c) 2007-2022 Cisco Systems, Inc. All rights reserved
1313
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
1515
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
@@ -493,6 +493,11 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn
493493

494494
/*
495495
* Miscellaneous constants
496+
*
497+
* NOTE: Many of the integer constants below *also* appear in
498+
* ompi/include/mpif-values.pl. If you change any of these integer
499+
* values below, make sure to also change the corresponding values in
500+
* mpif-values.pl.
496501
*/
497502
#define MPI_ANY_SOURCE -1 /* match any source rank */
498503
#define MPI_PROC_NULL -2 /* rank of null process */
@@ -529,6 +534,18 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn
529534
#define MPI_DISTRIBUTE_NONE 2 /* not distributed */
530535
#define MPI_DISTRIBUTE_DFLT_DARG (-1) /* default distribution arg */
531536

537+
/*
538+
* Constants for C code to access elements in Fortran MPI status array.
539+
*
540+
* NOTE: The MPI_F_SOURCE, MPI_F_TAG, MPI_F_ERROR are intentionally 1
541+
* smaller than their Fortran equivalents in mpif-values.pl (because C
542+
* is 0-indexed and Fortran is 1-indexed).
543+
*/
544+
#define MPI_F_STATUS_SIZE OMPI_FORTRAN_STATUS_SIZE /* Size of Fortran MPI status array */
545+
#define MPI_F_SOURCE 0 /* Index for MPI_SOURCE */
546+
#define MPI_F_TAG 1 /* Index for MPI_TAG */
547+
#define MPI_F_ERROR 2 /* Index for MPI_ERROR */
548+
532549
/*
533550
* Since these values are arbitrary to Open MPI, we might as well make
534551
* them the same as ROMIO for ease of mapping. These values taken
@@ -577,7 +594,8 @@ typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn
577594
* Predefined attribute keyvals
578595
*
579596
* DO NOT CHANGE THE ORDER WITHOUT ALSO CHANGING THE ORDER IN
580-
* src/attribute/attribute_predefined.c and mpif.h.in.
597+
* ompi/attribute/attribute_predefined.c and mpif-constants.h (which
598+
* is included by mpif.h.in).
581599
*/
582600
enum {
583601
/* MPI-1 */
@@ -691,7 +709,8 @@ enum {
691709
/*
692710
* Comparison results. Don't change the order of these, the group
693711
* comparison functions rely on it.
694-
* Do not change the order of these without also modifying mpif.h.in.
712+
* Do not change the order of these without also modifying
713+
* mpif-values.pl.
695714
*/
696715
enum {
697716
MPI_IDENT,
@@ -702,7 +721,8 @@ enum {
702721

703722
/*
704723
* MPI_Init_thread constants
705-
* Do not change the order of these without also modifying mpif.h.in.
724+
* Do not change the order of these without also modifying
725+
* mpif-values.pl.
706726
*/
707727
enum {
708728
MPI_THREAD_SINGLE,
@@ -713,8 +733,8 @@ enum {
713733

714734
/*
715735
* Datatype combiners.
716-
* Do not change the order of these without also modifying mpif.h.in.
717-
* (see also mpif-common.h.fin).
736+
* Do not change the order of these without also modifying
737+
* mpif-values.pl.
718738
*/
719739
enum {
720740
MPI_COMBINER_NAMED,
@@ -766,8 +786,8 @@ enum {
766786

767787
/*
768788
* Communicator split type constants.
769-
* Do not change the order of these without also modifying mpif.h.in
770-
* (see also mpif-common.h.fin).
789+
* Do not change the order of these without also modifying
790+
* mpif-values.pl.
771791
*/
772792
enum {
773793
MPI_COMM_TYPE_SHARED,

0 commit comments

Comments
 (0)