From 74dd9bf58919635a8307d9ba10bcfdf8f8e0c1c5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 22 Apr 2021 08:04:02 +0200 Subject: [PATCH] use sensible defaults if shell NUM_THREADS is not given --- src/parallelization.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parallelization.f90 b/src/parallelization.f90 index 8413ba825..e850ff04d 100644 --- a/src/parallelization.f90 +++ b/src/parallelization.f90 @@ -84,13 +84,13 @@ subroutine parallelization_init !$ call get_environment_variable(name='OMP_NUM_THREADS',value=NumThreadsString,STATUS=got_env) !$ if(got_env /= 0) then -!$ print*, 'Could not determine value of $OMP_NUM_THREADS' -!$ OMP_NUM_THREADS = 1_pI32 +!$ print*, 'Could not get $OMP_NUM_THREADS, using default' +!$ OMP_NUM_THREADS = 4_pI32 !$ else !$ read(NumThreadsString,'(i6)') OMP_NUM_THREADS !$ if (OMP_NUM_THREADS < 1_pI32) then -!$ print*, 'Invalid OMP_NUM_THREADS: '//trim(NumThreadsString) -!$ OMP_NUM_THREADS = 1_pI32 +!$ print*, 'Invalid OMP_NUM_THREADS: "'//trim(NumThreadsString)//'", using default' +!$ OMP_NUM_THREADS = 4_pI32 !$ endif !$ endif !$ print'(a,i2)', ' OMP_NUM_THREADS: ',OMP_NUM_THREADS