Trigger-Discipline: parallelize result plotting

This commit is contained in:
2026-04-24 10:04:57 +08:00
parent 7f603f189b
commit 45e3c725f9
5 changed files with 137 additions and 66 deletions

12
parallel_plot_helper.py Normal file
View File

@@ -0,0 +1,12 @@
import multiprocessing
def run_plot_task(task):
func, args = task
return func(*args)
def run_plot_tasks_parallel(plot_tasks):
ctx = multiprocessing.get_context('fork')
with ctx.Pool() as pool:
pool.map(run_plot_task, plot_tasks)