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

added assertion that comm create func is valid

parent 293fccff
Branches
No related tags found
1 merge request!6More Work on infrastructure IV
...@@ -29,7 +29,8 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"): ...@@ -29,7 +29,8 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"):
# currently supported: # currently supported:
assert send_func in ["mpi_send", "mpi_ssend", "mpi_isend", "mpi_issend", "mpi_sendrecv", "mpi_rsend", "mpi_irsend", assert send_func in ["mpi_send", "mpi_ssend", "mpi_isend", "mpi_issend", "mpi_sendrecv", "mpi_rsend", "mpi_irsend",
"mpi_bsend", "mpi_ibsend", "mpi_sendrecv", "mpi_sendrecv_replace", "mpi_isendrecv", "mpi_bsend", "mpi_ibsend", "mpi_sendrecv", "mpi_sendrecv_replace", "mpi_isendrecv",
"mpi_isendrecv_replace","mpi_send_init", "mpi_ssend_init", "mpi_bsend_init", "mpi_rsend_init","mpi_psend_init"] "mpi_isendrecv_replace", "mpi_send_init", "mpi_ssend_init", "mpi_bsend_init", "mpi_rsend_init",
"mpi_psend_init"]
assert recv_func in ["mpi_recv", "mpi_irecv", "mpi_sendrecv", "mpi_sendrecv_replace", "mpi_isendrecv", assert recv_func in ["mpi_recv", "mpi_irecv", "mpi_sendrecv", "mpi_sendrecv_replace", "mpi_isendrecv",
"mpi_isendrecv_replace", "mpi_recv_init", "mpi_precv_init"] "mpi_isendrecv_replace", "mpi_recv_init", "mpi_precv_init"]
...@@ -57,7 +58,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"): ...@@ -57,7 +58,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"):
alloc_block.register_operation(alloc) alloc_block.register_operation(alloc)
tm.register_instruction_block(alloc_block) tm.register_instruction_block(alloc_block)
if send_func in ["mpi_bsend", "mpi_ibsend", "mpi_bsend_init"]: if send_func in ["mpi_bsend", "mpi_ibsend", "mpi_bsend_init"]:
b = InstructionBlock("buf_attach") b = InstructionBlock("buf_attach")
buf_size = "sizeof(int)*10 + MPI_BSEND_OVERHEAD" buf_size = "sizeof(int)*10 + MPI_BSEND_OVERHEAD"
...@@ -104,10 +104,8 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"): ...@@ -104,10 +104,8 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"):
b.register_operation(cmpicf.mpi_start(), 1) # b.register_operation(cmpicf.mpi_start(), 1) #
# parrived is not necessary # parrived is not necessary
tm.register_instruction_block(b) tm.register_instruction_block(b)
if send_func in ["mpi_rsend", "mpi_irsend", "mpi_rsend_init"]: if send_func in ["mpi_rsend", "mpi_irsend", "mpi_rsend_init"]:
b = InstructionBlock("SYNC") b = InstructionBlock("SYNC")
b.register_operation(CorrectMPICallFactory().mpi_barrier(), 1) b.register_operation(CorrectMPICallFactory().mpi_barrier(), 1)
...@@ -123,8 +121,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"): ...@@ -123,8 +121,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"):
b.register_operation(CorrectMPICallFactory().mpi_wait(), 0) b.register_operation(CorrectMPICallFactory().mpi_wait(), 0)
tm.register_instruction_block(b) tm.register_instruction_block(b)
if send_func in ["mpi_bsend", "mpi_ibsend", "mpi_bsend_init"]: if send_func in ["mpi_bsend", "mpi_ibsend", "mpi_bsend_init"]:
b = InstructionBlock("buf_detach") b = InstructionBlock("buf_detach")
b.register_operation("int freed_size;") b.register_operation("int freed_size;")
...@@ -145,7 +141,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"): ...@@ -145,7 +141,6 @@ def get_send_recv_template(send_func="mpi_isend", recv_func="mpi_irecv"):
b.register_operation(cmpicf.mpi_request_free()) b.register_operation(cmpicf.mpi_request_free())
tm.register_instruction_block(b) tm.register_instruction_block(b)
return tm return tm
...@@ -188,13 +183,16 @@ def get_collective_template(collective_func, seperate=True): ...@@ -188,13 +183,16 @@ def get_collective_template(collective_func, seperate=True):
return tm return tm
def get_communicator(comm_create_func, name): def get_communicator(comm_create_func, name):
""" """
:param comm_create_func: teh function used to create the new communicator :param comm_create_func: teh function used to create the new communicator
:param name: name of the communicator variable :param name: name of the communicator variable
:return: instruction block with name "comm_create" that will initialize the communicator with the given initialization function, does include the allocation of a stack variable with the procided name for the communicator :return: instruction block with name "comm_create" that will initialize the communicator with the given initialization function, does include the allocation of a stack variable with the procided name for the communicator
""" """
assert comm_create_func in ["mpi_comm_dup", "mpi_comm_dup_with_info", "mpi_comm_idup",
"mpi_comm_idup_with_info", "mpi_comm_create", "mpi_comm_create_group", "mpi_comm_split",
"mpi_comm_split_type", "mpi_comm_create_from_group"]
b = InstructionBlock("comm_create") b = InstructionBlock("comm_create")
b.register_operation("MPI_Comm " + name + ";") b.register_operation("MPI_Comm " + name + ";")
if comm_create_func.startswith("mpi_comm_i"): if comm_create_func.startswith("mpi_comm_i"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment