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

Added Local Concurrency generator

parent 0743c3ca
No related branches found
No related tags found
1 merge request!6More Work on infrastructure IV
#! /usr/bin/python3
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
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
from itertools import chain
from scripts.Infrastructure.Variables import ERROR_MARKER_COMMENT
sendrecv_funcs = ["mpi_sendrecv", "mpi_sendrecv_replace"]
class LocalConcurrencyErrorP2P(ErrorGenerator):
functions_to_check = [ "mpi_irecv",
"mpi_isend", "mpi_issend", "mpi_irsend", "mpi_ibsend",
"mpi_send_init", "mpi_ssend_init", "mpi_bsend_init", "mpi_rsend_init", "mpi_psend_init",
"mpi_precv_init", "mpi_recv_init"
]
recv_funcs = ["mpi_irecv", "mpi_recv_init", "mpi_precv_init"]
def __init__(self):
pass
def get_num_errors(self):
# send + receive = only check the first two functions
return 1 * 2
# the number of errors to produce in the extended mode (all possible combinations)
def get_num_errors_extended(self):
return 1 * len(self.functions_to_check)
def get_feature(self):
return ["P2P"]
def generate(self, i):
send_func = self.functions_to_check[i]
check_receive = False
recv_func = "mpi_irecv"
if send_func in self.recv_funcs:
check_receive = True
recv_func = send_func
send_func = "mpi_isend"
tm = get_send_recv_template(send_func, recv_func)
if check_receive:
tm.set_description("LocalConcurrency-receive-" + recv_func,
"usage of receive buffer before operation is completed")
else:
tm.set_description("LocalConcurrency-send-" + send_func,
"usage of send buffer before operation is completed")
if check_receive:
tm.get_block("MPICALL").get_operation(kind=0, index=0).set_has_error()
tm.get_block("MPICALL").register_operation("buf[2]=1;" + ERROR_MARKER_COMMENT, kind=1)
else:
tm.get_block("MPICALL").get_operation(kind=1, index=0).set_has_error()
tm.get_block("MPICALL").register_operation("buf[2]=1;" + ERROR_MARKER_COMMENT, kind=1)
return tm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment