Skip to content
Snippets Groups Projects

P2P

Open
Jammer, Timrequested to merge
p2p into main
1 file
+ 7
14
Compare changes
  • Side-by-side
  • Inline
#! /usr/bin/python3
#! /usr/bin/python3
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
 
from scripts.Infrastructure.MPICall import MPICall
from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory
from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICallFactory
from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv
from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv
from scripts.Infrastructure.Template import TemplateManager
from scripts.Infrastructure.Template import TemplateManager
@@ -24,14 +25,6 @@ class InvalidRequestErrorP2P(ErrorGenerator):
@@ -24,14 +25,6 @@ class InvalidRequestErrorP2P(ErrorGenerator):
def __init__(self):
def __init__(self):
pass
pass
def get_num_errors(self):
# send + receive = only check the first two functions
return len(self.invalid_requests) * 2
# the number of errors to produce in the extended mode (all possible combinations)
def get_num_errors_extended(self):
return len(self.invalid_requests) * len(self.functions_to_check)
def get_feature(self):
def get_feature(self):
return ["P2P"]
return ["P2P"]
@@ -62,12 +55,12 @@ class InvalidRequestErrorP2P(ErrorGenerator):
@@ -62,12 +55,12 @@ class InvalidRequestErrorP2P(ErrorGenerator):
if check_receive:
if check_receive:
kind = 0
kind = 0
idx = 0
for inst in tm.get_instruction(identifier="MPICALL", return_list=True):
if recv_func == "mpi_imrecv":
if inst.get_rank_executing() == kind:
idx = 1
if isinstance(inst, MPICall) and inst.has_arg("request"):
inst.set_arg("request", req_to_use)
tm.get_block("MPICALL").get_instruction(kind=kind, index=idx).set_arg("request", req_to_use)
#TODO does not work for imrecv case???
tm.get_block("MPICALL").get_instruction(kind=kind, index=idx).set_has_error()
inst.set_has_error()
yield tm
yield tm
Loading