Skip to content

Commit a6f5f6e

Browse files
committed
at least set threads number as 1, in case trainers number is larger than processors
1 parent 4fbba65 commit a6f5f6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle/scripts/submit_local.sh.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ function threads_config() {
7979
if [ -z $trainers ]; then
8080
trainers=1
8181
fi
82-
threads=$((processors / trainers))
82+
threads=$((processors / trainers))
83+
if [ $threads -eq 0 ]; then
84+
threads=1
85+
fi
8386
if [ -z "$OMP_NUM_THREADS" ]; then
8487
export OMP_NUM_THREADS=$threads
8588
fi

0 commit comments

Comments
 (0)