AUTODIAL / AutoEIS

A tool for automated extraction of equivalent circuit models (ECM) from electrochemical impedance spectroscopy (EIS) data
https://autodial.github.io/AutoEIS/
MIT License
26 stars 5 forks source link

Parallel inference on multiple EIS datasets potentially breaking #92

Open ma-sadeghi opened 4 months ago

ma-sadeghi commented 4 months ago

Currently, this is not even implemented, but if you were to run parallel inference by distributing perform_bayesian_inference over multiple EIS datasets (as opposed to multiple circuits, single dataset), multiprocessing breaks. The real reason is still unclear to me, but it seems to be that when doing:

result = pool.map(func, *args)

func shouldn't return a list, which seems odd, so it might just be some quirk in the way mpire works. Anyway, if perform_bayesian_inference returns a single output (i.e., tuple of MCMC and exit code), it fixes the issue. This is a reasonable fix, since for single circuit inputs, a list of tuple of size 1 doesn't make much sense, although admittedly the output type is no longer stable (either a list of a tuple!)

ma-sadeghi commented 4 months ago

Related: #94 Also, it seems that we can use jax.pmap instead of mpire.