Skip to content

Commit

Permalink
Pass sourceNodeId to messengers
Browse files Browse the repository at this point in the history
  • Loading branch information
s1ck committed Oct 16, 2024
1 parent 902e261 commit d14088a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void initIteration(int iteration) {
}

@Override
public void sendTo(long targetNodeId, double message) {
public void sendTo(long sourceNodeId, long targetNodeId, double message) {
assert !Double.isNaN(message);
queues.push(targetNodeId, message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface Messenger<ITERATOR extends Messages.MessageIterator> {

void initIteration(int iteration);

void sendTo(long targetNodeId, double message);
void sendTo(long sourceNodeId, long targetNodeId, double message);

ITERATOR messageIterator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void initIteration(int iteration) {
}

@Override
public void sendTo(long targetNodeId, double message) {
public void sendTo(long sourceNodeId, long targetNodeId, double message) {
sendArray.update(
targetNodeId,
current -> reducer.reduce(current, message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void initIteration(int iteration) {
}

@Override
public void sendTo(long targetNodeId, double message) {
public void sendTo(long sourceNodeId, long targetNodeId, double message) {
queues.push(targetNodeId, message);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void sendToNeighbors(double message) {
* @throws ArrayIndexOutOfBoundsException if the node is in the not in id space
*/
public void sendTo(long targetNodeId, double message) {
messenger.sendTo(targetNodeId, message);
messenger.sendTo(this.nodeId, targetNodeId, message);
this.hasSendMessage.setValue(true);
}

Expand Down

0 comments on commit d14088a

Please sign in to comment.