-
Notifications
You must be signed in to change notification settings - Fork 1
/
pira.py
123 lines (107 loc) · 4.44 KB
/
pira.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
"""
File: pira.py
License: Part of the PIRA project. Licensed under BSD 3 clause license.
See LICENSE.txt file at https://github.com/tudasc/pira
Description: This is PIRA.
"""
__version__ = '0.6.0'
import argparse
import lib.Logging as log
import lib.Pira as pira
import lib.Utility as U
"""
Pira Main
This file contains the main entry point for the Pira framework.
Options are defined here and then passed to the Pira class.
"""
parser = argparse.ArgumentParser(prog='PIRA')
# --- Required arguments section
parser.add_argument('config', help='The configuration json file.')
# -- Pira folder option
pira_dir = U.get_default_pira_dir()
parser.add_argument('--pira-dir',
help='The directory which stores PIRA runtime files',
type=str,
default=pira_dir)
# --- Pira "mode" options
parser.add_argument('--config-version',
help='Which config file version to use',
choices=[1, 2],
default=2,
type=int)
parser.add_argument('--runtime-filter',
help='Use run-time filtering',
default=False,
action='store_true')
parser.add_argument('--iterations', help='Number of Pira iterations', default=3, type=int)
parser.add_argument('--repetitions', help='Number of measurement repetitions', default=3, type=int)
parser.add_argument(
'--analysis-parameters',
help='Path to json file containing analysis parameters. (required for Extra-P and LIDe mode',
default='')
# --- Pira debug options
parser.add_argument('--tape', help='Path to tape file to dump.')
# --- Pira modeling options
group = parser.add_argument_group('Extra-P Options')
group.add_argument('--extrap-dir',
help='The base directory where extra-p folder structure is placed',
type=str,
default='')
group.add_argument('--extrap-prefix', help='The prefix in extra-p naming scheme', type=str)
# CSV Export options
csv_group = parser.add_argument_group('CSV Export Options')
csv_group.add_argument('--csv-dir',
help='Export runtime measurements as CSV files to the specified directory',
type=str,
default='')
csv_group.add_argument(
'--csv-dialect',
help=
'The dialect the CSV file is written in. Possible values: excel, excel_tab, unix; defaults to unix',
type=str,
default='unix')
# Experimental options - even for research software they are experimental
experimental_group = parser.add_argument_group(
'Experimental Options - experimental even for research software')
experimental_group.add_argument(
'--call-site-instrumentation',
help='Enable call-site instrumentation. (May not work with current Score-P version',
default=False,
type=bool)
experimental_group.add_argument('--hybrid-filter-iters',
help='Do compiletime-filtering after x iterations',
default=0,
type=int)
experimental_group.add_argument('--export',
help='Export performance models to IPCG file.',
default=False,
action='store_true')
experimental_group.add_argument('--export-runtime-only',
help='Export only runtime data used for extra-p modeling',
default=False,
action='store_true')
experimental_group.add_argument('--lide',
help='Enable load imbalance detection',
action='store_true')
# --- Pira slurm option
experimental_group.add_argument('--slurm-config',
help='Path to the slurm configuration file',
type=str,
default=None)
# -- General Info
parser.add_argument('--version',
help='Shows the version of this PIRA installation',
action='version',
version='%(prog)s ' + __version__)
# ====== Start of Pira program ====== #
args = parser.parse_args()
try:
log.get_logger().log('Starting', level='debug')
pira.main(args)
finally:
if args.tape is not None:
log.get_logger().dump_tape(args.tape)
else:
log.get_logger().dump_tape('tape.tp')
log.get_logger().log('End of process')
log.get_logger().show_perf()