Skip to content

Commit

Permalink
add thread control1
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Oct 15, 2024
1 parent 3dc7b09 commit aa35947
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lollipop/cli/deconvolute.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pandas as pd
import numpy as np
from tqdm import tqdm, trange
from threadpoolctl import threadpool_info, ThreadpoolController
from threadpoolctl import threadpool_info, ThreadpoolController, threadpool_limits

import lollipop as ll

Expand Down Expand Up @@ -147,6 +147,11 @@ def _deconvolute_bootstrap(
List[pd.DataFrame]
The deconvolution results for the location and bootstrap iterations.
"""
print("Threadpool: ", threadpool_info())

logging.warning(threadpool_info())

controller = ThreadpoolController()

# deconvolution results
deconv = []
Expand Down Expand Up @@ -243,10 +248,8 @@ def _deconvolute_bootstrap(
confint=confint(**confint_params),
**weights,
)

logging.warning(threadpool_info())

t_kdec = t_kdec.deconv_all(**deconv_params)
with controller.limit(limits=1, user_api='blas'):
t_kdec = t_kdec.deconv_all(**deconv_params)

if have_confint:
# with conf int
Expand Down

0 comments on commit aa35947

Please sign in to comment.