forked from INM-6/multi-area-model
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_simulation.py
37 lines (30 loc) · 941 Bytes
/
run_simulation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
This script is used to run a simulation from the given command-line
arguments:
1. Label of the simulation
2. Label of the network to be simulated
It initializes the network class and then runs the simulate method of
the simulation class instance.
This script should be used in the `jobscript_template` defined in the
config.py file. See config_template.py.
"""
import json
import nest
import os
import sys
from config import data_path
from multiarea_model import MultiAreaModel
label = sys.argv[1]
network_label = sys.argv[2]
fn = os.path.join(data_path,
label,
'_'.join(('custom_params',
label,
str(nest.Rank()))))
with open(fn, 'r') as f:
custom_params = json.load(f)
os.remove(fn)
M = MultiAreaModel(network_label,
simulation=True,
sim_spec=custom_params['sim_params'])
M.simulation.simulate()