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

added possibility to use Isend/Irecv

parent a8e371ba
Branches
No related tags found
1 merge request!4Devel tj
...@@ -40,6 +40,8 @@ class CorrectParameterFactory: ...@@ -40,6 +40,8 @@ class CorrectParameterFactory:
return "MPI_STATUS_IGNORE" return "MPI_STATUS_IGNORE"
if param == "OPERATION" or param == "op": if param == "OPERATION" or param == "op":
return "MPI_SUM" return "MPI_SUM"
if param=="REQUEST" or param == "request":
return "&request"
print("Not Implemented: " + param) print("Not Implemented: " + param)
assert False, "Param not known" assert False, "Param not known"
......
...@@ -25,8 +25,8 @@ def get_send_recv_template(send_func, recv_func): ...@@ -25,8 +25,8 @@ def get_send_recv_template(send_func, recv_func):
The function is contained in a block named MPICALL with seperate calls for rank 1 and 2) The function is contained in a block named MPICALL with seperate calls for rank 1 and 2)
""" """
assert send_func == "mpi_send" or send_func == "mpi_ssend" assert send_func == "mpi_send" or send_func == "mpi_ssend" or send_func == "mpi_isend"
assert recv_func == "mpi_recv" assert recv_func == "mpi_recv" or recv_func == "mpi_irecv"
tm = TemplateManager() tm = TemplateManager()
cf = CorrectParameterFactory() cf = CorrectParameterFactory()
...@@ -39,14 +39,32 @@ def get_send_recv_template(send_func, recv_func): ...@@ -39,14 +39,32 @@ def get_send_recv_template(send_func, recv_func):
recv_func_creator_function = getattr(cmpicf, recv_func) recv_func_creator_function = getattr(cmpicf, recv_func)
r = recv_func_creator_function() r = recv_func_creator_function()
if send_func.startswith("mpi_i") or recv_func.startswith("mpi_i"):
b = InstructionBlock("MPI_REQUEST")
b.register_operation("MPI_Request request;", 'all')
tm.register_instruction_block(b)
b = InstructionBlock("MPICALL") b = InstructionBlock("MPICALL")
b.register_operation(s, 1) b.register_operation(s, 1)
b.register_operation(r, 0) b.register_operation(r, 0)
tm.register_instruction_block(b)
if send_func.startswith("mpi_i"):
b = InstructionBlock("WAIT")
b.register_operation(CorrectMPICallFactory().mpi_wait(), 1)
tm.register_instruction_block(b)
if recv_func.startswith("mpi_i"):
b = InstructionBlock("WAIT")
b.register_operation(CorrectMPICallFactory().mpi_wait(), 2)
tm.register_instruction_block(b) tm.register_instruction_block(b)
return tm return tm
def get_collective_template(collective_func, seperate=True): def get_collective_template(collective_func, seperate=True):
""" """
Contructs a default template for the given mpi collecive Contructs a default template for the given mpi collecive
......
...@@ -10,12 +10,14 @@ from scripts.Infrastructure.TemplateFactory import get_send_recv_template, get_c ...@@ -10,12 +10,14 @@ from scripts.Infrastructure.TemplateFactory import get_send_recv_template, get_c
class InvalidRankErrorP2P(ErrorGenerator): class InvalidRankErrorP2P(ErrorGenerator):
invalid_ranks = ["-1", "size", "MPI_PROC_NULL"] invalid_ranks = ["-1", "size", "MPI_PROC_NULL"]
send_funcs=["mpi_send","mpi_isend"]
recv_funcs = ["mpi_recv", "mpi_irecv"]
def __init__(self): def __init__(self):
pass pass
def get_num_errors(self): def get_num_errors(self):
return len(self.invalid_ranks) return len(self.invalid_ranks)* len(self.send_funcs)
# the number of errors to produce in the extended mode (all possible combinations) # the number of errors to produce in the extended mode (all possible combinations)
def get_num_errors_extended(self): def get_num_errors_extended(self):
...@@ -25,8 +27,9 @@ class InvalidRankErrorP2P(ErrorGenerator): ...@@ -25,8 +27,9 @@ class InvalidRankErrorP2P(ErrorGenerator):
return ["P2P"] return ["P2P"]
def generate(self, i): def generate(self, i):
rank_to_use = self.invalid_ranks[i] rank_to_use = self.invalid_ranks[i // len(self.send_funcs)]
tm = get_send_recv_template("mpi_send", "mpi_recv") send_func = self.send_funcs[i % len(self.send_funcs)]
tm = get_send_recv_template(send_func, "mpi_recv")
tm.set_description("InvalidParam-Rank-MPI_Send", "Invalid Rank: %s" % rank_to_use) tm.set_description("InvalidParam-Rank-MPI_Send", "Invalid Rank: %s" % rank_to_use)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment