Skip to content

Commit

Permalink
Merge pull request #24 from discopop-project/feature/prepare_release
Browse files Browse the repository at this point in the history
Release preparation
  • Loading branch information
wntgd committed Aug 27, 2020
2 parents b301fda + 7af964e commit e4251c3
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 2,348 deletions.
4 changes: 0 additions & 4 deletions graph_analyzer/.gitignore
Expand Up @@ -9,10 +9,6 @@ __pycache__/
# PyCharm
.idea/


# C extensions
*.so

# Distribution / packaging
.Python
build/
Expand Down
296 changes: 0 additions & 296 deletions graph_analyzer/PETGraph.py

This file was deleted.

27 changes: 9 additions & 18 deletions graph_analyzer/graph_analyzer.py
Expand Up @@ -28,6 +28,7 @@
import os
import sys
import time
from typing import List

from docopt import docopt
from pluginbase import PluginBase
Expand All @@ -37,7 +38,6 @@
from json_serializer import PatternInfoSerializer
from parser import parse_inputs
from pattern_detection import DetectionResult, PatternDetectorX
from typing import List

docopt_schema = Schema({
'--path': Use(str),
Expand All @@ -61,16 +61,14 @@ def get_path(base_path: str, file_name: str) -> str:
return file_name if os.path.isabs(file_name) else os.path.join(base_path, file_name)


def run(cu_xml: str, dep_file: str, loop_counter_file: str, reduction_file: str, plugins: List[str])\
def run(cu_xml: str, dep_file: str, loop_counter_file: str, reduction_file: str, plugins: List[str]) \
-> DetectionResult:

cu_dict, dependencies, loop_data, reduction_vars = parse_inputs(cu_xml, dep_file,
loop_counter_file, reduction_file)

# petGraphX = PETGraph(cu_dict, dependencies, loop_data, reduction_vars)
# petGraphX.interactive_visualize(path)
petGraphX = PETGraphX(cu_dict, dependencies, loop_data, reduction_vars)
# petGraphX.show()
pet = PETGraphX(cu_dict, dependencies, loop_data, reduction_vars)
# TODO add visualization
# pet.show()

plugin_base = PluginBase(package='plugins')

Expand All @@ -80,17 +78,16 @@ def run(cu_xml: str, dep_file: str, loop_counter_file: str, reduction_file: str,
for plugin_name in plugins:
p = plugin_source.load_plugin(plugin_name)
print("executing plugin before: " + plugin_name)
petGraphX = p.run_before(petGraphX)
pet = p.run_before(pet)

# pattern_detector = PatternDetector(petGraphX)
pattern_detector = PatternDetectorX(petGraphX)
pattern_detector = PatternDetectorX(pet)

res: DetectionResult = pattern_detector.detect_patterns(cu_dict, dependencies, loop_data, reduction_vars)
res: DetectionResult = pattern_detector.detect_patterns()

for plugin_name in plugins:
p = plugin_source.load_plugin(plugin_name)
print("executing plugin after: " + plugin_name)
petGraphX = p.run_after(petGraphX)
pet = p.run_after(pet)

return res

Expand All @@ -104,11 +101,6 @@ def run(cu_xml: str, dep_file: str, loop_counter_file: str, reduction_file: str,
exit(e)

path = arguments['--path']
# path = './../../test_data/atax'
# path = './../../test_data/temp'
# path = './../../test_data/reduction'
# path = './../../test_data/nqueens'
# path = './../../dp_script/data'

cu_xml = get_path(path, arguments['--cu-xml'])
dep_file = get_path(path, arguments['--dep-file'])
Expand Down Expand Up @@ -136,4 +128,3 @@ def run(cu_xml: str, dep_file: str, loop_counter_file: str, reduction_file: str,
json.dump(res, f, indent=2, cls=PatternInfoSerializer)

print("Time taken for pattern detection: {0}".format(end - start))

1 change: 0 additions & 1 deletion graph_analyzer/json_serializer.py
Expand Up @@ -51,6 +51,5 @@ def default(self, o):
if isinstance(o, CUNode):
return o.id


# Let the base class default method raise the TypeError
return JSONEncoder.default(self, o)

0 comments on commit e4251c3

Please sign in to comment.