ruby: Fix regressions and make Ruby configs Python packages
Review Request #3647 - Created Oct. 7, 2016 and submitted
Information | |
---|---|
Andreas Hansson | |
gem5 | |
default | |
Reviewers | |
Default | |
Changeset 11670:aeab4c3c27ef --------------------------- ruby: Fix regressions and make Ruby configs Python packages This patch moves the addition of network options into the Ruby module to avoid the regressions all having to add it explicitly. Doing this exposes an issue in our current config system though, namely the fact that addtoPath is relative to the Python script being executed. Since both example and regression scripts use the Ruby module we would end up with two different (relative) paths being added. Instead we take a first step at turning the config modules into Python packages, simply by adding a __init__.py in the configs/ruby, configs/topologies and configs/network subdirectories. As a result, we can now add the top-level configs directory to the Python search path, and then use the package names in the various modules. The example scripts are also updated, and the messy path-deducing variations in the scripts are unified.
-
configs/ruby/Ruby.py (Diff revision 1) -
I think I'm missing something, but isn't the network directory and the topologies directory both in configs/? Why are these addToPath calls different?
Ship It!
Description: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+15 -77) |
I'm noticing that this patch doesn't completely fix the regressions on its own. There are still two failures that I'm seeing with it applied (although they may be unrelated, not sure):
cat build/HSAIL_X86/tests/opt/quick/se/04.gpu/x86/linux/gpu-ruby-GPU_RfO/simerr
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'dst_node_' already has parent
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/bpotter/Research/gem5/gem5-public-process/src/python/m5/main.py", line 400, in main
exec filecode in scope
File "/home/bpotter/Research/gem5/gem5-public-process/tests/testing/../run.py", line 184, in <module>
execfile(joinpath(tests_root, 'configs', test_filename + '.py'))
File "/home/bpotter/Research/gem5/gem5-public-process/tests/testing/../configs/gpu-ruby.py", line 282, in <module>
Ruby.create_system(options, None, system)
File "/home/bpotter/Research/gem5/gem5-public-process/configs/ruby/Ruby.py", line 175, in create_system
Network.init_network(options, network, InterfaceClass)
File "/home/bpotter/Research/gem5/gem5-public-process/configs/network/Network.py", line 108, in init_network
network.setup_buffers()
File "/home/bpotter/Research/gem5/gem5-public-process/src/mem/ruby/network/simple/SimpleNetwork.py", line 62, in setup_buffers
if link.dst_node == router:
File "/home/bpotter/Research/gem5/gem5-public-process/src/python/m5/SimObject.py", line 1105, in getattr
raise AttributeError, err_string
AttributeError: object 'SimpleIntLink' has no attribute 'dst_node'
(C++ object is not yet constructed, so wrapped C++ methods are unavailable.)
cat build/HSAIL_X86/tests/opt/quick/se/60.gpu-randomtest/x86/linux/gpu-randomtest-ruby-GPU_RfO/simerr
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'int_node' already has parent
warn: add_child('dst_node_'): child 'dst_node_' already has parent
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/bpotter/Research/gem5/gem5-public-process/src/python/m5/main.py", line 400, in main
exec filecode in scope
File "/home/bpotter/Research/gem5/gem5-public-process/tests/testing/../run.py", line 184, in <module>
execfile(joinpath(tests_root, 'configs', test_filename + '.py'))
File "/home/bpotter/Research/gem5/gem5-public-process/tests/testing/../configs/gpu-randomtest-ruby.py", line 104, in <module>
Ruby.create_system(options, False, system)
File "/home/bpotter/Research/gem5/gem5-public-process/configs/ruby/Ruby.py", line 175, in create_system
Network.init_network(options, network, InterfaceClass)
File "/home/bpotter/Research/gem5/gem5-public-process/configs/network/Network.py", line 108, in init_network
network.setup_buffers()
File "/home/bpotter/Research/gem5/gem5-public-process/src/mem/ruby/network/simple/SimpleNetwork.py", line 62, in setup_buffers
if link.dst_node == router:
File "/home/bpotter/Research/gem5/gem5-public-process/src/python/m5/SimObject.py", line 1105, in getattr
raise AttributeError, err_string
AttributeError: object 'SimpleIntLink' has no attribute 'dst_node'
(C++ object is not yet constructed, so wrapped C++ methods are unavailable.)
Ship It!
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+50 -111) |
Ship It!
I like this approach! A couple of comments,though.
- I think you need to add an init.py file to each directory (ruby, topologies, network) for this to work. Did you forget to hg add them?
- Since we don't have good test coverage, did you eyeball that the rest of the scripts in configs/ruby didn't need to be updated similarly? Looking that them, I think AMD_Base_Constructor.py and GPU_VIPER_Region.py should be updated too. I don't think there are any others, but I could be wrong.
Thanks for fixing this the "right" way. Maybe next time someone can factor out all of the common code across all of these files and make them more "modular".
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+160 -113) |
Thanks again for doing this!