Skip to content

Commit

Permalink
tests: adapt tests for ARM compiler
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Reber <areber@redhat.com>
  • Loading branch information
adrianreber committed Jul 14, 2023
1 parent ac578ce commit b30f03f
Show file tree
Hide file tree
Showing 37 changed files with 147 additions and 41 deletions.
20 changes: 20 additions & 0 deletions tests/common/functions
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ check_compiler_family()
myCC=armclang
myCXX=armclang++
myFC=armflang
elif [[ $LMOD_FAMILY_COMPILER =~ "acfl" ]];then
myCC=armclang
myCXX=armclang++
myFC=armflang
elif [ $LMOD_FAMILY_COMPILER == "gnu" ];then
myCC=gcc
myCXX=g++
Expand Down Expand Up @@ -431,3 +435,19 @@ run_mpi_binary () {

} # end run_mpi_binary()

get_rpm_name () {
local family
if [[ "${LMOD_FAMILY_COMPILER}" =~ "acfl" ]]; then
# The arm compiler package set "acfl".
# OpenHPC expects "arm1".
family="arm1"
else
family="${LMOD_FAMILY_COMPILER}"
fi

if [ -n "${LMOD_FAMILY_MPI}" ]; then
echo "${1}-${family}-${LMOD_FAMILY_MPI}${DELIM}"
else
echo "${1}-${family}${DELIM}"
fi
}
20 changes: 14 additions & 6 deletions tests/compilers/tests/version_match
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,33 @@ family=$LMOD_FAMILY_COMPILER
}

