#!/bin/bash
set -e

# use only 2 processes for MPI unit tests
NP=2

# but report how many are available, in case there are MPI errors
echo "This system has `nproc` processors available."
echo "${NP} processors are used in MPI tests"

export PRTE_MCA_plm_ssh_agent=/bin/false
export PRTE_MCA_rmaps_default_mapping_policy=":oversubscribe"
export OMPI_MCA_btl_base_warn_component_unused=0

for pyver in `py3versions -sv`; do
  mpirun -n $NP python$pyver -m pytest -v --color=no
done

