def run_simulation_chunk(system, params, S0_range_chunk, C0_range, vtc, core_id):
np.random.seed() # Ensure each core gets a unique seed
with tqdm(total=total, leave = False, desc=f"Blank") as pbar:
pbar.update(1)
return (x,y,z)
def parallel_boa(system, params, S0_range, C0_range, vtc=[7], n_jobs=1):
if n_jobs > os.cpu_count():
print(f"Number of cores greater than available. This device has {os.cpu_count()} cores.")
S0_splits = np.array_split(S0_range, n_jobs)
results = Parallel(n_jobs=n_jobs)(delayed(run_simulation_chunk)(system, params, S0_chunk, C0_range, vtc, core_id)for core_id, S0_chunk in enumerate(S0_splits))
...
return (a, b, c)
Hello, I am having issues trying to run tqdm progress bars when parallelised. The bars run perfectly for non-parallelised code. When I parallelise it, the code runs fine to completion, but I can’t see the progress bars. I am using joblib’s Parallel to parallelise.