hnn_core.parallel_backends.MPIBackend

class hnn_core.parallel_backends.MPIBackend(n_procs=None, mpi_cmd='mpiexec')

The MPIBackend class.

Parameters
n_procsint | None

The number of MPI processes requested by the user. If None, then will attempt to detect number of cores (including hyperthreads) and start parallel simulation over all of them.

mpi_cmdstr

The name of the mpi launcher executable. Will use ‘mpiexec’ (openmpi) by default.

Attributes
n_procsint

The number of processes MPI will actually use (spread over cores). This can be less than the user specified value if limited by the cores on the system, the number of cores allowed by the job scheduler, or if mpi4py could not be loaded.

mpi_cmd_strstr

The string of the mpi command with number of procs and options

proc_data_bytes: bytes object

This will contain data received from the MPI child process via stderr.

simulate(net, n_trials, postproc=True)

Simulate the HNN model in parallel on all cores

Parameters
netNetwork object

The Network object specifying how cells are connected.

n_trialsint

Number of trials to simulate.

postproc: bool

If False, no postprocessing applied to the dipole

Returns
dpl: list of Dipole

The Dipole results from each simulation trial