Skip to content

Commit

Permalink
fmk - reverting runTMCMC processor pool to original, if large num pro…
Browse files Browse the repository at this point in the history
…cessors setting to 8 for container runs
  • Loading branch information
fmckenna committed Oct 22, 2024
1 parent 4a3ec1f commit b6c5b93
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions modules/performUQ/UCSD_UQ/runTMCMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,33 @@ def run_TMCMC( # noqa: N802, PLR0913

# Evaluate log-likelihood at current samples Sm
if run_type == 'runningLocal':
mp.set_start_method('forkserver', force=True)

processor_count = mp.cpu_count()
with mp.Pool(processes=processor_count) as pool:
write_eval_data_to_logfile(
logfile,
parallelize_MCMC,
run_type,
proc_count=processor_count,
stage_num=stage_number,
if processor_count > 32:
processor_count = 8

pool = Pool(processes=processor_count)
write_eval_data_to_logfile(
logfile,
parallelize_MCMC,
run_type,
proc_count=processor_count,
stage_num=stage_number,
)
outputs = pool.starmap(runFEM, iterables)
outputs = pool.starmap(runFEM, iterables)

# pool does not start
#mp.set_start_method('forkserver', force=True)
#processor_count = mp.cpu_count()
#with mp.Pool(processes=processor_count) as pool:
# write_eval_data_to_logfile(
# logfile,
# parallelize_MCMC,
# run_type,
# proc_count=processor_count,
# stage_num=stage_number,
# )
# outputs = pool.starmap(runFEM, iterables)

#mp.set_start_method('spawn')
#with mp.Pool(processes=processor_count) as pool:
Expand Down

0 comments on commit b6c5b93

Please sign in to comment.