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

added more communicator missmatches

parent 34bb037a
No related branches found
No related tags found
1 merge request!6More Work on infrastructure IV
......@@ -35,9 +35,11 @@ class CorrectParameterFactory:
return "0"
if param in ["TAG", "tag", "sendtag", "recvtag"]:
return str(self.tag)
if param in "stringtag":
return "\"" + str(self.tag) + "\""
if param in ["COMM", "comm"]:
return "MPI_COMM_WORLD"
if param in ["newcomm"]:
if param in ["newcomm","newintercomm"]:
return "newcomm"
if param in ["STATUS", "status"]:
return "MPI_STATUS_IGNORE"
......@@ -51,7 +53,24 @@ class CorrectParameterFactory:
return "0"
if param in ["REQUEST", "request"]:
return "&request"
if param in ["GROUP", "group"]:
return "&group"
if param in ["color"]:
return "1"
if param in ["split_type"]:
return "MPI_COMM_TYPE_SHARED"
if param in ["key"]:
return "rank"
if param in ["errhandler"]:
return "MPI_ERRORS_ARE_FATAL" #
if param in ["local_comm"]:
return "MPI_COMM_SELF"
if param in ["local_leader"]:
return "0"
if param in ["peer_comm"]:
return "MPI_COMM_WORLD"
if param in ["remote_leader"]:
return "0"
print("Not Implemented: " + param)
assert False, "Param not known"
......
......@@ -15,18 +15,11 @@ sendrecv_funcs = ["mpi_sendrecv", "mpi_sendrecv_replace"]
class InvalidCommErrorP2P(ErrorGenerator):
invalid_comm = ["MPI_COMM_NULL", "NULL"]
missmatching_comms = ["MPI_COMM_SELF","mpi_comm_dup"]
missmatching_comms = ["MPI_COMM_SELF", "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"
]
# TODO test with:
#'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',
# 'MPI_Intercomm_create',
# 'MPI_Intercomm_create_from_groups',
# 'MPI_Intercomm_merge'
......@@ -79,15 +72,27 @@ class InvalidCommErrorP2P(ErrorGenerator):
if comm_to_use in self.missmatching_comms and comm_to_use != "MPI_COMM_SELF":
b = InstructionBlock("comm_create")
b.register_operation("MPI_Comm " + comm_to_use + ";")
if comm_to_use.startswith("mpi_comm_i"):
b.register_operation("MPI_Request comm_create_req;")
if comm_to_use in ["mpi_comm_create","mpi_comm_create_group"]:
b.register_operation("MPI_Group group;")
b.register_operation(CorrectMPICallFactory().mpi_comm_group())
cmpicf = CorrectMPICallFactory()
cmpicf = CorrectMPICallFactory()
call_creator_function = getattr(cmpicf, comm_to_use)
call = call_creator_function()
call.set_arg("newcomm", "&" + comm_to_use)
if comm_to_use.startswith("mpi_comm_i"):
call.set_arg("request", "&comm_create_req")
if comm_to_use in ["mpi_comm_create","mpi_comm_create_group"]:
call.set_arg("group", "group") # not &group
b.register_operation(call)
if comm_to_use.startswith("mpi_comm_i"):
b.register_operation(MPICallFactory().mpi_wait("&comm_create_req", "MPI_STATUS_IGNORE"))
if comm_to_use in ["mpi_comm_create","mpi_comm_create_group"]:
b.register_operation(cmpicf.mpi_group_free())
tm.insert_block(b, block_name="alloc")
error_string = "ParamMatching"
if comm_to_use in self.invalid_comm:
error_string = "InvalidParam"
......@@ -100,7 +105,6 @@ class InvalidCommErrorP2P(ErrorGenerator):
else:
tm.set_description(error_string + "-Comm-" + send_func, "Invalid Rank: %s" % comm_to_use)
if check_receive:
tm.get_block("MPICALL").get_operation(kind=0, index=0).set_arg("comm", comm_to_use)
tm.get_block("MPICALL").get_operation(kind=0, index=0).set_has_error()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment