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

used CorrectMPICall Factory in example error case, fix CorrectParameter...

used CorrectMPICall Factory in example error case, fix CorrectParameter factory to at least create params for send and recv
parent 84cc0a60
No related branches found
No related tags found
1 merge request!3more work on infrastructure II
......@@ -20,19 +20,19 @@ class CorrectParameterFactory:
return b
def get(self, param, func=None):
if param == "BUFFER":
if param == "BUFFER" or param == "buf":
return "buf"
if param == "COUNT":
if param == "COUNT" or param == "count":
return str(self.buf_size)
if param == "DATATYPE":
if param == "DATATYPE" or param == "datatype":
return self.dtype[1]
if param == "SRC":
if param == "SRC" or param == "source" or param == "DEST" or param == "dest":
return "0"
if param == "TAG":
if param == "TAG" or param == "tag":
return str(self.tag)
if param == "COMM":
if param == "COMM" or param == "comm":
return "MPI_COMM_WORLD"
if param == "STATUS":
if param == "STATUS" or param == "status":
return "MPI_STATUS_IGNORE"
assert False, "Param not known"
......
......@@ -2,7 +2,7 @@
from scripts.Infrastructure.ErrorGenerator import ErrorGenerator
from scripts.Infrastructure.InstructionBlock import InstructionBlock
from scripts.Infrastructure.MPICallFactory import MPI_Call_Factory
from scripts.Infrastructure.MPICallFactory import MPI_Call_Factory, CorrectMPI_Call_Factory
from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv
from scripts.Infrastructure.Template import TemplateManager
......@@ -33,20 +33,21 @@ class Invalid_negative_rank_error(ErrorGenerator):
tm.register_instruction_block(correct_params.get_buffer_alloc())
send = MPI_Call_Factory().mpi_send(
correct_params.get("BUFFER"),
correct_params.get("COUNT"),
correct_params.get("DATATYPE"),
correct_params.get("buf"),
correct_params.get("count"),
correct_params.get("datatype"),
self.invalid_ranks[i], # invalid rank
correct_params.get("TAG"),
correct_params.get("COMM"),
correct_params.get("tag"),
correct_params.get("comm"),
)
send.set_has_error()
recv = CorrectMPI_Call_Factory().mpi_recv()
b = InstructionBlock()
# only rank 0 execute the send
b.register_operation(send, 0)
# only rank 1 execute the recv
b.register_operation(get_matching_recv(send), 1)
b.register_operation(recv, 1)
tm.register_instruction_block(b)
return tm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment