jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
56 stars 52 forks source link

MPIBackend silently works even if MPI is not available #266

Open jasmainak opened 3 years ago

jasmainak commented 3 years ago

Not exactly sure if it's intended behavior. If you do:

with MPIBackend(n_procs=3):
    dpls = simulate_dipole(net, n_trials=1)

and mpi4py is not installed, it should throw an ImportError rather than resorting to joblibs backend

blakecaldwell commented 3 years ago

Seems a good idea to throw an exception. Also a UserWarning if only 1 processor is given to MPIBackend (which will run simulation using joblibs). I think this might catch an issue on CI where the cloud server only has 1 processor, so run_hnn_core_fixture may actually not run MPIBackend when the test inteded to.

I think HNN GUI could be adapted to catch the ImportError and run the simulation with the joblibs backend. Just need changes on that side too...

simar5244 commented 1 year ago

Is this issue currently open?

rythorpe commented 1 year ago

@simar5244 yes it is!