Skip to content

Commit

Permalink
Merge pull request #131 from marshall-lab/task-per-process
Browse files Browse the repository at this point in the history
Task per process change to improve reproducibility.
  • Loading branch information
s-bessey authored Oct 28, 2020
2 parents beb5b2f + b4d3ec5 commit 55ab07c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion run_titan.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ def main(
tic = time_mod.time()
wct = [] # wall clock times

with Pool(processes=NCORES) as pool:
with Pool(
processes=NCORES, maxtasksperchild=1
) as pool: # set max tasks/child to prevent processor drift
results = [
pool.apply_async(
single_run, (sweep_def, outfile_dir, params, save_pop, pop_path)
Expand Down
6 changes: 4 additions & 2 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,13 @@ def test_prep_coverage(make_model_integration, tmpdir):


@pytest.mark.integration_stochastic
def test_syringe_services(make_model_integration, tmpdir):
def test_syringe_services(params_integration, tmpdir):
"""
If we use syringe services, does the incidence of hiv decrease?
"""
model_a = make_model_integration()
params_integration.demographics.black.MSM.drug_type.Inj.init = 1.0
params_integration.demographics.black.MSM.drug_type["None"].init = 0.0
model_a = HIVModel(params_integration)

path_a = tmpdir.mkdir("a")
path_a.mkdir("network")
Expand Down

0 comments on commit 55ab07c

Please sign in to comment.