# hpc-testing
# Copyright (C) 2018 SUSE LLC
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

test_mpi()
{
	local flavor=$1
	local host=$2
	local ip1=$3
	local ip2=$4
	export RUN_ARGS=""

	case $flavor in
		openmpi|openmpi2)
			RUN_ARGS="${RUN_ARGS} --allow-run-as-root"
			;;
		openmpi3)
			RUN_ARGS="${RUN_ARGS}  --allow-run-as-root --oversubscribe"
			;;
	esac
	RUN_ARGS="--host $ip1,$ip2 -np 2 ${RUN_ARGS}"
	tp $host "VERBOSE=1 RUN_ARGS='$RUN_ARGS' SHORT=1 /usr/lib64/mpi/gcc/$flavor/tests/runtests.sh"
}