@test "[Compilers] C, C++, and Fortran versions match module ($family)" {
module list $family >& .cmd_output || exit 1
local my_mod_version=`cat .cmd_output | sed '/^\s*$/d' | sed 's/^[ \t]*//' | tail -1 | awk -F "$family/" '{print $2}'`
local my_family
if [[ "$family" =~ "acfl" ]]; then
# The arm compiler package set "acfl".
# OpenHPC expects "arm1".
my_family="arm1"
else
my_family="$family"
fi
module list $my_family >& .cmd_output || exit 1
local my_mod_version=`cat .cmd_output | sed '/^\s*$/d' | sed 's/^[ \t]*//' | tail -1 | awk -F "$my_family/" '{print $2}'`

if [[ "$family" = "intel" ]];then
if [[ "$my_family" = "intel" ]];then
# intel has no consistency here, have to punt
## compiler=`which icc`
## version=`icc --version | head -1 | awk '{print $3}'`
## assert_equal "$my_mod_version" "$version"
version="assuming all is good"
elif [[ "$family" =~ "arm" ]];then
elif [[ "$my_family" =~ "arm1" ]];then
assert_equal "$my_mod_version" "compat"
elif [[ "$family" =~ "gnu" ]];then
elif [[ "$my_family" =~ "gnu" ]];then
version=`gcc --version | head -1 | awk '{print $3}'`
assert_equal "$my_mod_version" "$version"
version=`g++ --version | head -1 | awk '{print $3}'`
assert_equal "$my_mod_version" "$version"
version=`gfortran --version | head -1 | awk '{print $4}'`
assert_equal "$my_mod_version" "$version"
elif [[ "$family" =~ "llvm" ]];then
elif [[ "$my_family" =~ "llvm" ]];then
version=`clang --version | head -1 | awk '{print $3}'`
assert_equal "$my_mod_version" "$version"
version=`clang++ --version | head -1 | awk '{print $3}'`
Expand Down
6 changes: 6 additions & 0 deletions tests/dev-tools/valgrind/tests/rm_execution
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ rm=$RESOURCE_MANAGER
PKG="Valgrind"

@test "[$PKG] Callgrind execution under resource manager ($rm/$LMOD_FAMILY_COMPILER)" {
if [[ "$LMOD_FAMILY_COMPILER" =~ "acfl" ]]; then
skip "arm compiler currently breaks valgrind"
fi
test=simwork
if [ ! -x $test ];then
flunk "$test does not exist"
Expand All @@ -30,6 +33,9 @@ PKG="Valgrind"
}

@test "[$PKG] Memcheck execution under resource manager ($rm/$LMOD_FAMILY_COMPILER)" {
if [[ "$LMOD_FAMILY_COMPILER" =~ "acfl" ]]; then
skip "arm compiler currently breaks valgrind"
fi

# Clean program that should run without incident
if [ ! -x ./hello ];then
Expand Down
9 changes: 3 additions & 6 deletions tests/dev-tools/valgrind/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ check_compiler_family CC CXX FC
}

@test "[$testname] Memcheck compile/test ($LMOD_FAMILY_COMPILER)" {

if [[ "$LMOD_FAMILY_COMPILER" =~ "acfl" ]]; then
skip "arm compiler currently breaks valgrind"
fi
# Clean program that should run without incident
$CC -o hello hello.c
assert_success
Expand All @@ -125,9 +127,4 @@ check_compiler_family CC CXX FC
assert_success
run valgrind -q --error-exitcode=1 ./badfree
assert_failure

# rm ./badfree
# rm ./hello
}


3 changes: 2 additions & 1 deletion tests/libs/adios2/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module=adios2
testname=libs/ADIOS2
library=libadios2
header=adios2.h
rpm=adios2-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

check_rms

Expand All @@ -23,6 +22,8 @@ check_rms
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/boost-mpi/tests/module/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -11,14 +12,15 @@ PKG=BOOST
module=boost
library=libboost_mpi
header=boost/version.hpp
rpm=boost-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

@test "[$PKG] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
6 changes: 5 additions & 1 deletion tests/libs/boost/tests/module/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -11,14 +12,15 @@ PKG=BOOST
module=boost
library=libboost_program_options
header=boost/version.hpp
rpm=boost-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

@test "[$PKG] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down Expand Up @@ -122,6 +124,8 @@ rpm=boost-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}
CXX=icpc
elif [[ $LMOD_FAMILY_COMPILER =~ "gnu" ]];then
CXX=g++
elif [[ $LMOD_FAMILY_COMPILER =~ "acfl" ]];then
CXX=armclang++
else
flunk "Unknown compiler family"
fi
Expand Down
5 changes: 5 additions & 0 deletions tests/libs/hypre/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ if test "x$LMOD_FAMILY_COMPILER" = "xintel"; then
CXXFLAGS="-DHYPRE_TIMING -I ${HYPRE_INC} -I ${MKLROOT}/include ${CXXFLAGS} -fopenmp"
FFLAGS="-I ${HYPRE_INC} -I ${MKLROOT}/include ${FFLAGS}"
LDFLAGS="-L${HYPRE_LIB} -lHYPRE -L$MKLROOT/lib/intel64 -lmkl_rt -lm ${LDFLAGS}"
elif test "x$LMOD_FAMILY_COMPILER" = "xacfl"; then
CFLAGS="-DHYPRE_TIMING -I ${HYPRE_INC} ${CFLAGS}"
CXXFLAGS="-DHYPRE_TIMING -I ${HYPRE_INC} ${CXXFLAGS} -fopenmp"
FFLAGS="-I ${HYPRE_INC} ${FFLAGS}"
LDFLAGS="-L${HYPRE_LIB} -lHYPRE -armpl -lm ${LDFLAGS}"
else
CFLAGS="-DHYPRE_TIMING -I ${HYPRE_INC} ${CFLAGS}"
CXXFLAGS="-DHYPRE_TIMING -I ${HYPRE_INC} ${CXXFLAGS} -fopenmp"
Expand Down
5 changes: 2 additions & 3 deletions tests/libs/hypre/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ module=hypre
testname=libs/HYPRE
library=libHYPRE
header=HYPRE.h
rpm=hypre-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

check_rms

@test "[$testname] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/metis/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -12,14 +13,15 @@ module=metis
testname="libs/Metis"
library=libmetis
header=metis.h
rpm=metis-$LMOD_FAMILY_COMPILER${DELIM}

@test "[$testname] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
3 changes: 2 additions & 1 deletion tests/libs/mfem/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module=mfem
testname=libs/MFEM
library=libmfem
header=mfem.hpp
rpm=mfem-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

check_rms

Expand All @@ -23,6 +22,8 @@ check_rms
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
6 changes: 5 additions & 1 deletion tests/libs/mumps/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ AC_C_CONST

CFLAGS="-I${MUMPS_INC} ${CFLAGS}"
FFLAGS="-I${MUMPS_INC} ${FFLAGS}"
LDFLAGS="-L${MUMPS_LIB}"
LIBS="-lmumps_common"
if test "x$LMOD_FAMILY_COMPILER" = "xacfl"; then
LDFLAGS="-L${MUMPS_LIB} -armpl -lm"
else
LDFLAGS="-L${MUMPS_LIB}"
fi

# Set subdirectories
AC_CONFIG_FILES(Makefile tests/Makefile)
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/mumps/tests/test_module
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!./common/bats/bin/bats
# -*-sh-*-
source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -9,14 +10,15 @@ fi
PKG=MUMPS
module=mumps
family=$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI
rpm=$module-$family${DELIM}

@test "[libs/$PKG] Verify $PKG module is loaded and matches rpm version ($family)" {
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/netcdf/tests/test_CXX_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -12,7 +13,6 @@ module=netcdf-cxx
testname="libs/NetCDF-CXX"
library=libnetcdf_c++4
header=netcdf
rpm=netcdf-cxx-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}
delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"

@test "[$testname] Verify $PKG module is loaded and matches rpm version ($delimiter)" {
Expand All @@ -21,6 +21,8 @@ delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/netcdf/tests/test_C_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -12,7 +13,6 @@ module=netcdf
testname="libs/NetCDF"
library=libnetcdf
header=netcdf.h
rpm=netcdf-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}
delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"

@test "[$testname] Verify $PKG module is loaded and matches rpm version ($delimiter)" {
Expand All @@ -21,6 +21,8 @@ delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
4 changes: 3 additions & 1 deletion tests/libs/netcdf/tests/test_Fortran_module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*-sh-*-

source ./common/test_helper_functions.bash || exit 1
source ./common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
Expand All @@ -12,7 +13,6 @@ module=netcdf-fortran
testname="libs/NetCDF-Fortran"
library=libnetcdff
header=netcdf.inc
rpm=netcdf-fortran-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}
delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"

@test "[$testname] Verify $PKG module is loaded and matches rpm version ($delimiter)" {
Expand All @@ -21,6 +21,8 @@ delimiter="$LMOD_FAMILY_COMPILER/$LMOD_FAMILY_MPI"
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
3 changes: 2 additions & 1 deletion tests/libs/petsc/tests/test_module
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module=petsc
testname=libs/PETSc
library=libpetsc
header=petsc.h
rpm=petsc-$LMOD_FAMILY_COMPILER-$LMOD_FAMILY_MPI${DELIM}

check_rms

Expand All @@ -23,6 +22,8 @@ check_rms
assert_success

# check version against rpm
local rpm
rpm=$(get_rpm_name ${module})
local version="$(rpm -q --queryformat='%{VERSION}\n' $rpm)"
run cat .cmd_output
assert_output " 1) $module/$version"
Expand Down
Loading

0 comments on commit b30f03f

Please sign in to comment.