Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ParallelContext to split computation for each simulation among processors on a system. This mode is not compatible with joblibs embarrasingly parallel execution and requires MPI.
- Loading branch information
Blake Caldwell
committed
Sep 23, 2019
1 parent
0aa973e
commit 9e16101
Showing
5 changed files
with
201 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
=============== | ||
Simulate dipole | ||
=============== | ||
This example demonstrates how to simulate a dipole for evoked-like | ||
waveforms using HNN-core. | ||
""" | ||
|
||
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr> | ||
# Sam Neymotin <samnemo@gmail.com> | ||
|
||
import os.path as op | ||
|
||
############################################################################### | ||
# Let us import hnn_core | ||
|
||
import hnn_core | ||
from hnn_core import simulate_dipole, Params, Network, shutdown | ||
|
||
hnn_core_root = op.join(op.dirname(hnn_core.__file__), '..') | ||
|
||
############################################################################### | ||
# Then we read the parameters file | ||
params_fname = op.join(hnn_core_root, 'param', 'default.json') | ||
params = Params(params_fname) | ||
|
||
############################################################################### | ||
# Now let's simulate the dipole | ||
# You can simulate multiple trials in parallel by using n_jobs > 1 | ||
net = Network(params) | ||
dpls = simulate_dipole(net, n_jobs=1, n_trials=4) | ||
|
||
shutdown() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters