Blame IbaTools/FastFabric/mpiperfdeviation.exp

Packit 857059
# BEGIN_ICS_COPYRIGHT8 ****************************************
Packit 857059
# 
Packit 857059
# Copyright (c) 2015-2017, Intel Corporation
Packit 857059
# 
Packit 857059
# Redistribution and use in source and binary forms, with or without
Packit 857059
# modification, are permitted provided that the following conditions are met:
Packit 857059
# 
Packit 857059
#     * Redistributions of source code must retain the above copyright notice,
Packit 857059
#       this list of conditions and the following disclaimer.
Packit 857059
#     * Redistributions in binary form must reproduce the above copyright
Packit 857059
#       notice, this list of conditions and the following disclaimer in the
Packit 857059
#       documentation and/or other materials provided with the distribution.
Packit 857059
#     * Neither the name of Intel Corporation nor the names of its contributors
Packit 857059
#       may be used to endorse or promote products derived from this software
Packit 857059
#       without specific prior written permission.
Packit 857059
# 
Packit 857059
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 857059
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 857059
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 857059
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit 857059
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 857059
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit 857059
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit 857059
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit 857059
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 857059
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 857059
# 
Packit 857059
# END_ICS_COPYRIGHT8   ****************************************
Packit 857059
Packit 857059
# [ICS VERSION STRING: unknown]
Packit 857059
Packit 857059
source "/usr/lib/opa/tools/ff_function.exp"
Packit 857059
Packit 857059
#=============================================================================#
Packit 857059
# Test Suite Description:
Packit 857059
#-----------------------------------------------------------------------------#
Packit 857059
## mpiperfdeviation
Packit 857059
## -------
Packit 857059
## quick MPI performance verification between each pair of hosts
Packit 857059
#=============================================================================#
Packit 857059
Packit 857059
# manditory setup
Packit 857059
log_user 0;	# disable detailed logging to stdout
Packit 857059
Packit 857059
# uncomment the following to debug the test
Packit 857059
#strace 20
Packit 857059
#log_user 1
Packit 857059
#exp_internal 1
Packit 857059
#cmd_trace on
Packit 857059
#strace 4
Packit 857059
Packit 857059
proc suite_setup {} {
Packit 857059
	# example of conditional setup
Packit 857059
	#test_execute {load populate} {
Packit 857059
		#do some installation or configuration stuff
Packit 857059
	#}
Packit 857059
}
Packit 857059
Packit 857059
proc case_setup {} {
Packit 857059
# setup to do at start of each test case
Packit 857059
# Usage:
Packit 857059
#	pass as argument to start_suite
Packit 857059
# Arguments:
Packit 857059
#	None
Packit 857059
# This procedure will be run at the start of every test case
Packit 857059
# It provides an opportunity for uniform cleanup/setup for each test case
Packit 857059
Packit 857059
	#upvar 2 host host
Packit 857059
Packit 857059
	#host_save_log $host
Packit 857059
}
Packit 857059
Packit 857059
proc case_cleanup { failed } {
Packit 857059
# cleanup to do after each test case
Packit 857059
# Usage:
Packit 857059
#	pass as argument to start_suite
Packit 857059
# Arguments:
Packit 857059
#	failed - set to 1 if test case failed in which case additional
Packit 857059
#		information/files may be desired in test_tmp
Packit 857059
#		set to 0 if test case passed
Packit 857059
# This procedure will be run at the end of every test case
Packit 857059
# It provides an opportunity for uniform cleanup after each test case
Packit 857059
	global env
Packit 857059
Packit 857059
	test_execute {} {
Packit 857059
		if { $failed || [ test_save_temp ] } {
Packit 857059
			# save any logs/results from system(s) under test
Packit 857059
			#upvar host host
Packit 857059
			#host_check_log $host "qmpi"
Packit 857059
		}
Packit 857059
	}
Packit 857059
}
Packit 857059
Packit 857059
test_suite "mpiperfdeviation" "mpi lat/bw deviation" "Quick tests of mpi lat/bw deviation pairs
Packit 857059
of hosts
Packit 857059
File: /usr/lib/opa/tools/mpiperfdeviation.exp" suite_setup noop {
Packit 857059
	global env
Packit 857059
Packit 857059
	# Global Initializations for Test Suite:
Packit 857059
	# --------------------------------------
Packit 857059
Packit 857059
	# ADD ANY GLOBAL INITIALIZATION HERE, SUCH AS:
Packit 857059
	# set env(MY_ENV_VAR) value
Packit 857059
	# also validate the environment
Packit 857059
	# if the environment is bad call fail_suite "information" abort_now
Packit 857059
	# abort_now should be 0 if it is safe to proceed and simply ignore all
Packit 857059
	# test_case calls.  it should be 1 if that is not possible.
Packit 857059
Packit 857059
	# Procedures used to support Test Suite:
Packit 857059
	# --------------------------------------
Packit 857059
Packit 857059
	# The actual test cases:
Packit 857059
	# ----------------------
Packit 857059
Packit 857059
	set full 0
Packit 857059
	# compute host_pairs by taking each pair of hosts from CFG_HOSTS
Packit 857059
	# 1 to 2, 3 to 4, etc.  Thus each hosts bus speed and Ib connect is
Packit 857059
	# verified once
Packit 857059
	set host_pairs {}
Packit 857059
	set num_hosts [llength $env(CFG_HOSTS)]
Packit 857059
	if { $num_hosts < 2 } {
Packit 857059
		fail_suite "Need at least 2 hosts for MPI"
Packit 857059
	}
Packit 857059
Packit 857059
	for { set i 0 } { $i < [ expr $num_hosts] } { incr i 1 } {
Packit 857059
		set host1 [lindex $env(CFG_HOSTS) $i]
Packit 857059
		lappend host_pairs "[ff_host_to_ipoib $host1]"
Packit 857059
	}
Packit 857059
Packit 857059
	# prevent build_mpi_hosts/test_case_run_mpi_app from modifying host name
Packit 857059
	set env(CFG_IPOIB_SUFFIX) ""
Packit 857059
Packit 857059
	set mpitype [determine_mpitype "$env(FF_MPI_APPS_DIR)"]
Packit 857059
Packit 857059
	test_case_run_mpi_app $mpitype default localhost $host_pairs 60 "$env(FF_MPI_APPS_DIR)/deviation" "deviation" "$env(FF_DEVIATION_ARGS)" 1
Packit 857059
}