Merge pull request #49 from Yiltan/unit-tests-driver-bug
driver should now return a fail code if any of the mpirun's fail
[ROCm/rocshmem commit: 308816bc5e]
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
|
||||
set -e
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
driver_return_status=0
|
||||
|
||||
if [ $# -eq 0 ] ; then
|
||||
echo "This script must be run with at least 2 arguments."
|
||||
echo 'Usage: ${0} argument1 argument2 [argument3]'
|
||||
@@ -35,6 +37,7 @@ check() {
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed $1" >&2
|
||||
driver_return_status=1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -579,4 +582,4 @@ case $2 in
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $?
|
||||
exit $(($driver_return_status || $?))
|
||||
|
||||
@@ -16,13 +16,14 @@ function display_help {
|
||||
}
|
||||
|
||||
# Validate number of arguments for each mode
|
||||
if [[ "$#" -lt 2 ]] ||
|
||||
if [[ "$#" -lt 2 ]] ||
|
||||
{ [[ "$2" == "all" ]] && [[ "$#" -ne 2 ]]; } ||
|
||||
{ [[ "$2" == "custom" ]] && [[ "$#" -ne 4 ]]; }; then
|
||||
display_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
driver_return_status=0
|
||||
binary_name=$1
|
||||
mode=$2
|
||||
timestamp=$(date "+%Y-%m-%d-%H:%M:%S")
|
||||
@@ -32,15 +33,24 @@ log_file="unit_tests_${timestamp}.log"
|
||||
function run_mpirun {
|
||||
local np=$1
|
||||
local gtest_filter=$2
|
||||
echo "mpirun -np $np $binary_name --gtest_filter='$gtest_filter'" | tee -a "$log_file"
|
||||
mpirun -np "$np" "$binary_name" --gtest_filter="$gtest_filter" >> "$log_file" 2>&1
|
||||
cmd_str="mpirun -np $np $binary_name --gtest_filter=$gtest_filter >> $log_file 2>&1"
|
||||
echo $cmd_str
|
||||
eval $cmd_str
|
||||
|
||||
# Test if mpirun failed
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "FAILED: $cmd_str" >&2
|
||||
cat $log_file
|
||||
driver_return_status=1
|
||||
fi
|
||||
}
|
||||
|
||||
# Processing modes
|
||||
case $mode in
|
||||
all)
|
||||
run_mpirun 4 "-IPCImplSimpleCoarseTestFixture.*:IPCImplSimpleFineTestFixture.*"
|
||||
run_mpirun 2 "IPCImplSimpleCoarseTestFixture.*:IPCImplSimpleFineTestFixture.*"
|
||||
run_mpirun 4 "-IPCImplSimpleCoarseTestFixture/*:IPCImplSimpleFineTestFixture.*"
|
||||
run_mpirun 2 "IPCImplSimpleCoarseTestFixture/*:IPCImplSimpleFineTestFixture.*"
|
||||
;;
|
||||
custom)
|
||||
# Check if ranks is a positive integer
|
||||
@@ -60,3 +70,4 @@ esac
|
||||
|
||||
echo "Tests Completed"
|
||||
echo "log file: '$log_file'"
|
||||
exit $driver_return_status
|
||||
|
||||
@@ -115,6 +115,10 @@ target_link_libraries(
|
||||
###############################################################################
|
||||
# GTEST DEPENDENCY
|
||||
###############################################################################
|
||||
# These packages are required for the unit tests
|
||||
find_package(rocprim REQUIRED CONFIG PATHS "${ROCM_PATH}/include/rocprim")
|
||||
find_package(rocthrust REQUIRED CONFIG PATHS "${ROCM_PATH}/include/rocthrust")
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
@@ -135,4 +139,5 @@ target_link_libraries(
|
||||
PRIVATE
|
||||
gtest
|
||||
gtest_main
|
||||
roc::rocthrust
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user