-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbatch_argparser.py
52 lines (39 loc) · 1.97 KB
/
batch_argparser.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import argparse
# Current defaults for [App: Motion detection]
# as of 08.10.2018
# Default values
DEFAULT_NO_CPUS = 32
DEFAULT_MAX_CONCURRENT_PROCESSES = 24
DEFAULT_SUFFIX = None
DEFAULT_NO_ITERATIONS = 19200000
# Argument parser
parser = argparse.ArgumentParser(
description='Readout module for topographic maps generated by SpiNNaker '
'in order to perform classification. '
'[WARNING] This module assumes a specific architecture (1 '
'exc and 1 inh target layers each with 3 input projections)')
parser.add_argument('path', help='path of input .npz archive defining '
'connectivity', nargs='*')
parser.add_argument('-o', '--output', type=str,
help="name of the numpy archive storing simulation results",
dest='filename')
parser.add_argument('--suffix', type=str,
help="add a recognisable suffix to all the file "
"generated in this batch "
"-- [default {}]".format(DEFAULT_SUFFIX),
dest='suffix')
parser.add_argument('--no_iterations', type=int,
default=DEFAULT_NO_ITERATIONS, dest='no_iterations',
help='total number of iterations (or time steps) for '
'the simulation (technically, ms)'
' -- [default {}]'.format(DEFAULT_NO_ITERATIONS))
parser.add_argument('--no_cpus', type=int,
default=DEFAULT_NO_CPUS, dest='no_cpus',
help='total number of available CPUs'
' -- [default {}]'.format(DEFAULT_NO_CPUS))
parser.add_argument('--max_processes', type=int,
default=DEFAULT_MAX_CONCURRENT_PROCESSES,
dest='max_processes',
help='total number of concurrent processes'
' -- [default {}]'.format(DEFAULT_MAX_CONCURRENT_PROCESSES))
args = parser.parse_args()