diff --git a/paddle/scripts/submit_local.sh.in b/paddle/scripts/submit_local.sh.in index 4bf25c69e3cb9737c7280438ffcd06faca342746..1cc5078494593a9ca0dd7824116011c7889d8039 100755 --- a/paddle/scripts/submit_local.sh.in +++ b/paddle/scripts/submit_local.sh.in @@ -79,7 +79,10 @@ function threads_config() { if [ -z $trainers ]; then trainers=1 fi - threads=$((processors / trainers)) + threads=$((processors / trainers)) + if [ $threads -eq 0 ]; then + threads=1 + fi if [ -z "$OMP_NUM_THREADS" ]; then export OMP_NUM_THREADS=$threads fi