Skip to content
Snippets Groups Projects

P2P

Open
Jammer, Timrequested to merge
p2p into main
1 file
+ 26
36
Compare changes
  • Side-by-side
  • Inline
+ 26
36
@@ -5,7 +5,7 @@ from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
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
from scripts.Infrastructure.TemplateFactory import get_send_recv_template, get_invalid_param_p2p_case
from itertools import chain
@@ -27,25 +27,6 @@ class InvalidRankErrorP2P(ErrorGenerator):
def get_feature(self):
return ["P2P"]
def generate_impl(self, send_func, recv_func, check_receive):
for rank_to_use in self.invalid_ranks:
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_instruction(kind=0, index=0).set_arg("source", rank_to_use)
tm.get_block("MPICALL").get_instruction(kind=0, index=0).set_has_error()
else:
tm.get_block("MPICALL").get_instruction(kind=1, index=0).set_arg("dest", rank_to_use)
tm.get_block("MPICALL").get_instruction(kind=1, index=0).set_has_error()
yield tm
def generate_mprobe(self, send_func, recv_func):
for rank_to_use in self.invalid_ranks:
@@ -84,19 +65,28 @@ class InvalidRankErrorP2P(ErrorGenerator):
yield tm
def generate(self, generate_full_set):
for send_func in self.send_funcs:
yield from self.generate_impl(send_func, "mpi_irecv", False)
if not generate_full_set:
return
for func in self.recv_funcs:
yield from self.generate_impl("mpi_send", func, True)
for func in self.sendrecv_funcs:
yield from self.generate_impl(func, func, True)
yield from self.generate_impl(func, func, False)
for func in self.probe_recv_funcs:
yield from self.generate_mprobe("mpi_send", func)
for func in ["mpi_probe", "mpi_iprobe"]:
yield from self.generate_probe(func)
for func in self.send_funcs+self.recv_funcs:
if func in self.recv_funcs:
check_recv = True
send_func = "mpi_send"
recv_func = func
else:
check_recv = False
send_func = func
recv_func = "mpi_irecv"
for rank_to_use in self.invalid_ranks:
if check_recv:
tm = get_invalid_param_p2p_case("source", rank_to_use, check_recv, send_func, recv_func)
else:
tm = get_invalid_param_p2p_case("dest", rank_to_use, check_recv, send_func, recv_func)
tm.set_description("InvalidParam-Rank-" + func, "Invalid Rank: %s" % rank_to_use)
yield tm
if not generate_full_set:
return
#TODO sendrecv and probe
Loading