Skip to content
Snippets Groups Projects

P2P

Open
Jammer, Timrequested to merge
p2p into main
1 file
+ 38
0
Compare changes
  • Side-by-side
  • Inline
+ 38
0
#! /usr/bin/python3
from copy import copy
from scripts.Infrastructure.AllocCall import AllocCall
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
from scripts.Infrastructure.Instruction import Instruction
@@ -150,3 +152,39 @@ class MessageRaceErrorSendRecv(ErrorGenerator):
tm.remove_instruction(identifier="FREE")
tm.insert_instruction(call_list, before_instruction="MPICALL", before_first_of_list=True)
yield tm
class Overlapping_buf(ErrorGenerator):
def __init__(self):
pass
def get_feature(self):
return ["P2P"]
def generate(self, generate_full_set):
#TODO this case for recv_init, imrecv and precv_init in all combinations?
recv_func ="mpi_irecv"
tm = get_send_recv_template("mpi_send", recv_func)
tm.set_description("LocalConcurrency-"+recv_func, "Overlapping recv buffers")
recv = tm.get_instruction(identifier="MPICALL", rank_excuting=0)
buf_var = recv.get_arg("buf")
buf_len = recv.get_arg("count")
second_recv = copy(recv)
req = tm.add_stack_variable("MPI_Request")
second_recv.set_arg("request", "&" + req)
tm.insert_instruction(second_recv, after_instruction=recv)#
wait = tm.get_instruction(identifier="WAIT", rank_excuting=0)
second_wait = copy(wait)
second_wait.set_arg("request", "&" + req)
tm.insert_instruction(second_wait, after_instruction=wait)
yield tm
if not generate_full_set:
return
tm.set_description("LocalConcurrency-" + recv_func, "partially overlapping recv buffers")
recv.set_arg("count", buf_len +"/2")
second_recv.set_arg("count", buf_len + "/2")
second_recv.set_arg("buf", "&"+buf_var + "["+buf_len+"/4]")
yield tm
Loading