Skip to content

Commit

Permalink
improved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kathrynle20 committed Oct 22, 2024
1 parent 755fc07 commit d37c35b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/communication/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(self):
def listener(self):
"""
Runs on listener thread on each node to receive a send request
Once send request is received, the listener thread informs the main
Once send request is received, the listener thread informs the send
thread to send the data to the requesting node.
"""
while True:
Expand All @@ -50,7 +50,7 @@ def listener(self):

def send(self, data: Any):
"""
Node will wait until request is received and then send
Node will wait for a request to send data and then send the
data to requesting node.
"""
while True:
Expand All @@ -70,15 +70,15 @@ def send(self, data: Any):

def receive(self, node_ids: str | int) -> Any:
"""
Node will send a request and wait to receive data.
Node will send a request for data and wait to receive data.
"""
node_ids = int(node_ids)
send_req = self.comm.isend("", dest=node_ids, tag=1)
send_req.wait()
recv_req = self.comm.irecv(source=node_ids)
return recv_req.wait()

# depreciated broadcast function
# deprecated broadcast function
# def broadcast(self, data: Any):
# for i in range(1, self.size):
# if i != self.rank:
Expand Down

0 comments on commit d37c35b

Please sign in to comment.