From a56afbaf6236f067cd994fc2ac5f418b3f81dfed Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 2 Jan 2024 16:24:24 +0100 Subject: [PATCH] Scheduler-test: bugfix in computation-load ...this one was quite silly: obviously we need a separate instance of the memory block ''per invocation'', otherwise concurrent invocations would corrupt each other's allocation. The whole point of this variant of the computation-load is to access a ''private'' memory block... --- tests/vault/gear/scheduler-stress-test.cpp | 3 ++- tests/vault/gear/test-chain-load.hpp | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/vault/gear/scheduler-stress-test.cpp b/tests/vault/gear/scheduler-stress-test.cpp index 2c0702034..a3dbe468a 100644 --- a/tests/vault/gear/scheduler-stress-test.cpp +++ b/tests/vault/gear/scheduler-stress-test.cpp @@ -296,7 +296,7 @@ SHOW_EXPR(micros); // Adapted Schedule---------- TRANSIENTLY(work::Config::COMPUTATION_CAPACITY) = 4; auto LOAD_BASE = 500us; - double stressFac = 0.6; + double stressFac = 0.5; uint concurrency = 4; // Build-Performance-test-setup-------- @@ -307,6 +307,7 @@ SHOW_EXPR(micros); auto testSetup = testLoad.setupSchedule(scheduler) .withLoadTimeBase(LOAD_BASE) + .withLoadMem() .withJobDeadline(50ms) .withUpfrontPlanning() .withAdaptedSchedule(stressFac, concurrency); diff --git a/tests/vault/gear/test-chain-load.hpp b/tests/vault/gear/test-chain-load.hpp index 7eff8ea1c..663eae359 100644 --- a/tests/vault/gear/test-chain-load.hpp +++ b/tests/vault/gear/test-chain-load.hpp @@ -1255,8 +1255,6 @@ namespace test { { using Sink = volatile size_t; - lib::UninitialisedDynBlock memBlock_{}; - static double& computationSpeed (bool mem) ///< in iterations/µs { @@ -1346,12 +1344,12 @@ namespace test { causeMemProcessLoad (uint scaleStep) { auto [siz,round] = allocNeeded (scaleStep); - memBlock_.allocate(siz); - ++*memBlock_.front(); + lib::UninitialisedDynBlock memBlock{siz}; + ++*memBlock.front(); for ( ; 0 < round; --round) - for (size_t i=0; i