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

testcase checks other send /recv modes as well

parent c1f4cfdf
No related branches found
No related tags found
1 merge request!4Devel tj
......@@ -5,36 +5,55 @@ from scripts.Infrastructure.InstructionBlock import InstructionBlock
from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory
from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv
from scripts.Infrastructure.Template import TemplateManager
from scripts.Infrastructure.TemplateFactory import get_send_recv_template, get_collective_template
from scripts.Infrastructure.TemplateFactory import get_send_recv_template
from itertools import chain
class InvalidRankErrorP2P(ErrorGenerator):
invalid_ranks = ["-1", "nprocs", "MPI_PROC_NULL"]
send_funcs=["mpi_send","mpi_isend"]
functions_to_check = ["mpi_send",
"mpi_recv", "mpi_irecv",
"mpi_isend", "mpi_ssend", "mpi_issend"]
recv_funcs = ["mpi_recv", "mpi_irecv"]
def __init__(self):
pass
def get_num_errors(self):
return len(self.invalid_ranks)* len(self.send_funcs)
# send + receive = only check the first two functions
return len(self.invalid_ranks) * 2
# the number of errors to produce in the extended mode (all possible combinations)
def get_num_errors_extended(self):
return len(self.invalid_ranks)
return len(self.invalid_ranks) * len(self.functions_to_check)
def get_feature(self):
return ["P2P"]
def generate(self, i):
rank_to_use = self.invalid_ranks[i // len(self.send_funcs)]
send_func = self.send_funcs[i % len(self.send_funcs)]
tm = get_send_recv_template(send_func, "mpi_recv")
rank_to_use = self.invalid_ranks[i // len(self.functions_to_check)]
send_func = self.functions_to_check[i % len(self.functions_to_check)]
check_receive = False
recv_func = self.recv_funcs[0]
if send_func in self.recv_funcs:
check_receive = True
recv_func = send_func
send_func = "mpi_send"
tm.set_description("InvalidParam-Rank-MPI_Send", "Invalid Rank: %s" % rank_to_use)
tm = get_send_recv_template(send_func, recv_func)
if check_receive:
tm.set_description("InvalidParam-Rank-" + recv_func, "Invalid Rank: %s" % rank_to_use)
else:
tm.set_description("InvalidParam-Rank-" + send_func, "Invalid Rank: %s" % rank_to_use)
if check_receive:
tm.get_block("MPICALL").get_operation(kind=0, index=0).set_arg("source", rank_to_use)
tm.get_block("MPICALL").get_operation(kind=0, index=0).set_has_error()
else:
tm.get_block("MPICALL").get_operation(kind=1, index=0).set_arg("dest", rank_to_use)
tm.get_block("MPICALL").get_operation(kind=1, index=0).set_has_error()
return tm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment