-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test all permutations of MPI_Status conversion functions. See MPI-4:18.2.5 for a handy diagram that explains all the MPI_Status conversion functions and what they need to do. Signed-off-by: Jeff Squyres <[email protected]>
- Loading branch information
Showing
8 changed files
with
973 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Makefile | ||
Makefile.in | ||
aclocal.m4 | ||
autom4te.cache | ||
config.log | ||
config.status | ||
config | ||
configure | ||
|
||
.deps | ||
.libs | ||
|
||
*.o | ||
|
||
src/status_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
SUBDIRS = src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Test MPI_Status conversion functions | ||
|
||
MPI-4:18.2.5 has a good diagram showing all the possible conversion | ||
functions for an MPI_Status. We need to test each edge in that | ||
diagram. | ||
|
||
``` | ||
MPI_Status | ||
/ ^ \ ^ | ||
C types and / / \ \ | ||
functions / / \ \ | ||
(1)/ /(2) (3)\ \(4) | ||
/ / (5) \ \ | ||
/ / <-------- ' \ | ||
MPI_F08_status ' --------------> \ MPI_Fint array | ||
(6) | ||
(7) | ||
TYPE(MPI_Status) <-------------- INTEGER array of size | ||
--------------> MPI_STATUS_SIZE (in Fortran) | ||
(8) | ||
``` | ||
|
||
1. MPI_Status_c2f08() | ||
1. MPI_Status_f082c() | ||
1. MPI_Status_c2f() | ||
1. MPI_Status_f2c() | ||
1. MPI_Status_f2f08() (in C) | ||
1. MPI_Status_f082f() (in C) | ||
1. MPI_Status_f2f08() (in Fortran) | ||
1. In the `mpi` module | ||
1. In the `mpi_f08` module | ||
1. MPI_Status_f082f() (in Fortran) | ||
1. In the `mpi` module | ||
1. In the `mpi_f08` module | ||
|
||
By transitive property, if we test each leg in the above diagram, then | ||
we effectively certify the conversion journey of a status across any | ||
combination of the legs in the diagram (i.e., any possible correct | ||
status conversion). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
: | ||
autoreconf -ivf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
# -*- shell-script -*- | ||
# | ||
# Copyright (c) 2012-2020 Cisco Systems, Inc. All rights reserved. | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
dnl | ||
dnl Init autoconf | ||
dnl | ||
|
||
AC_PREREQ([2.67]) | ||
AC_INIT([mpi-status-test], [1.0], [http://www.open-mpi.org]) | ||
AC_CONFIG_AUX_DIR([config]) | ||
AC_CONFIG_MACRO_DIR([config]) | ||
AC_CONFIG_SRCDIR([.]) | ||
|
||
echo "Configuring MPI_Status test" | ||
|
||
AM_INIT_AUTOMAKE([1.11 foreign -Wall -Werror]) | ||
|
||
# If Automake supports silent rules, enable them. | ||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
|
||
AH_TOP([/* -*- c -*- | ||
* | ||
* MPI_Status test suite configuation header file. | ||
* See the top-level LICENSE file for license and copyright | ||
* information. | ||
*/ | ||
|
||
#ifndef MPI_STATUS_TEST_CONFIG_H | ||
#define MPI_STATUS_TEST_CONFIG_H | ||
]) | ||
AH_BOTTOM([#endif /* MPI_STATUS_TEST_CONFIG_H */]) | ||
|
||
dnl | ||
dnl Make automake clean emacs ~ files for "make clean" | ||
dnl | ||
|
||
CLEANFILES="*~" | ||
AC_SUBST(CLEANFILES) | ||
|
||
dnl | ||
dnl Get various programs | ||
dnl Bias towards mpicc/mpic++/mpif77 | ||
dnl C compiler | ||
dnl | ||
|
||
if test "$CC" != ""; then | ||
BASE="`basename $CC`" | ||
else | ||
BASE= | ||
fi | ||
if test "$BASE" = "" -o "$BASE" = "." -o "$BASE" = "cc" -o \ | ||
"$BASE" = "gcc" -o "$BASE" = "xlc" -o "$BASE" = "pgcc" -o \ | ||
"$BASE" = "icc"; then | ||
AC_CHECK_PROG(HAVE_MPICC, mpicc, yes, no) | ||
if test "$HAVE_MPICC" = "yes"; then | ||
CC=mpicc | ||
export CC | ||
fi | ||
fi | ||
|
||
CFLAGS_save=$CFLAGS | ||
AC_PROG_CC | ||
CFLAGS=$CFLAGS_save | ||
|
||
dnl | ||
dnl Fortran compiler | ||
dnl | ||
|
||
if test "$FC" != ""; then | ||
BASE="`basename $FC`" | ||
else | ||
BASE= | ||
fi | ||
if test "$BASE" = "" -o "$BASE" = "." -o "$BASE" = "f77" -o \ | ||
"$BASE" = "g77" -o "$BASE" = "f90" -o "$BASE" = "g90" -o \ | ||
"$BASE" = "xlf" -o "$BASE" = "ifc" -o "$BASE" = "pgf77"; then | ||
AC_CHECK_PROG(HAVE_MPIFORT, mpifort, yes, no) | ||
AS_IF([test "$HAVE_MPIFORT" = "yes"], | ||
[FC=mpifort], | ||
[AC_CHECK_PROG([HAVE_MPIF90], mpif90, yes, no) | ||
AS_IF([test "$HAVE_MPIF90" = "yes"], | ||
[FC=mpif90], | ||
[AC_CHECK_PROG([HAVE_MPIF77], mpif77, yes, no) | ||
AS_IF([test "$HAVE_MPIF77" = "yes"], | ||
[FC=mpif77], | ||
[AC_MSG_WARN([Cannot find a suitable MPI compiler]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
]) | ||
]) | ||
export FC | ||
fi | ||
|
||
FCFLAGS_save=$FCFLAGS | ||
AC_PROG_FC | ||
FCFLAGS=$FCFLAGS_save | ||
|
||
dnl | ||
dnl Because these are meant to be used for debugging, after all | ||
dnl | ||
|
||
if test -z "$CFLAGS"; then | ||
CFLAGS="-g" | ||
fi | ||
if test -z "$FCFLAGS"; then | ||
FCFLAGS="-g"; | ||
fi | ||
AC_SUBST(FCFLAGS) | ||
if test -z "$FFLAGS"; then | ||
FFLAGS="-g"; | ||
fi | ||
AC_SUBST(FFLAGS) | ||
|
||
dnl | ||
dnl Ensure that we can compile and link a C MPI program | ||
dnl | ||
|
||
AC_LANG_PUSH([C]) | ||
AC_CHECK_HEADERS(mpi.h) | ||
|
||
AC_MSG_CHECKING([if linking MPI program works]) | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpi.h> | ||
]], | ||
[[MPI_Comm a = MPI_COMM_WORLD]])], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([Simple MPI program fails to link]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
AC_LANG_POP([C]) | ||
|
||
dnl | ||
dnl Make sure we have the C type MPI_F08_status | ||
dnl | ||
|
||
AC_CHECK_TYPES([MPI_F08_status], [], | ||
[AC_MSG_WARN([Cannot find MPI_F08_status type]) | ||
AC_MSG_ERROR([Cannot continue])], | ||
[#include <mpi.h>]) | ||
|
||
dnl | ||
dnl Check for the different Fortran bindings | ||
dnl | ||
|
||
AC_LANG_PUSH([Fortran]) | ||
|
||
AC_MSG_CHECKING([for mpif.h]) | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM(, | ||
[[ include 'mpif.h' | ||
integer a | ||
a = MPI_COMM_WORLD]])], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([Cannot compile an mpif.h program]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
|
||
AC_MSG_CHECKING([for mpi module]) | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM(, | ||
[[ use mpi | ||
integer a | ||
a = MPI_COMM_WORLD]])], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([Cannot compile a 'use mpi' program]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
|
||
AC_MSG_CHECKING([for mpi_f08 module]) | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM(, | ||
[[ use mpi_f08 | ||
Type(MPI_Comm) :: a | ||
a = MPI_COMM_WORLD]])], | ||
[AC_MSG_RESULT([yes])], | ||
[AC_MSG_RESULT([no]) | ||
AC_MSG_WARN([Cannot compile a 'use mpi_f08' program]) | ||
AC_MSG_ERROR([Cannot continue]) | ||
]) | ||
|
||
AC_LANG_POP([Fortran]) | ||
|
||
dnl | ||
dnl Party on | ||
dnl | ||
|
||
AC_CONFIG_FILES([ | ||
Makefile | ||
src/Makefile | ||
]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved | ||
# | ||
# $COPYRIGHT$ | ||
# | ||
|
||
noinst_PROGRAMS = status_test | ||
|
||
status_test_SOURCES = \ | ||
status_fortran.F90 \ | ||
status_c.c |
Oops, something went wrong.