Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/mpi/README
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ mpiexecarg=string : Run the program with string as an argument to mpiexec
env=name=value : Run the program with environment variable "name" given the
value "value"

hasgpu=lib : Setting this flag with a GPU library will allow the test to run
only if `-hasgpu=lib` was passed to runtest. Using `hasgpu=any`
allows the test to run solong as any GPU library was passed in
as a flag.

strict=bool : If bool is false, only build and run the program if
--enable-strictmpi was not used in configuring the test suite.
That is, a line such as
Expand Down
14 changes: 14 additions & 0 deletions test/mpi/bench/testlist.bench
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# performance tests are performed for (senddev, recvdev) \in {host, device}^2
# host->host always runs on non-gpu targets

# latency tests
p2p_latency 2 arg=-senddev=host arg=-recvdev=host resultTest=TestBench
p2p_latency 2 arg=-senddev=host arg=-recvdev=device hasgpu=any resultTest=TestBench
p2p_latency 2 arg=-senddev=device arg=-recvdev=host hasgpu=any resultTest=TestBench
p2p_latency 2 arg=-senddev=device arg=-recvdev=device hasgpu=any resultTest=TestBench

# bw tests
p2p_bw 2 arg=-senddev=host arg=-recvdev=host resultTest=TestBench
p2p_bw 2 arg=-senddev=host arg=-recvdev=device hasgpu=any resultTest=TestBench
p2p_bw 2 arg=-senddev=device arg=-recvdev=host hasgpu=any resultTest=TestBench
p2p_bw 2 arg=-senddev=device arg=-recvdev=device hasgpu=any resultTest=TestBench
3 changes: 3 additions & 0 deletions test/mpi/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ AC_SUBST(cudadir)
AC_ARG_VAR([NVCC], [nvcc compiler to use])
if test "X${pac_have_cuda}" = "Xyes" ; then
AC_DEFINE([HAVE_CUDA],[1],[Define if CUDA is available])
RUNTESTS_OPTS="$RUNTESTS_OPTS -hasgpu=cuda"
have_gpu="yes"
if test -n "${with_cuda}" -a "$with_cuda" != "no" ; then
cuda_CPPFLAGS="-I${with_cuda}/include"
Expand Down Expand Up @@ -837,6 +838,7 @@ if test "$have_gpu" = "no" ; then
ze_LIBS=""
if test "X${pac_have_ze}" = "Xyes" ; then
AC_DEFINE([HAVE_ZE],[1],[Define if ZE is available])
RUNTESTS_OPTS="$RUNTESTS_OPTS -hasgpu=ze"
have_gpu="yes"
if test -n "${with_ze}" -a "$with_ze" != "no" ; then
ze_CPPFLAGS="-I${with_ze}/include"
Expand Down Expand Up @@ -866,6 +868,7 @@ if test "$have_gpu" = "no" ; then
hip_LIBS=""
if test "X$pac_have_hip" = "Xyes" ; then
AC_DEFINE([HAVE_HIP],[1],[Define if HIP is available])
RUNTESTS_OPTS="$RUNTESTS_OPTS -hasgpu=hip"
have_gpu="yes"
if test -n "${with_hip}" -a "$with_hip" != "no" ; then
hip_CPPFLAGS="-I${with_hip}/include"
Expand Down
22 changes: 22 additions & 0 deletions test/mpi/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ $g_opt{memory_total} = 4; # Total memory in GB
$g_opt{memory_multiplier} = 1; # No of simultaneous jobs
$g_opt{cleanup} = 1; # Whether to remove the compiled programs
$g_opt{start_time} = time(); # So we can track accumulative test duration
$g_opt{hasgpu} = {}; # will run tests marked as "hasgpu=<value>"
$g_opt{strict} = 0; # will skip tests marked as "strict=false"
$g_opt{runxfail} = 0; # will run xfailed tests
$g_opt{exeext} = "";
Expand Down Expand Up @@ -227,6 +228,11 @@ if (defined($ENV{'MPITEST_MPIEXECARG'})) {
if (defined($ENV{'MPITEST_SINGLETON'})) {
$g_opt{mpitest_singleton} = $ENV{'MPITEST_SINGLETON'};
}
if (defined($ENV{'MPITEST_HASGPU'})) {
foreach my $lib (split /,\s*/, $ENV{'MPITEST_HASGPU'}) {
$g_opt{hasgpu}{$lib} = 1;
}
}

#---------------------------------------------------------------------------
# Process arguments and override any defaults
Expand All @@ -251,6 +257,7 @@ foreach $_ (@ARGV) {
elsif (/--?batchdir=(.*)/) { $g_opt{batrundir} = $1; }
elsif (/--?batch/) { $g_opt{batchRun} = 1; }
elsif (/--?timeoutarg=(.*)/) { $g_opt{timeoutarg} = $1; }
elsif (/--?hasgpu=(.*)/) { $g_opt{hasgpu}{$1} = 1; }
elsif (/--?strict/) { $g_opt{strict} = 1; }
elsif (/--?runxfail/) { $g_opt{runxfail} = 1; }
elsif (/--?xmlfile=(.*)/) {
Expand Down Expand Up @@ -436,6 +443,8 @@ sub LoadTests {

my $np = "";
my $requiresStrict = "";
my @requiresGPU;
my $hasGPU = 0;

if ($#args >= 1) { $np = $args[1]; }

Expand All @@ -462,6 +471,12 @@ sub LoadTests {
elsif ($key eq "strict") {
$requiresStrict = $value
}
elsif ($key eq "hasgpu") {
push @requiresGPU, $value;
if (exists $g_opt{hasgpu}{$value} or $value eq "any") {
$hasGPU = 1;
}
}
else {
print STDERR "Unrecognized key $key in $listfile_path\n";
}
Expand Down Expand Up @@ -500,6 +515,13 @@ sub LoadTests {
$test_opt->{name} = $2;
}

if (@requiresGPU && !$hasGPU) {
# Skip tests requiring gpu if not explicitly set.
SkippedTest($test_opt, "one of the following gpu libraries
needed, but not provided: " . join(", ", @requiresGPU));
next;
}

# Check whether strict is required by MPI but not by the
# test (use strict=false for tests that use non-standard extensions)
if (lc($requiresStrict) eq "false" && $g_opt{strict}) {
Expand Down