Skip to content
Snippets Groups Projects
Commit 1cd2be24 authored by Jammer, Tim's avatar Jammer, Tim
Browse files

Default Send/recv Template only creates one wait block

parent 84394d7d
Branches
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ def get_default_template(mpi_func):
def get_send_recv_template(send_func: str = "mpi_isend", recv_func: str | typing.Tuple[str, str] = "mpi_irecv"):
"""
Contructs a default template for the given mpi send recv function pair
Contructs a default template for the given mpi send recv function pair it contains a send from rank 1 to rank 0
Returns:
TemplateManager Initialized with a default template
The function is contained in a block named MPICALL with seperate calls for rank 1 and 2)
......@@ -142,16 +142,15 @@ def get_send_recv_template(send_func: str = "mpi_isend", recv_func: str | typing
tm.register_instruction_block(b)
# wait for op to complete
if send_func in isend_funcs + persistent_send_funcs:
b = InstructionBlock("WAIT")
b.register_instruction(CorrectMPICallFactory().mpi_wait(), 1)
tm.register_instruction_block(b)
wait_block = InstructionBlock("WAIT")
if send_func in isend_funcs + persistent_send_funcs:
wait_block.register_instruction(CorrectMPICallFactory().mpi_wait(), 1)
if recv_func in irecv_funcs + persistent_recv_funcs + [["mpi_mprobe", "mpi_imrecv"],
["mpi_improbe", "mpi_imrecv"]]:
b = InstructionBlock("WAIT")
b.register_instruction(CorrectMPICallFactory().mpi_wait(), 0)
tm.register_instruction_block(b)
wait_block.register_instruction(CorrectMPICallFactory().mpi_wait(), 0)
tm.register_instruction_block(wait_block) # if no waits: block is empty
# end MPI operation
# cleanup
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment