From 351c11895a87fde783ec48f8e21da225ec2828b2 Mon Sep 17 00:00:00 2001
From: Tim Jammer <tim.jammer@tu-darmstadt.de>
Date: Fri, 3 May 2024 13:14:24 +0200
Subject: [PATCH] replace int literal with Variable in the test level
 conditionals

---
 scripts/errors/rma/EpochLifeCycle.py    | 6 ++++--
 scripts/errors/rma/GlobalConcurrency.py | 2 +-
 scripts/errors/rma/LocalConcurrency.py  | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/scripts/errors/rma/EpochLifeCycle.py b/scripts/errors/rma/EpochLifeCycle.py
index 8b390c557..3c0a0d8d8 100644
--- a/scripts/errors/rma/EpochLifeCycle.py
+++ b/scripts/errors/rma/EpochLifeCycle.py
@@ -47,7 +47,8 @@ class EpochLifeCycleRMA(ErrorGenerator):
                 tm.insert_instruction(new_instruction=startrmaepoch, after_instruction="STARTRMAEPOCH")
                 tm.set_description("EpochLifeCycle", "RMA epoch opened twice")
                 yield tm
-
+                if generate_level <= BASIC_TEST_LEVEL:
+                    break
 
         for rma_func in ["mpi_get", "mpi_put", "mpi_accumulate"]:
             # mix fence with lockall, this should not be done at all
@@ -70,5 +71,6 @@ class EpochLifeCycleRMA(ErrorGenerator):
             tm.insert_instruction(new_instruction=lock, after_instruction="STARTRMAEPOCH")
             tm.insert_instruction(new_instruction=unlock, before_instruction="ENDRMAEPOCH")
             tm.set_description("EpochLifeCycle", "Mixing fence with lock synchronization")
-
             yield tm
+            if generate_level <= BASIC_TEST_LEVEL:
+                break
diff --git a/scripts/errors/rma/GlobalConcurrency.py b/scripts/errors/rma/GlobalConcurrency.py
index 94d48d470..36c9cb8f4 100644
--- a/scripts/errors/rma/GlobalConcurrency.py
+++ b/scripts/errors/rma/GlobalConcurrency.py
@@ -240,7 +240,7 @@ class GlobalConcurrencyErrorRMA(ErrorGenerator):
 
         sync_modes = [self.fence, self.lockall, self.lockflush, self.request, self.pscw]
 
-        if generate_level <= 2:
+        if generate_level <= SUFFICIENT_TEST_LEVEL:
             # go through all sync modes, but only one access combination per sync mode, fill with fence
             combos = itertools.zip_longest(
                 remote_access_combinations, sync_modes, fillvalue=self.fence)
diff --git a/scripts/errors/rma/LocalConcurrency.py b/scripts/errors/rma/LocalConcurrency.py
index 4ba1bf025..de841d3b2 100644
--- a/scripts/errors/rma/LocalConcurrency.py
+++ b/scripts/errors/rma/LocalConcurrency.py
@@ -253,7 +253,7 @@ class LocalConcurrencyErrorRMA(ErrorGenerator):
         # build set of calls based on generate level, for level 1 just a few basic calls,
         # for level >= 2 all calls
 
-        if generate_level == 1:
+        if generate_level <= BASIC_TEST_LEVEL:
             # only basic calls
             local_origin_addr_read = ["mpi_put", "mpi_accumulate"]
             local_origin_addr_write = ["mpi_get"]
@@ -290,7 +290,7 @@ class LocalConcurrencyErrorRMA(ErrorGenerator):
 
         sync_modes = [self.fence, self.lockallflush, self.lockallflushlocal, self.lockflush, self.lockflushlocal, self.lockunlock, self.request, self.pscw]
 
-        if generate_level <= 2:
+        if generate_level <= SUFFICIENT_TEST_LEVEL:
             # go through all sync modes, but only one access combination per sync mode, fill with fence
             combos = itertools.zip_longest(
                 local_access_combinations, sync_modes, fillvalue=self.fence)
-- 
GitLab