Skip to content
Snippets Groups Projects
Commit 3efddb94 authored by Emmanuelle Saillard's avatar Emmanuelle Saillard
Browse files

added InvalidCom error for usual collectives

parent f603dbf4
No related branches found
No related tags found
No related merge requests found
......@@ -141,6 +141,19 @@ def get_collective_template(collective_func, seperate=True):
call_creator_function = getattr(cmpicf, collective_func)
c = call_creator_function()
if collective_func.startswith("mpi_i"):
b = InstructionBlock("MPI_REQUEST")
b.register_operation("MPI_Request request;", 'all')
tm.register_instruction_block(b)
#### For some collectives, define params: sendcount, recvcounts
if collective_func in ["mpi_gatherv"]:
b = InstructionBlock("recvcounts")
buf_size = "sizeof(int)*10 + MPI_BSEND_OVERHEAD" # to change
b.register_operation(AllocCall("char", buf_size, "mpi_buf")) # to change
b.register_operation(MPICallFactory().mpi_buffer_attach("mpi_buf", buf_size)) # to change
tm.register_instruction_block(b)
b = InstructionBlock("MPICALL")
if seperate:
b.register_operation(c, 1)
......@@ -150,6 +163,13 @@ def get_collective_template(collective_func, seperate=True):
tm.register_instruction_block(b)
if collective_func.startswith("mpi_i"):
b = InstructionBlock("WAIT")
b.register_operation(CorrectMPICallFactory().mpi_wait(), 'all')
tm.register_instruction_block(b)
b.register_operation(cf.get_buffer_free())
return tm
Command to run the script:
PYTHONPATH=../ python main.py
#! /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, get_collective_template
class InvalidComErrorColl(ErrorGenerator):
invalid_com = ["MPI_COMM_NULL"]
functions_to_use = ["mpi_allgather","mpi_allreduce","mpi_alltoall","mpi_barrier","mpi_bcast", "mpi_reduce", "mpi_scatter","mpi_exscan","mpi_gather", "mpi_reduce_scatter_block", "mpi_scan", "mpi_ibarrier", "mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", "mpi_igather", "mpi_iscan", "mpi_gatherv" ]
functions_not_supported_yet = ["mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"]
####functions_to_use = ["mpi_allgather","mpi_allgatherv","mpi_allreduce","mpi_alltoall","mpi_alltoallv","mpi_alltoallw","mpi_barrier","mpi_bcast", "mpi_exscan","mpi_gather", "mpi_gatherv","mpi_reduce", "mpi_reduce_scatter", "mpi_reduce_scatter_block", "mpi_scan", "mpi_scatter", "mpi_scatterv", "mpi_ibarrier", "mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", "mpi_igather", "mpi_iscan"]
def __init__(self):
pass
def get_num_errors(self):
return len(self.invalid_com) * len(self.functions_to_use)
# the number of errors to produce in the extended mode (all possible combinations)
def get_num_errors_extended(self):
return len(self.invalid_com) * len(self.functions_to_use)
def get_feature(self):
return ["COLL"]
def generate(self, i):
com_to_use = self.invalid_com[i // len(self.functions_to_use)]
func_to_use = self.functions_to_use[i % len(self.functions_to_use)]
tm = get_collective_template(func_to_use, seperate=False)
arg_to_replace = "comm"
tm.set_description("InvalidParam-Comm-"+func_to_use, "Invalid communicator: %s" % com_to_use)
tm.get_block("MPICALL").get_operation(kind='all', index=0).set_arg("comm", com_to_use)
tm.get_block("MPICALL").get_operation(kind='all', index=0).set_has_error()
return tm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment