From bc75941283e558e2e05c881800b5e3d041462928 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Thu, 28 Apr 2022 20:43:56 -0500 Subject: [PATCH 1/3] test/configure: probe mpich netmod and define macros Define specific macros so we can have tests specific to certain netmod. --- test/mpi/configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac index 2db4aee4f74..17a80d1c200 100644 --- a/test/mpi/configure.ac +++ b/test/mpi/configure.ac @@ -436,6 +436,26 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[return 1 + MPICH;])], [MPI_IS_MPICH=yes],[MPI_IS_MPICH=no]) AC_MSG_RESULT($MPI_IS_MPICH) +if test "$MPI_IS_MPICH" = "yes" ; then + # probe device and netmod features + cat << EOF > conftest.c +#include "mpi.h" +int main(void) {MPI_Init(0,0);MPI_Finalize();return 0;} +EOF + mpicc -o conftest conftest.c + MPIR_CVAR_DEBUG_SUMMARY=1 ./conftest > conftest.output + + if grep libfabric conftest.output > /dev/null ; then + AC_MSG_NOTICE([Detected MPICH with ch4:ofi netmod]) + AC_DEFINE(MPICH_CH4_OFI, 1, [define if it is mpich with ch4:ofi]) + elif grep UCX conftest.output > /dev/null ; then + AC_MSG_NOTICE([Detected MPICH with ch4:ucx netmod]) + AC_DEFINE(MPICH_CH4_UCX, 1, [define if it is mpich with ch4:ucx]) + fi + + rm conftest conftest.c conftest.output +fi + # First, determine whether we are/can support the language bindings # # Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently From cc116e38522ce0ca9fa94ba028b1c241fe708a41 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Thu, 28 Apr 2022 20:50:40 -0500 Subject: [PATCH 2/3] test: use macro to protect ch4:ofi only tests When MPICH_CH4_OFI is not define, the test reduce to a dummy test. --- .../impls/mpich/threads/pt2pt/multinic_infohints.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c b/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c index a0357629806..4cfc90a6295 100644 --- a/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c +++ b/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c @@ -10,6 +10,17 @@ #include #include +/* This test only works for ch4:ofi */ +#ifndef MPICH_CH4_OFI +int main(int argc, char *argv[]) +{ + int errs = 0; + MTest_Init(&argc, &argv); + MTest_Finalize(errs); + return MTestReturnValue(errs); +} +#else + #define MAX_NICS_SUPPORTED 8 /* Multinic Support: Using pref_close_nic user info hint set */ @@ -268,3 +279,4 @@ int main(int argc, char *argv[]) MTest_Finalize(errs); return MTestReturnValue(errs); } +#endif /* MPICH_CH4_OFI */ From 651df2916030cd69ebe3edc89a4bdaf6cf39afc3 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Fri, 29 Apr 2022 09:47:54 -0500 Subject: [PATCH 3/3] test: enhance runtests to allow macro-skipped tests Some tests are skipped by checking configure macros. Let runtests to recognize special output "Test Skipped" so we can tell from test report whether a test is skipped or actually ran. --- .../mpich/threads/pt2pt/multinic_infohints.c | 8 +++----- test/mpi/runtests | 15 +++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c b/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c index 4cfc90a6295..0e15cad726a 100644 --- a/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c +++ b/test/mpi/impls/mpich/threads/pt2pt/multinic_infohints.c @@ -12,12 +12,10 @@ /* This test only works for ch4:ofi */ #ifndef MPICH_CH4_OFI -int main(int argc, char *argv[]) +int main(void) { - int errs = 0; - MTest_Init(&argc, &argv); - MTest_Finalize(errs); - return MTestReturnValue(errs); + printf("Test Skipped\n"); + return 0; } #else diff --git a/test/mpi/runtests b/test/mpi/runtests index 4f1d8e912e6..b700285bf34 100755 --- a/test/mpi/runtests +++ b/test/mpi/runtests @@ -797,8 +797,9 @@ sub RunMPIProgram { if ($found_error) { &RunTestFailed($test_opt, $inline, $runtime ); - } - else { + } elsif ($inline =~ /Test Skipped/) { + &SkippedTest($test_opt, "missing feature"); + } else { &RunTestPassed($test_opt, $runtime); } &RunPostMsg($test_opt); @@ -992,16 +993,14 @@ sub TestNormal { elsif (/^srun: error: .*: signal: Communication connection failure/) { # skip } - elsif (!/^\s*Test Passed\s*$/ && !/requesting checkpoint\s*$/ && !/checkpoint completed\s*$/) { + elsif (!/^\s*Test (Passed|Skipped)\s*$/ && !/requesting checkpoint\s*$/ && !/checkpoint completed\s*$/) { print STDERR "Unexpected output in $programname: $_"; - if (!$found_error) { - $found_error = 1; - } + $found_error = 1; } } if ($found_noerror == 0) { - print STDERR "Program $programname exited without No Errors\n"; - if (!$found_error) { + if ($inline !~ /Test Skipped/) { + print STDERR "Program $programname exited without No Errors\n"; $found_error = 1; } }