From 7b781aec097c7029c802d25c01164b3233545671 Mon Sep 17 00:00:00 2001 From: piyushrpt Date: Sun, 9 Jun 2019 20:05:13 -0700 Subject: [PATCH] OMP threads cap fix --- components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 b/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 index 759d27e..f38e450 100644 --- a/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 +++ b/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 @@ -21,7 +21,7 @@ integer i, j, k integer int_az_off integer i_na - integer ith, thnum + integer ith, thnum, ithorig integer ii, jj integer chipi, chipj @@ -82,6 +82,7 @@ !$OMP END MASTER !$OMP END PARALLEL + ithorig = ith ith = min(ith,8) print *, 'Number of threads: ', ith call omp_set_num_threads(ith) @@ -283,6 +284,8 @@ deallocate(rout) endif + !Reset number of threads + call omp_set_num_threads(ithorig) end