Skip to content

Commit dce8646

Browse files
committed
add check for existance of output dir for memtest
1 parent 756d421 commit dce8646

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/cuda_memtest.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ output=`cuda_memtest --disable_all --device $host_rank $enable_gpu_tests --num_p
3939

4040
if [ $? -ne 0 ] ; then
4141
host_name=`hostname`
42-
echo -e "$output" > $old_path/cuda_memtest_"$host_name"_"$host_rank".err
43-
echo cuda_memtest crash: see file $old_path/cuda_memtest_"$host_name"_"$host_rank".err >&2
44-
exit 1
42+
if [ ! -d "$old_path" ]; then
43+
echo "Error: $0 did not find directory: $old_path (on host: $host_name with rank: $host_rank)" >&2
44+
exit 2
45+
else
46+
echo -e "$output" > $old_path/cuda_memtest_"$host_name"_"$host_rank".err
47+
echo cuda_memtest crash: see file $old_path/cuda_memtest_"$host_name"_"$host_rank".err >&2
48+
exit 1
49+
fi
4550
fi
4651
exit 0

0 commit comments

Comments
 (0)