From 0dc9c9e3aaae251dfee437f027ffaa9e22eabb98 Mon Sep 17 00:00:00 2001 From: Tim Jammer <tim.jammer@tu-darmstadt.de> Date: Fri, 3 May 2024 13:02:51 +0200 Subject: [PATCH] limnit amount of cases in BASIC level, where each error is supposed to be included only once --- scripts/errors/coll/Correct.py | 9 ++++++--- scripts/errors/coll/InvalidComm.py | 3 ++- scripts/errors/coll/InvalidOp.py | 5 ++--- scripts/errors/coll/InvalidRank.py | 4 ++-- scripts/errors/coll/InvalidType.py | 5 ++--- scripts/errors/coll/ParamMatching.py | 15 +++++++++------ 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/scripts/errors/coll/Correct.py b/scripts/errors/coll/Correct.py index 59b2d4d19..57fce928a 100644 --- a/scripts/errors/coll/Correct.py +++ b/scripts/errors/coll/Correct.py @@ -30,12 +30,16 @@ class CorrectColl(ErrorGenerator): tm = get_collective_template(func_to_use) tm.set_description("Correct-" + func_to_use, "Correct code") yield tm + if generate_level <= BASIC_TEST_LEVEL: + break # Separate function called depending on 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") yield tm + if generate_level <= BASIC_TEST_LEVEL: + break # Generate scenarios with topology functions for func_to_use in self.topology_functions: @@ -47,6 +51,5 @@ class CorrectColl(ErrorGenerator): cart_get.set_arg("comm_cart", "mpi_comm_0") tm.register_instruction(cart_get) yield tm - - if generate_level >= BASIC_TEST_LEVEL: - return + if generate_level <= BASIC_TEST_LEVEL: + break diff --git a/scripts/errors/coll/InvalidComm.py b/scripts/errors/coll/InvalidComm.py index c1546c794..618fd1f16 100644 --- a/scripts/errors/coll/InvalidComm.py +++ b/scripts/errors/coll/InvalidComm.py @@ -35,6 +35,8 @@ class InvalidComErrorColl(ErrorGenerator): call.set_has_error() yield tm + if generate_level <= BASIC_TEST_LEVEL: + break for fun_to_use in self.topology_functions: tm = get_collective_template(func_to_use) @@ -49,6 +51,5 @@ class InvalidComErrorColl(ErrorGenerator): cart_get.set_has_error() yield tm - # 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 891f56a10..d39708985 100644 --- a/scripts/errors/coll/InvalidOp.py +++ b/scripts/errors/coll/InvalidOp.py @@ -28,6 +28,5 @@ class InvalidComErrorColl(ErrorGenerator): call.set_has_error() yield tm - # only check for one comm - if generate_level <= BASIC_TEST_LEVEL: - return + if generate_level <= BASIC_TEST_LEVEL: + return diff --git a/scripts/errors/coll/InvalidRank.py b/scripts/errors/coll/InvalidRank.py index 4eccd286f..720b5c783 100644 --- a/scripts/errors/coll/InvalidRank.py +++ b/scripts/errors/coll/InvalidRank.py @@ -29,5 +29,5 @@ class InvalidRankErrorColl(ErrorGenerator): call.set_has_error() yield tm - if generate_level <= BASIC_TEST_LEVEL: - return + if generate_level <= BASIC_TEST_LEVEL: + return diff --git a/scripts/errors/coll/InvalidType.py b/scripts/errors/coll/InvalidType.py index 934a51efe..a79d5f276 100644 --- a/scripts/errors/coll/InvalidType.py +++ b/scripts/errors/coll/InvalidType.py @@ -39,6 +39,5 @@ class InvalidComErrorColl(ErrorGenerator): call.set_has_error() yield tm - # only check for one comm - if generate_level <= BASIC_TEST_LEVEL: - return + if generate_level <= BASIC_TEST_LEVEL: + return diff --git a/scripts/errors/coll/ParamMatching.py b/scripts/errors/coll/ParamMatching.py index 82c1032d5..e1bf2f96d 100644 --- a/scripts/errors/coll/ParamMatching.py +++ b/scripts/errors/coll/ParamMatching.py @@ -29,13 +29,13 @@ class InvalidComErrorColl(ErrorGenerator): def generate(self, generate_level, real_world_score_table): - # type missmatches are generated by ParamMatchingTypes.py + # type missmatches are generated by ParamMatchingTypes.py # 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 - #TODO implement Real world coverage for that + # TODO implement Real world coverage for that tm.set_description("ParamMatching-Op-" + func_to_use, "Wrong operation matching") for call in tm.get_instruction("MPICALL", return_list=True): @@ -48,6 +48,8 @@ class InvalidComErrorColl(ErrorGenerator): tm.insert_instruction(c, after_instruction=call) yield tm + if generate_level <= BASIC_TEST_LEVEL: + break # Generate codes with root mismatch for func_to_use in self.func_with_root: @@ -62,12 +64,14 @@ class InvalidComErrorColl(ErrorGenerator): c = CorrectMPICallFactory.get(func_to_use) yield tm + if generate_level <= BASIC_TEST_LEVEL: + break # Generate codes with communicator mismatch for func_to_use in self.functions_to_use: tm = get_collective_template(func_to_use) com_to_use = "MPI_COMM_SELF" - #TODO use real word coverage for that + # TODO use real word coverage for that tm.set_description("ParamMatching-Com-" + func_to_use, "Wrong communicator matching") for call in tm.get_instruction("MPICALL", return_list=True): @@ -80,6 +84,5 @@ class InvalidComErrorColl(ErrorGenerator): tm.insert_instruction(c, after_instruction=call) yield tm - - if generate_level <= BASIC_TEST_LEVEL: - return + if generate_level <= BASIC_TEST_LEVEL: + break -- GitLab