Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow repeated keys and masks #192

Merged
merged 1 commit into from
Nov 2, 2015
Merged

Conversation

mundya
Copy link
Member

@mundya mundya commented Oct 27, 2015

build_routing_tables raises an exception if multiple nets with the exact same key and mask would cause packets to become duplicated at any node; this is generally an indication that the underlying net should be being treated as a multisource net.

This is option (3) from #153.

Clearly this is a somewhat contentious change, for example it will break nengo_spinnaker as stands.

net_keys = {net: (0x0, 0xf) for net in (net0, net1)}

# Build the routing tables
with pytest.raises(Exception) as err:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you assert the correct exception type here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you can tell I did some bad TDD here.

@mossblaser
Copy link
Member

This LGTM, aside from the exception message and type check in the tests!

As mentioned offline and in #153, the issue of N:M nets is going to need to be considered properly in the near future.

@mundya mundya force-pushed the multisource_nets_option_3 branch from e7965a9 to e85c5b8 Compare November 2, 2015 09:48
Note: The routing trees provided are assumed to be correct and continuous
(not missing any hops). If this is not the case, the output is undefined.
.. warning::
An exception will be raised if entries with identical keys and masks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of exception? (i.e. MultisourceRouteError)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

`build_routing_tables` raises an exception if multiple nets with the
exact same key and mask would cause packets to become duplicated at any
node; this is generally an indication that the underlying net should be
being treated as a multisource net.

Includes suggestions by @mossblaser.
@mundya mundya force-pushed the multisource_nets_option_3 branch from e85c5b8 to c275a18 Compare November 2, 2015 10:50
@mundya
Copy link
Member Author

mundya commented Nov 2, 2015

Bump.

mossblaser added a commit that referenced this pull request Nov 2, 2015
@mossblaser mossblaser merged commit 532e4ae into master Nov 2, 2015
@mossblaser mossblaser deleted the multisource_nets_option_3 branch November 2, 2015 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants