Skip to content
Snippets Groups Projects

P2P

Open
Jammer, Timrequested to merge
p2p into main
1 file
+ 18
16
Compare changes
  • Side-by-side
  • Inline
+ 18
16
@@ -13,7 +13,7 @@ from itertools import chain
class InvalidBufErrorP2P(ErrorGenerator):
invalid_bufs = [CorrectParameterFactory().buf_var_name, "NULL"]
invalid_bufs = [ "NULL", 'MPI_BOTTOM', 'MPI_IN_PLACE']
send_funcs = ["mpi_send",
"mpi_isend", "mpi_ssend", "mpi_issend", "mpi_rsend", "mpi_irsend", "mpi_bsend", "mpi_ibsend",
"mpi_send_init", "mpi_ssend_init", "mpi_bsend_init", "mpi_rsend_init", "mpi_psend_init",
@@ -40,9 +40,10 @@ class InvalidBufErrorP2P(ErrorGenerator):
send_func = func
recv_func = "mpi_irecv"
tm = get_invalid_param_p2p_case("buf", "NULL", check_recv, send_func, recv_func)
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: NULL")
yield tm
for buf_to_use in self.invalid_bufs:
tm = get_invalid_param_p2p_case("buf", buf_to_use, check_recv, send_func, recv_func)
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: "+buf_to_use)
yield tm
tm = get_invalid_param_p2p_case("buf", "not_allocated", check_recv, send_func, recv_func)
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: Not allocated")
@@ -63,12 +64,13 @@ class InvalidBufErrorP2P(ErrorGenerator):
return
for func in ["mpi_mrecv", "mpi_imrecv"]:
tm = get_send_recv_template("mpi_isend", ["mpi_mprobe", func])
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: NULL")
for call in tm.get_instruction(identifier="MATCHEDRECEIVE", return_list=True):
call.set_arg("buf", "NULL")
call.set_has_error()
yield tm
for buf_to_use in self.invalid_bufs:
tm = get_send_recv_template("mpi_isend", ["mpi_mprobe", func])
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: "+buf_to_use)
for call in tm.get_instruction(identifier="MATCHEDRECEIVE", return_list=True):
call.set_arg("buf", buf_to_use)
call.set_has_error()
yield tm
tm = get_send_recv_template("mpi_isend", ["mpi_mprobe", func])
tm.set_description("InvalidParam-Buffer-" + func, "Invalid Buffer: Not allocated")
@@ -163,17 +165,17 @@ class Overlapping_buf(ErrorGenerator):
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"
# 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")
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)#
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)
@@ -184,7 +186,7 @@ class Overlapping_buf(ErrorGenerator):
return
tm.set_description("LocalConcurrency-" + recv_func, "partially overlapping recv buffers")
recv.set_arg("count", buf_len +"/2")
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]")
second_recv.set_arg("buf", "&" + buf_var + "[" + buf_len + "/4]")
yield tm
Loading