11
11
Usage:
12
12
discopop_explorer [--path <path>] [--cu-xml <cuxml>] [--dep-file <depfile>] [--plugins <plugs>] \
13
13
[--loop-counter <loopcount>] [--reduction <reduction>] [--json <json_out>] [--fmap <fmap>] \
14
- [--cu-inst-res <cuinstres>] [--llvm-cxxfilt-path <cxxfp>] [--discopop-build-path=<dpbuildpath >] \
15
- [--generate-data-cu-inst <outputdir>]
14
+ [--task-pattern] [-- cu-inst-res <cuinstres>] [--llvm-cxxfilt-path <cxxfp>] \
15
+ [--dp-build-path=<dpbuildpath>] [-- generate-data-cu-inst <outputdir>]
16
16
17
17
Options:
18
18
--path=<path> Directory with input data [default: ./]
23
23
--fmap=<fmap> File mapping [default: FileMapping.txt]
24
24
--json=<json_out> Json output
25
25
--plugins=<plugs> Plugins to execute
26
- --cu-inst-res=<cuinstres> CU instantiation result file. Task Pattern Detector is executed if this option is set.
27
- --llvm-cxxfilt-path=<cxxfp> Path to llvm-cxxfilt executable. Required for Task Pattern Detector
26
+ --task-pattern Enables the task parallelism pattern identification.
27
+ Requires --cu-inst-res and --llvm-cxxfilt-path to be set.
28
+ --cu-inst-res=<cuinstres> CU instantiation result file.
29
+ --llvm-cxxfilt-path=<cxxfp> Path to llvm-cxxfilt executable. Required for task pattern detector
28
30
if non-standard path should be used.
29
- --discopop -build-path=<dpbuildpath> Path to DiscoPoP build folder. Required, if --cu-inst-res is set.
31
+ --dp -build-path=<dpbuildpath> Path to DiscoPoP build folder [default: discopop/build]
30
32
--generate-data-cu-inst=<outputdir> Generates Data_CUInst.txt file and stores it in the given directory.
31
33
Stops the regular execution of the discopop_explorer.
32
34
Requires --cu-xml, --dep-file, --loop-counter, --reduction.
40
42
41
43
from docopt import docopt # type:ignore
42
44
from schema import Schema , Use , SchemaError # type:ignore
45
+ from pathlib import Path
43
46
44
47
from . import run , __version__
45
48
from .json_serializer import PatternInfoSerializer
53
56
'--fmap' : Use (str ),
54
57
'--plugins' : Use (str ),
55
58
'--json' : Use (str ),
59
+ '--task-pattern' : Use (bool ),
56
60
'--cu-inst-res' : Use (str ),
57
61
'--llvm-cxxfilt-path' : Use (str ),
58
- '--discopop -build-path' : Use (str ),
62
+ '--dp -build-path' : Use (str ),
59
63
'--generate-data-cu-inst' : Use (str ),
60
64
})
61
65
@@ -86,6 +90,12 @@ def main():
86
90
reduction_file = get_path (path , arguments ['--reduction' ])
87
91
file_mapping = get_path (path , 'FileMapping.txt' )
88
92
cu_inst_result_file = get_path (path , arguments ['--cu-inst-res' ])
93
+ if arguments ['--dp-build-path' ] != 'None' :
94
+ discopop_build_path = arguments ['--dp-build-path' ]
95
+ else :
96
+ # set default discopop build path
97
+ discopop_build_path = Path (__file__ ).resolve ().parent .parent
98
+ discopop_build_path = os .path .join (discopop_build_path , "build" )
89
99
90
100
for file in [cu_xml , dep_file , loop_counter_file , reduction_file ]:
91
101
if not os .path .isfile (file ):
@@ -105,7 +115,7 @@ def main():
105
115
106
116
res = run (cu_xml , dep_file , loop_counter_file , reduction_file , plugins , file_mapping = file_mapping ,
107
117
cu_inst_result_file = cu_inst_result_file , llvm_cxxfilt_path = arguments ['--llvm-cxxfilt-path' ],
108
- discopop_build_path = arguments ['--discopop-build-path ' ])
118
+ discopop_build_path = discopop_build_path , enable_task_pattern = arguments ['--task-pattern ' ])
109
119
110
120
end = time .time ()
111
121
0 commit comments