Baunsgaard commented on pull request #1237:
URL: https://github.com/apache/systemds/pull/1237#issuecomment-833371776


   > > Why not allow the two federated ranges to be equal if the arrays are the 
same and they are both overlapping?
   > > then you don't have to care about the hash of this element, making the 
implementation cleaner.
   > > In general why does the ranges need to implement comparable, if it is 
just for sorting then allowing them to be equal is fine.
   > 
   > The hashCode, equals, and compareTo are used when putting the range into a 
federation map. Depending on the data structure chosen for the federation map, 
which in most cases is a TreeMap, one or more of the methods will need to 
separate between the overlapping ranges. This is the point of adding some kind 
of uniqueness to the ranges.
   > If I change one of the three methods, then I should change all of them to 
include this unique value. Otherwise, it will be really confusing later on if 
there is a difference between putting into a HashMap vs a TreeMap.
   > Additionally, I add the uniqueness to the toString method so that we can 
see the difference in the print.
   
   Design wise would it not then make sense then to move the addresses into 
these ranges?
   This would result in the uniqueness coming from the combination of range and 
address(inside same object), this would also allow us to based on the equality 
of objects know that we have a federated location with two intermediates that 
perfectly overlap on the same machine, and therefore merge these remotely.
   Maybe @mboehm7  have a comment on this?
   
   > > it would be cool if you enabled some of the tests in the python API, 
since i added overlapping tests there sometime back and never got to use them
   > 
   > Where do I find this?
   
   In src/main/python/tests/federated/test_federated_aggregations.py and 
src/main/python/tests/federated/test_federated_basic.py


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to