From 652d1963af38f21a6060d7adb774407d44ba7247 Mon Sep 17 00:00:00 2001 From: amdkila <47991923+amdkila@users.noreply.github.com> Date: Thu, 28 May 2020 10:34:30 -0600 Subject: [PATCH] Check for error code in install script (#2) [ROCm/rccl-tests commit: 3d6f70659a0356d68d396ae5923e5ef95150b4eb] --- projects/rccl-tests/install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/rccl-tests/install.sh b/projects/rccl-tests/install.sh index 7c8a865ef5..c56a6bfdde 100755 --- a/projects/rccl-tests/install.sh +++ b/projects/rccl-tests/install.sh @@ -67,6 +67,14 @@ while true; do esac done +# throw error code after running a command in the install script +check_exit_code( ) +{ + if (( $1 != 0 )); then + exit $1 + fi +} + # Install the pre-commit hook #bash ./githooks/install @@ -87,6 +95,7 @@ if ($mpi_enabled); then else make NCCL_HOME=${rccl_dir} CUSTOM_RCCL_LIB=${rccl_dir}/lib/librccl.so -j$(nproc) fi +check_exit_code "$?" # Optionally, run tests if they're enabled. if ($run_tests); then