Skip to content

Commit

Permalink
don't jit subminor, remove parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Feb 21, 2024
1 parent 6673b83 commit 4b0509f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pfb/deconv/clark.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import pyscilog
log = pyscilog.get_logger('CLARK')

@numba.jit(parallel=True, nopython=True, nogil=True, cache=True, inline='always')
@numba.jit(nopython=True, nogil=True, cache=True) # parallel=True,
def subtract(A, psf, Ip, Iq, xhat, nxo2, nyo2):
'''
Subtract psf centered at location of xhat
'''
# loop over active indices
nband = xhat.size
for b in numba.prange(nband):
# for b in range(nband):
# for b in numba.prange(nband):
for b in range(nband):
for i in range(Ip.size):
pp = nxo2 - Ip[i]
qq = nyo2 - Iq[i]
Expand All @@ -25,7 +25,7 @@ def subtract(A, psf, Ip, Iq, xhat, nxo2, nyo2):
return A


@numba.jit(parallel=True, nopython=True, nogil=True, cache=True)
# @numba.jit(nopython=True, nogil=True, cache=True) # parallel=True,
def subminor(A, psf, Ip, Iq, model, wsums, gamma=0.05, th=0.0, maxit=10000):
"""
Run subminor loop in active set
Expand Down Expand Up @@ -55,6 +55,8 @@ def subminor(A, psf, Ip, Iq, model, wsums, gamma=0.05, th=0.0, maxit=10000):
q = Iq[pq]
Amax = np.sqrt(Asearch[pq])
fsel = wsums > 0
if fsel.sum() == 0:
raise ValueError("wsums are all zero")
k = 0
while Amax > th and k < maxit:
xhat = A[:, pq]
Expand Down

0 comments on commit 4b0509f

Please sign in to comment.