diff --git a/bin/cuda_memtest.sh b/bin/cuda_memtest.sh index c941df98c3..3aa91af42b 100755 --- a/bin/cuda_memtest.sh +++ b/bin/cuda_memtest.sh @@ -39,8 +39,15 @@ output=`cuda_memtest --disable_all --device $host_rank $enable_gpu_tests --num_p if [ $? -ne 0 ] ; then host_name=`hostname` - echo -e "$output" > $old_path/cuda_memtest_"$host_name"_"$host_rank".err - echo cuda_memtest crash: see file $old_path/cuda_memtest_"$host_name"_"$host_rank".err >&2 - exit 1 + if [ ! -d "$old_path" ]; then + echo "Error: $0 did not find directory: $old_path (on host: $host_name with rank: $host_rank)" >&2 + echo "error message of memtest is:" >&2 + echo -e "$output" >&2 + exit 2 + else + echo -e "$output" > $old_path/cuda_memtest_"$host_name"_"$host_rank".err + echo cuda_memtest crash: see file $old_path/cuda_memtest_"$host_name"_"$host_rank".err >&2 + exit 1 + fi fi exit 0