From a6f5f6efb69a14c7c8c654f36a08c467ceb7b258 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 15 Nov 2017 17:14:11 +0800 Subject: [PATCH] at least set threads number as 1, in case trainers number is larger than processors --- paddle/scripts/submit_local.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/submit_local.sh.in b/paddle/scripts/submit_local.sh.in index 4bf25c69e..1cc507849 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 -- GitLab