Skip to content

Commit

Permalink
testsuite: add t3001-mpi-personalities.t
Browse files Browse the repository at this point in the history
Add a set of tests that ensure the shell mpi plugins are working
as designed.

Only minimal testing is enabled at this stage.
  • Loading branch information
grondo committed Sep 20, 2019
1 parent 35a948f commit 3a35f7c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ TESTSCRIPTS = \
t2602-job-shell.t \
t2603-job-shell-initrc.t \
t3000-mpi-basic.t \
t3001-mpi-personalities.t \
t3100-flux-in-flux.t \
t4000-issues-test-driver.t \
t5000-valgrind.t \
Expand Down
52 changes: 52 additions & 0 deletions t/t3001-mpi-personalities.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh
#

test_description="Test that Flux's MPI personalities work"

. `dirname $0`/sharness.sh

SIZE=4
test_under_flux ${SIZE}

run_program() {
local timeout=$1
local nnodes=$2
local ntasks=$3
shift 3
run_timeout $timeout flux srun $OPTS -n${ntasks} -N${nnodes} $*
}

CONF_PMI_LIBRARY_PATH=$(flux getattr conf.pmi_library_path | sed 's|/libpmi.so||')

test_expect_success 'mvapich mpi prepends to LD_LIBRARY_PATH for tasks' '
run_program 5 ${SIZE} ${SIZE} printenv LD_LIBRARY_PATH > mvapich.ld.out &&
result="$(uniq mvapich.ld.out | cut -d: -f1)" &&
echo $result &&
echo $CONF_PMI_LIBRARY_PATH &&
test "$result" = $CONF_PMI_LIBRARY_PATH
'

test_expect_success 'mvapich mpi sets MPIRUN_RANK for tasks' '
run_program 5 ${SIZE} ${SIZE} printenv MPIRUN_RANK \
| sort > mvapich.rank.out &&
test_debug "cat mvapich.rank.out" &&
printf "0\n1\n2\n3\n" > mvapich.rank.expected &&
test_cmp mvapich.rank.expected mvapich.rank.out
'


test_expect_success "intel mpi rewrites I_MPI_MPI_LIBRARY" '
export I_MPI_PMI_LIBRARY="foobar" &&
test_when_finished "unset I_MPI_PMI_LIBRARY" &&
run_program 5 ${SIZE} ${SIZE} printenv I_MPI_PMI_LIBRARY > intel-mpi.set &&
test "$(uniq intel-mpi.set)" = "$(flux getattr conf.pmi_library_path)"
'

test_expect_success "intel mpi only rewrites when necessary" '
echo $I_MPI_PMI_LIBRARY &&
run_program 5 ${SIZE} ${SIZE} printenv | grep I_MPI_PMI_LIBRARY \
| tee intel-mpi.unset &&
test "$(wc -l intel-mpi.unset | cut -f 1 -d " ")" = "0"
'

test_done

0 comments on commit 3a35f7c

Please sign in to comment.