From ab03453541aed7e6feefda18295987060dd14376 Mon Sep 17 00:00:00 2001 From: Tim Jammer <tim.jammer@tu-darmstadt.de> Date: Thu, 2 May 2024 20:04:47 +0200 Subject: [PATCH] updated coll cases to match infrastructure, format code --- scripts/errors/coll/CallOrdering.py | 30 ++++++++++++--------- scripts/errors/coll/Correct.py | 20 ++++++++------ scripts/errors/coll/InvalidComm.py | 27 +++++++++++-------- scripts/errors/coll/InvalidOp.py | 11 ++++---- scripts/errors/coll/InvalidRank.py | 9 ++++--- scripts/errors/coll/InvalidType.py | 21 ++++++++------- scripts/errors/coll/LocalConcurrency.py | 20 +++++++------- scripts/errors/coll/ParamMatching.py | 35 ++++++++++++++----------- scripts/errors/coll/RequestLifeCycle.py | 16 ++++++----- 9 files changed, 106 insertions(+), 83 deletions(-) diff --git a/scripts/errors/coll/CallOrdering.py b/scripts/errors/coll/CallOrdering.py index 0069b7e4e..4f9518fac 100644 --- a/scripts/errors/coll/CallOrdering.py +++ b/scripts/errors/coll/CallOrdering.py @@ -6,46 +6,50 @@ from scripts.Infrastructure.Instruction import Instruction 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 +from scripts.Infrastructure.TemplateFactory import get_send_recv_template, get_collective_template, \ + get_two_collective_template + class InvalidRankErrorColl(ErrorGenerator): - 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" ] - functions_not_supported_yet = ["mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] - #need_buf_funcs = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter", "mpi_reduce_scatter_block"] - + 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"] + functions_not_supported_yet = ["mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", + "mpi_reduce_scatter", "mpi_scatterv"] + + # need_buf_funcs = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter", "mpi_reduce_scatter_block"] + def __init__(self): pass - def get_feature(self): return ["COLL"] - def generate(self, generate_level, real_world_score_table): for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) - tm.set_description("CallOrdering-unmatched-"+func_to_use, func_to_use+" is not called by all processes") + tm.set_description("CallOrdering-unmatched-" + func_to_use, func_to_use + " is not called by all processes") for call in tm.get_instruction("MPICALL", return_list=True): - call.set_rank_executing(0) # do the same for wait function + call.set_rank_executing(0) # do the same for wait function call.set_has_error() yield tm - for func1 in self.functions_to_use: for func2 in self.functions_to_use: # this generates func1-func2 and func2-func1 -> we need to remove similar cases tm = get_two_collective_template(func1, func2) - tm.set_description("CallOrdering-unmatched-"+func1+"-"+func2, "Collective mismatch: "+func1+" is matched with "+func2) + tm.set_description("CallOrdering-unmatched-" + func1 + "-" + func2, + "Collective mismatch: " + func1 + " is matched with " + func2) for call in tm.get_instruction("MPICALL", return_list=True): call.set_has_error() - if func1 != func2: # we want different functions + if func1 != func2: # we want different functions yield tm - if not generate_level <= BASIC_TEST_LEVEL: return diff --git a/scripts/errors/coll/Correct.py b/scripts/errors/coll/Correct.py index 4201aa665..07cd7cbcb 100644 --- a/scripts/errors/coll/Correct.py +++ b/scripts/errors/coll/Correct.py @@ -6,43 +6,47 @@ from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICall from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv from scripts.Infrastructure.Template import TemplateManager from scripts.Infrastructure.TemplateFactory import get_collective_template, get_two_collective_template +from scripts.Infrastructure.Variables import * + class CorrectColl(ErrorGenerator): - 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"] + 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"] functions_not_supported_yet = ["mpi_gatherv", "mpi_scatterv", "mpi_igatherv", "mpi_iscatterv"] topology_functions = ["mpi_cart_create"] def __init__(self): pass - def get_feature(self): return ["COLL"] - def generate(self, generate_full_set): + def generate(self, generate_level, real_world_score_table): # Only one function called by all processes for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) - tm.set_description("Correct-"+func_to_use, "Correct code") + tm.set_description("Correct-" + func_to_use, "Correct code") yield tm # Separate function called depending of process ID for func_to_use in self.functions_to_use: tm = get_two_collective_template(func_to_use, func_to_use) - tm.set_description("Correct-"+func_to_use+"-"+func_to_use, "Correct code") + tm.set_description("Correct-" + func_to_use + "-" + func_to_use, "Correct code") yield tm # Generate scenarios with topology functions for func_to_use in self.topology_functions: tm = get_collective_template(func_to_use) - tm.set_description("Correct-"+func_to_use, "Correct code") + tm.set_description("Correct-" + func_to_use, "Correct code") yield tm - tm.set_description("Correct-"+func_to_use+"-mpi_cart_get", "Correct code") + tm.set_description("Correct-" + func_to_use + "-mpi_cart_get", "Correct code") cart_get = CorrectMPICallFactory().mpi_cart_get() cart_get.set_arg("comm_cart", "mpi_comm_0") tm.register_instruction(cart_get) yield tm - if not generate_full_set: + if generate_level >= BASIC_TEST_LEVEL: return diff --git a/scripts/errors/coll/InvalidComm.py b/scripts/errors/coll/InvalidComm.py index cba77b168..c1546c794 100644 --- a/scripts/errors/coll/InvalidComm.py +++ b/scripts/errors/coll/InvalidComm.py @@ -1,13 +1,19 @@ #! /usr/bin/python3 +from scripts.Infrastructure.MPICallFactory import CorrectMPICallFactory from scripts.Infrastructure.Variables import * from scripts.Infrastructure.ErrorGenerator import ErrorGenerator -from scripts.Infrastructure.TemplateFactory import get_collective_template +from scripts.Infrastructure.TemplateFactory import get_collective_template + class InvalidComErrorColl(ErrorGenerator): invalid_com = ["MPI_COMM_NULL", "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_cart_create" ] - functions_not_supported_yet = ["mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] + 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_cart_create"] + 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"] topology_functions = ["mpi_cart_create"] @@ -18,11 +24,11 @@ class InvalidComErrorColl(ErrorGenerator): return ["COLL"] def generate(self, generate_level, real_world_score_table): - for com_to_use in self.invalid_com: + for com_to_use in self.invalid_com: for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) - - tm.set_description("InvalidParam-Comm-"+func_to_use, "Invalid communicator: %s" % com_to_use) + + tm.set_description("InvalidParam-Comm-" + func_to_use, "Invalid communicator: %s" % com_to_use) for call in tm.get_instruction("MPICALL", return_list=True): arg_to_replace = "comm" if call.has_arg("comm") else "comm_old" call.set_arg(arg_to_replace, com_to_use) @@ -30,14 +36,14 @@ class InvalidComErrorColl(ErrorGenerator): yield tm - for fun_to_use in self.topology_functions: tm = get_collective_template(func_to_use) - for com_to_use in ["MPI_COMM_NULL", "NULL", "MPI_COMM_WORLD"]: - tm.set_description("InvalidParam-Comm-"+func_to_use+"-mpi_cart_get", "A function tries to get cartesian information of "+com_to_use) + for com_to_use in ["MPI_COMM_NULL", "NULL", "MPI_COMM_WORLD"]: + tm.set_description("InvalidParam-Comm-" + func_to_use + "-mpi_cart_get", + "A function tries to get cartesian information of " + com_to_use) - cart_get = CorrectMPICallFactory().mpi_cart_get() + cart_get = CorrectMPICallFactory.mpi_cart_get() cart_get.set_arg("comm_cart", com_to_use) tm.register_instruction(cart_get) cart_get.set_has_error() @@ -46,4 +52,3 @@ class InvalidComErrorColl(ErrorGenerator): # only check for one comm if generate_level <= BASIC_TEST_LEVEL: return - diff --git a/scripts/errors/coll/InvalidOp.py b/scripts/errors/coll/InvalidOp.py index aeb9e7321..891f56a10 100644 --- a/scripts/errors/coll/InvalidOp.py +++ b/scripts/errors/coll/InvalidOp.py @@ -2,14 +2,14 @@ from scripts.Infrastructure.Variables import * from scripts.Infrastructure.ErrorGenerator import ErrorGenerator -from scripts.Infrastructure.TemplateFactory import get_collective_template +from scripts.Infrastructure.TemplateFactory import get_collective_template + class InvalidComErrorColl(ErrorGenerator): invalid_op = ["MPI_OP_NULL"] functions_to_use = ["mpi_reduce", "mpi_ireduce", "mpi_allreduce", "mpi_iallreduce"] - #TODO invalid op+ type combinations aka MPI_MAXLOC with MPI_BYTE or something klie this - + # TODO invalid op+ type combinations aka MPI_MAXLOC with MPI_BYTE or something klie this def __init__(self): pass @@ -18,10 +18,10 @@ class InvalidComErrorColl(ErrorGenerator): return ["COLL"] def generate(self, generate_level, real_world_score_table): - for op_to_use in self.invalid_op: + for op_to_use in self.invalid_op: for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) - tm.set_description("InvalidParam-Op-"+func_to_use, "Invalid operator: %s" % op_to_use) + tm.set_description("InvalidParam-Op-" + func_to_use, "Invalid operator: %s" % op_to_use) for call in tm.get_instruction("MPICALL", return_list=True): call.set_arg("op", op_to_use) @@ -31,4 +31,3 @@ class InvalidComErrorColl(ErrorGenerator): # only check for one comm if generate_level <= BASIC_TEST_LEVEL: return - diff --git a/scripts/errors/coll/InvalidRank.py b/scripts/errors/coll/InvalidRank.py index 2b8583fe7..4eccd286f 100644 --- a/scripts/errors/coll/InvalidRank.py +++ b/scripts/errors/coll/InvalidRank.py @@ -2,17 +2,18 @@ from scripts.Infrastructure.Variables import * from scripts.Infrastructure.ErrorGenerator import ErrorGenerator -from scripts.Infrastructure.TemplateFactory import get_collective_template +from scripts.Infrastructure.TemplateFactory import get_collective_template + class InvalidRankErrorColl(ErrorGenerator): invalid_ranks = ["-1", "nprocs", "MPI_PROC_NULL"] - functions_to_use = ["mpi_reduce", "mpi_bcast", "mpi_gather", "mpi_scatter", "mpi_ireduce", "mpi_ibcast", "mpi_igather", "mpi_iscatter"] + functions_to_use = ["mpi_reduce", "mpi_bcast", "mpi_gather", "mpi_scatter", "mpi_ireduce", "mpi_ibcast", + "mpi_igather", "mpi_iscatter"] functions_not_supported_yet = ["mpi_gatherv", "mpi_scatterv", "mpi_igatherv", "mpi_iscatterv"] def __init__(self): pass - def get_feature(self): return ["COLL"] @@ -22,7 +23,7 @@ class InvalidRankErrorColl(ErrorGenerator): for rank_to_use in self.invalid_ranks: tm = get_collective_template(func_to_use) - tm.set_description("InvalidParam-Rank-"+func_to_use, "Invalid Rank: %s" % rank_to_use) + tm.set_description("InvalidParam-Rank-" + func_to_use, "Invalid Rank: %s" % rank_to_use) for call in tm.get_instruction("MPICALL", return_list=True): call.set_arg("root", rank_to_use) call.set_has_error() diff --git a/scripts/errors/coll/InvalidType.py b/scripts/errors/coll/InvalidType.py index a1ea8b436..934a51efe 100644 --- a/scripts/errors/coll/InvalidType.py +++ b/scripts/errors/coll/InvalidType.py @@ -8,12 +8,16 @@ from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory from scripts.Infrastructure.Template import TemplateManager from scripts.Infrastructure.TemplateFactory import get_collective_template -class InvalidComErrorColl(ErrorGenerator): - invalid_type = ["MPI_DATATYPE_NULL","NULL"] - functions_to_use = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter" ] - func_one_type_arg = ["mpi_bcast", "mpi_reduce", "mpi_exscan", "mpi_scan", "mpi_ibcast", "mpi_ireduce", "mpi_iscan", "mpi_allreduce", "mpi_iallreduce" ] - functions_not_supported_yet = ["mpi_reduce_scatter_block", "mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] +class InvalidComErrorColl(ErrorGenerator): + invalid_type = ["MPI_DATATYPE_NULL", "NULL"] + functions_to_use = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", + "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", + "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter"] + func_one_type_arg = ["mpi_bcast", "mpi_reduce", "mpi_exscan", "mpi_scan", "mpi_ibcast", "mpi_ireduce", "mpi_iscan", + "mpi_allreduce", "mpi_iallreduce"] + functions_not_supported_yet = ["mpi_reduce_scatter_block", "mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", + "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] def __init__(self): pass @@ -25,12 +29,12 @@ class InvalidComErrorColl(ErrorGenerator): for type_to_use in self.invalid_type: for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) - tm.set_description("InvalidParam-Type-"+func_to_use, "Invalid datatype: %s" % type_to_use) + tm.set_description("InvalidParam-Type-" + func_to_use, "Invalid datatype: %s" % type_to_use) if func_to_use in self.func_one_type_arg: for call in tm.get_instruction("MPICALL", return_list=True): - #if call.has_arg("recvtype"): # sendtype - #call.set_arg("recvtype", type_to_use) + # if call.has_arg("recvtype"): # sendtype + # call.set_arg("recvtype", type_to_use) call.set_arg("datatype", type_to_use) call.set_has_error() yield tm @@ -38,4 +42,3 @@ class InvalidComErrorColl(ErrorGenerator): # only check for one comm if generate_level <= BASIC_TEST_LEVEL: return - diff --git a/scripts/errors/coll/LocalConcurrency.py b/scripts/errors/coll/LocalConcurrency.py index 811ce739c..af576f06a 100644 --- a/scripts/errors/coll/LocalConcurrency.py +++ b/scripts/errors/coll/LocalConcurrency.py @@ -6,32 +6,32 @@ from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICall from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get_matching_recv from scripts.Infrastructure.Template import TemplateManager from scripts.Infrastructure.TemplateFactory import get_collective_template +from scripts.Infrastructure.Variables import * + class InvalidRankErrorColl(ErrorGenerator): - nbfunc_to_use = ["mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", "mpi_igather", "mpi_iscan" ] - + nbfunc_to_use = ["mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", "mpi_igather", + "mpi_iscan"] + def __init__(self): pass - def get_feature(self): return ["COLL"] - - def generate(self, generate_full_set): + def generate(self, generate_level, real_world_score_table): for func_to_use in self.nbfunc_to_use: tm = get_collective_template(func_to_use) - tm.set_description("LocalConcurrency-"+func_to_use, "Usage of buffer before operation is completed") + tm.set_description("LocalConcurrency-" + func_to_use, "Usage of buffer before operation is completed") conflicting_inst = Instruction("buf[2]=1;") conflicting_inst.set_has_error() wait = tm.get_instruction("WAIT", return_list=True) - tm.insert_instruction(conflicting_inst,before_instruction=wait) - + tm.insert_instruction(conflicting_inst, before_instruction=wait) yield tm - if not generate_full_set: - return \ No newline at end of file + if generate_level >= BASIC_TEST_LEVEL: + return diff --git a/scripts/errors/coll/ParamMatching.py b/scripts/errors/coll/ParamMatching.py index 6bfb81352..5a8c297e9 100644 --- a/scripts/errors/coll/ParamMatching.py +++ b/scripts/errors/coll/ParamMatching.py @@ -7,12 +7,18 @@ from scripts.Infrastructure.CorrectParameter import CorrectParameterFactory, get from scripts.Infrastructure.Template import TemplateManager from scripts.Infrastructure.TemplateFactory import get_collective_template, get_two_collective_template + class InvalidComErrorColl(ErrorGenerator): - functions_to_use = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter" ] - func_with_one_type_arg = ["mpi_bcast", "mpi_reduce", "mpi_exscan", "mpi_scan", "mpi_ibcast", "mpi_ireduce", "mpi_iscan", "mpi_allreduce", "mpi_iallreduce" ] - functions_not_supported_yet = ["mpi_reduce_scatter_block", "mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] - func_with_op = ["mpi_reduce", "mpi_ireduce", "mpi_allreduce", "mpi_iallreduce"] - func_with_root = ["mpi_reduce", "mpi_bcast", "mpi_gather", "mpi_scatter", "mpi_ireduce", "mpi_ibcast", "mpi_igather", "mpi_iscatter"] + functions_to_use = ["mpi_bcast", "mpi_ibcast", "mpi_reduce", "mpi_ireduce", "mpi_exscan", "mpi_scan", "mpi_iscan", + "mpi_gather", "mpi_igather", "mpi_allgather", "mpi_iallgather", "mpi_allreduce", + "mpi_iallreduce", "mpi_alltoall", "mpi_ialltoall", "mpi_scatter", "mpi_iscatter"] + func_with_one_type_arg = ["mpi_bcast", "mpi_reduce", "mpi_exscan", "mpi_scan", "mpi_ibcast", "mpi_ireduce", + "mpi_iscan", "mpi_allreduce", "mpi_iallreduce"] + functions_not_supported_yet = ["mpi_reduce_scatter_block", "mpi_allgatherv", "mpi_alltoallv", "mpi_alltoallw", + "mpi_gatherv", "mpi_reduce_scatter", "mpi_scatterv"] + func_with_op = ["mpi_reduce", "mpi_ireduce", "mpi_allreduce", "mpi_iallreduce"] + func_with_root = ["mpi_reduce", "mpi_bcast", "mpi_gather", "mpi_scatter", "mpi_ireduce", "mpi_ibcast", + "mpi_igather", "mpi_iscatter"] def __init__(self): pass @@ -20,13 +26,13 @@ class InvalidComErrorColl(ErrorGenerator): def get_feature(self): return ["COLL"] - def generate(self, generate_full_set): + def generate(self, generate_level, real_world_score_table): # Generate codes with type mismatch for func_to_use in self.func_with_one_type_arg: tm = get_collective_template(func_to_use) - type_to_use = "MPI_DOUBLE" # this could be a list of types - tm.set_description("ParamMatching-Type-"+func_to_use, "Wrong datatype matching") + type_to_use = "MPI_DOUBLE" # this could be a list of types + tm.set_description("ParamMatching-Type-" + func_to_use, "Wrong datatype matching") for call in tm.get_instruction("MPICALL", return_list=True): call.set_rank_executing(0) call.set_arg("datatype", type_to_use) @@ -41,8 +47,8 @@ class InvalidComErrorColl(ErrorGenerator): # Generate codes with op mismatch for func_to_use in self.func_with_op: tm = get_collective_template(func_to_use) - op_to_use = "MPI_MAX" # this could be a list of op - tm.set_description("ParamMatching-Op-"+func_to_use, "Wrong operation matching") + op_to_use = "MPI_MAX" # this could be a list of op + tm.set_description("ParamMatching-Op-" + func_to_use, "Wrong operation matching") for call in tm.get_instruction("MPICALL", return_list=True): call.set_rank_executing(0) @@ -58,8 +64,8 @@ class InvalidComErrorColl(ErrorGenerator): # Generate codes with root mismatch for func_to_use in self.func_with_root: tm = get_collective_template(func_to_use) - rank_to_use = "rank" # process ID, declared in the template - tm.set_description("ParamMatching-Root-"+func_to_use, "Wrong root matching") + rank_to_use = "rank" # process ID, declared in the template + tm.set_description("ParamMatching-Root-" + func_to_use, "Wrong root matching") for call in tm.get_instruction("MPICALL", return_list=True): call.set_rank_executing(0) @@ -73,11 +79,11 @@ class InvalidComErrorColl(ErrorGenerator): for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) com_to_use = "MPI_COMM_SELF" - tm.set_description("ParamMatching-Com-"+func_to_use, "Wrong communicator matching") + tm.set_description("ParamMatching-Com-" + func_to_use, "Wrong communicator matching") for call in tm.get_instruction("MPICALL", return_list=True): call.set_rank_executing(0) - call.set_arg("comm", com_to_use) + call.set_arg("comm", com_to_use) call.set_has_error() c = CorrectMPICallFactory.get(func_to_use) c.set_rank_executing('not0') @@ -88,4 +94,3 @@ class InvalidComErrorColl(ErrorGenerator): if not generate_full_set: return - diff --git a/scripts/errors/coll/RequestLifeCycle.py b/scripts/errors/coll/RequestLifeCycle.py index f90d0ff6f..691e4c641 100644 --- a/scripts/errors/coll/RequestLifeCycle.py +++ b/scripts/errors/coll/RequestLifeCycle.py @@ -6,25 +6,27 @@ from scripts.Infrastructure.MPICallFactory import MPICallFactory, CorrectMPICall 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 +from scripts.Infrastructure.Variables import * + class CorrectColl(ErrorGenerator): - nbfunc_to_use = ["mpi_ibarrier", "mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", "mpi_igather", "mpi_iscan" ] + nbfunc_to_use = ["mpi_ibarrier", "mpi_iallreduce", "mpi_ialltoall", "mpi_ibcast", "mpi_ireduce", "mpi_iscatter", + "mpi_igather", "mpi_iscan"] functions_not_supported_yet = ["mpi_igatherv", "mpi_iscatterv"] def __init__(self): pass - def get_feature(self): return ["COLL"] - - def generate(self, generate_full_set): + def generate(self, generate_level, real_world_score_table): for func_to_use in self.nbfunc_to_use: tm = get_collective_template(func_to_use) - tm.set_description("RequestLifeCycle-"+func_to_use, func_to_use+" is not associated with a completion operation (missing wait)") + tm.set_description("RequestLifeCycle-" + func_to_use, + func_to_use + " is not associated with a completion operation (missing wait)") for call in tm.get_instruction("MPICALL", return_list=True): wait = tm.get_instruction("WAIT", return_list=True) @@ -33,5 +35,5 @@ class CorrectColl(ErrorGenerator): yield tm - if not generate_full_set: - return \ No newline at end of file + if generate_level >= BASIC_TEST_LEVEL: + return -- GitLab