From 9b7e11dca8216285f92e297c2f45340ee32ef95f Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Fri, 29 May 2026 12:31:37 -0400 Subject: [PATCH 01/16] Clean up PerfTests --- src/programs/perf_tests/CMakeLists.txt | 2 +- src/programs/perf_tests/HallDReconTopology.cc | 36 ++++++ .../perf_tests/MinimalPhysicsEventTopology.cc | 52 +++++++++ src/programs/perf_tests/PerfTests.cc | 109 ------------------ src/programs/perf_tests/PodioStressTest.h | 7 -- 5 files changed, 89 insertions(+), 117 deletions(-) create mode 100644 src/programs/perf_tests/HallDReconTopology.cc create mode 100644 src/programs/perf_tests/MinimalPhysicsEventTopology.cc delete mode 100644 src/programs/perf_tests/PerfTests.cc delete mode 100644 src/programs/perf_tests/PodioStressTest.h diff --git a/src/programs/perf_tests/CMakeLists.txt b/src/programs/perf_tests/CMakeLists.txt index de6ebde60..3c25c5266 100644 --- a/src/programs/perf_tests/CMakeLists.txt +++ b/src/programs/perf_tests/CMakeLists.txt @@ -7,7 +7,7 @@ if (USE_PODIO) target_link_libraries(jana-perf-tests PRIVATE PodioDatamodel PodioDatamodelDict) else() - message(STATUS "jana-perf-tests compiled without PODIO stress test because USE_PODIO=Off") + message(STATUS "jana-perf-tests compiled without PODIO because USE_PODIO=Off") endif() diff --git a/src/programs/perf_tests/HallDReconTopology.cc b/src/programs/perf_tests/HallDReconTopology.cc new file mode 100644 index 000000000..1b3466817 --- /dev/null +++ b/src/programs/perf_tests/HallDReconTopology.cc @@ -0,0 +1,36 @@ + +#include + +#include +#include +#include + + +TEST_CASE("HallDReconTopology") { + // 5Hz for full reconstruction + // 20kHz for stripped-down reconstruction (not per-core) + // Base memory allcation: 100 MB/core + 600MB + // 1 thread/event, disentangle 1 event, turn into 40. + // disentangled (single event size) : 12.5 kB / event (before blown up) + // entangled "block of 40": dis * 40 + + auto params = new JParameterManager; + params->SetParameter("jana:loglevel", "off"); + + // Log levels get set as soon as JApp gets constructed + params->SetParameter("jtest:write_csv", false); + params->SetParameter("jtest:parser_ms", 2); + params->SetParameter("jtest:plotter_ms", 2); + + params->SetParameter("benchmark:resultsdir", "perftest_halld_recon_topology"); + + JApplication app(params); + auto logger = params->GetLogger("PerfTests"); + app.AddPlugin("JTest"); + + LOG_WARN(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END; + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + diff --git a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc new file mode 100644 index 000000000..8c48caaab --- /dev/null +++ b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc @@ -0,0 +1,52 @@ +// Copyright 2022-2026, Jefferson Science Associates, LLC. +// Subject to the terms in the LICENSE file found in the top-level directory. + + +#define CATCH_CONFIG_MAIN +#include + +#include +#include +#include + + +TEST_CASE("MinimalPhysicsEventTopology") { + + auto params = new JParameterManager; + params->SetParameter("jana:loglevel", "off"); + + // Log levels get set as soon as JApp gets constructed + params->SetParameter("jtest:write_csv", false); + + params->SetParameter("jtest:parser_ms", 0); + params->SetParameter("jtest:parser_spread", 0); + params->SetParameter("jtest:parser_bytes", 0); + params->SetParameter("jtest:parser_bytes_spread", 0); + + params->SetParameter("jtest:disentangler_ms", 0); + params->SetParameter("jtest:disentangler_spread", 0); + params->SetParameter("jtest:disentangler_bytes", 0); + params->SetParameter("jtest:disentangler_bytes_spread", 0); + + params->SetParameter("jtest:tracker_ms", 0); + params->SetParameter("jtest:tracker_spread", 0); + params->SetParameter("jtest:tracker_bytes", 0); + params->SetParameter("jtest:tracker_bytes_spread", 0); + + params->SetParameter("jtest:plotter_ms", 0); + params->SetParameter("jtest:plotter_spread", 0); + params->SetParameter("jtest:plotter_bytes", 0); + params->SetParameter("jtest:plotter_bytes_spread", 0); + + params->SetParameter("benchmark:resultsdir", "perftest_minimal_physicsevent_topology"); + + JApplication app(params); + auto logger = params->GetLogger("PerfTests"); + app.AddPlugin("JTest"); + + LOG_INFO(logger) << "Running JTest with all sleeps and computations turned off" << LOG_END; + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + diff --git a/src/programs/perf_tests/PerfTests.cc b/src/programs/perf_tests/PerfTests.cc deleted file mode 100644 index 4395a12af..000000000 --- a/src/programs/perf_tests/PerfTests.cc +++ /dev/null @@ -1,109 +0,0 @@ - -// Copyright 2022, Jefferson Science Associates, LLC. -// Subject to the terms in the LICENSE file found in the top-level directory. - - -// PerfTests is designed to make it easy to see how changes to JANA's internals affect its performance on -// a variety of workloads we care about. - -#include -#include -#include -#if HAVE_PODIO -#include -#endif - - - -int main() { - - { - - // 5Hz for full reconstruction - // 20kHz for stripped-down reconstruction (not per-core) - // Base memory allcation: 100 MB/core + 600MB - // 1 thread/event, disentangle 1 event, turn into 40. - // disentangled (single event size) : 12.5 kB / event (before blown up) - // entangled "block of 40": dis * 40 - - auto params = new JParameterManager; - params->SetParameter("jana:loglevel", "off"); - - // Log levels get set as soon as JApp gets constructed - params->SetParameter("jtest:write_csv", false); - params->SetParameter("jtest:parser_ms", 2); - params->SetParameter("jtest:plotter_ms", 2); - - params->SetParameter("benchmark:resultsdir", "perftest_fake_halldrecon"); - - JApplication app(params); - auto logger = params->GetLogger("PerfTests"); - app.AddPlugin("JTest"); - - LOG_INFO(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END; - JBenchmarker benchmarker(&app); - benchmarker.RunUntilFinished(); - } - - - { - - auto params = new JParameterManager; - params->SetParameter("jana:loglevel", "off"); - - // Log levels get set as soon as JApp gets constructed - params->SetParameter("jtest:write_csv", false); - - params->SetParameter("jtest:parser_ms", 0); - params->SetParameter("jtest:parser_spread", 0); - params->SetParameter("jtest:parser_bytes", 0); - params->SetParameter("jtest:parser_bytes_spread", 0); - - params->SetParameter("jtest:disentangler_ms", 0); - params->SetParameter("jtest:disentangler_spread", 0); - params->SetParameter("jtest:disentangler_bytes", 0); - params->SetParameter("jtest:disentangler_bytes_spread", 0); - - params->SetParameter("jtest:tracker_ms", 0); - params->SetParameter("jtest:tracker_spread", 0); - params->SetParameter("jtest:tracker_bytes", 0); - params->SetParameter("jtest:tracker_bytes_spread", 0); - - params->SetParameter("jtest:plotter_ms", 0); - params->SetParameter("jtest:plotter_spread", 0); - params->SetParameter("jtest:plotter_bytes", 0); - params->SetParameter("jtest:plotter_bytes_spread", 0); - - params->SetParameter("benchmark:resultsdir", "perftest_pure_overhead"); - - JApplication app(params); - auto logger = params->GetLogger("PerfTests"); - app.AddPlugin("JTest"); - - LOG_INFO(logger) << "Running JTest with all sleeps and computations turned off" << LOG_END; - JBenchmarker benchmarker(&app); - benchmarker.RunUntilFinished(); - } - -#if HAVE_PODIO - { - // Test that we can link against PODIO datamodel - // TODO: Delete me - ExampleHitCollection c; - - auto params = new JParameterManager; - params->SetParameter("jana:loglevel", "off"); - JApplication app(params); - auto logger = params->GetLogger("PerfTests"); - // TODO: Add Podio sources, processors, and factories just like JTest - LOG_INFO(logger) << "Running PODIO stress test" << LOG_END; - JBenchmarker benchmarker(&app); - benchmarker.RunUntilFinished(); - } -#endif - - // Next: Run with subevents - // Next: Run with more and more arrows to see how that scales - // Next: Barrier events - -} diff --git a/src/programs/perf_tests/PodioStressTest.h b/src/programs/perf_tests/PodioStressTest.h deleted file mode 100644 index 7df870772..000000000 --- a/src/programs/perf_tests/PodioStressTest.h +++ /dev/null @@ -1,7 +0,0 @@ - -#pragma once - -#include -#include - - From ebab6770c37073c086a30bd5c9b1c9489ca05553 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Fri, 29 May 2026 12:55:02 -0400 Subject: [PATCH 02/16] Add MinimalUnfolderTopology perf test --- .../perf_tests/MinimalUnfolderTopology.cc | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/programs/perf_tests/MinimalUnfolderTopology.cc diff --git a/src/programs/perf_tests/MinimalUnfolderTopology.cc b/src/programs/perf_tests/MinimalUnfolderTopology.cc new file mode 100644 index 000000000..e480704f5 --- /dev/null +++ b/src/programs/perf_tests/MinimalUnfolderTopology.cc @@ -0,0 +1,115 @@ + +#include "JANA/Utils/JEventLevel.h" +#include + +#include +#include +#include +#include +#include +#include + + +namespace jana::minimal_unfolder_topology { + +struct Data { size_t x; }; + +struct BSrc : public JEventSource { + + Output data_out {this}; + + BSrc() { + SetLevel(JEventLevel::Block); + SetCallbackStyle(CallbackStyle::ExpertMode); + data_out.SetShortName("1"); + } + JEventSource::Result Emit(JEvent& block) override { + data_out().push_back(new Data {block.GetEventNumber()*3 }); + return Result::Success; + }; +}; + +struct BFac : public JFactory { + Input data_in {this}; + Output data_out {this}; + + BFac() { + SetLevel(JEventLevel::Block); + data_in.SetDatabundleName("1"); + data_out.SetShortName("2"); + } + void Process(const JEvent&) override { + auto x = data_in().at(0)->x + 7; + data_out().push_back(new Data {x}); + }; +}; + +struct Unf : public JEventUnfolder { + Input parent_data_in {this}; + Output child_data_out {this}; + + Unf() { + SetParentLevel(JEventLevel::Block); + SetChildLevel(JEventLevel::PhysicsEvent); + SetCallbackStyle(CallbackStyle::ExpertMode); + parent_data_in.SetDatabundleName("2"); + child_data_out.SetShortName("3"); + } + JEventUnfolder::Result Unfold(const JEvent&, JEvent&, int child_nr) override { + auto x = parent_data_in().at(0)->x * 10 + child_nr; + child_data_out().push_back(new Data{x}); + + if (child_nr == 9) { + return Result::NextChildNextParent; + } + return Result::NextChildKeepParent; + }; +}; + +struct PEFac : public JFactory { + Input data_in {this}; + Output data_out {this}; + PEFac() { + SetLevel(JEventLevel::PhysicsEvent); + data_in.SetDatabundleName("3"); + data_out.SetShortName("4"); + } + void Process(const JEvent&) override { + auto x = data_in().at(0)->x * 10; + data_out().push_back(new Data {x}); + }; +}; + +struct PEProc : public JEventProcessor { + Input data_in {this}; + PEProc() { + SetLevel(JEventLevel::PhysicsEvent); + SetCallbackStyle(CallbackStyle::ExpertMode); + data_in.SetDatabundleName("4"); + } + void ProcessSequential(const JEvent&) override { + (void) (data_in().at(0)->x); + }; +}; + + +TEST_CASE("MinimalUnfolderTopology") { + + LOG << "Running MinimalUnfolderTopology"; + + JApplication app; + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + +} + + + From 846a4e0e54db4609d4fc62ff8b391d5d4ea104e6 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sat, 30 May 2026 14:11:55 -0400 Subject: [PATCH 03/16] Fix JFactorySet::Print cout interleaving --- src/libraries/JANA/JFactorySet.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/JANA/JFactorySet.cc b/src/libraries/JANA/JFactorySet.cc index 461779526..712cc0cf9 100644 --- a/src/libraries/JANA/JFactorySet.cc +++ b/src/libraries/JANA/JFactorySet.cc @@ -235,7 +235,9 @@ void JFactorySet::Print() const { table | databundle->GetSize(); } } - table.Render(std::cout); + std::ostringstream oss; + table.Render(oss); + std::cout << oss.str(); } //--------------------------------- From 1af7be3f0258621f637f35ee920aa8fe302a6c2d Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 31 May 2026 16:54:28 -0400 Subject: [PATCH 04/16] Add TapChainTests --- .../perf_tests/MinimalSourceTopology.cc | 54 ++++++++++ src/programs/perf_tests/TapChainTests.cc | 102 ++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 src/programs/perf_tests/MinimalSourceTopology.cc create mode 100644 src/programs/perf_tests/TapChainTests.cc diff --git a/src/programs/perf_tests/MinimalSourceTopology.cc b/src/programs/perf_tests/MinimalSourceTopology.cc new file mode 100644 index 000000000..b9dcc3e5f --- /dev/null +++ b/src/programs/perf_tests/MinimalSourceTopology.cc @@ -0,0 +1,54 @@ + +#include "JANA/Utils/JEventLevel.h" +#include + +#include +#include +#include +#include +#include +#include + + +namespace jana::minimal_source_topology { + +struct Data { size_t x; }; + +struct Src : public JEventSource { + + Output data_out {this}; + + Src() { + //SetLevel(JEventLevel::Block); + SetCallbackStyle(CallbackStyle::ExpertMode); + data_out.SetShortName("1"); + } + JEventSource::Result Emit(JEvent& block) override { + data_out().push_back(new Data {block.GetEventNumber()*3 }); + return Result::Success; + }; +}; + +TEST_CASE("Mini") { + LOG << "Running Mini"; + JApplication app; + //app.SetParameterValue("jana:loglevel", "debug"); + app.SetParameterValue("jana:nevents", "4000000"); + app.SetParameterValue("nthreads", "16"); + app.Add(new Src); + app.Run(); +} + +TEST_CASE("MinimalSourceTopology") { + LOG << "Running MinimalSourceTopology"; + JApplication app; + app.Add(new Src); + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + +} + + + diff --git a/src/programs/perf_tests/TapChainTests.cc b/src/programs/perf_tests/TapChainTests.cc new file mode 100644 index 000000000..518dba0ba --- /dev/null +++ b/src/programs/perf_tests/TapChainTests.cc @@ -0,0 +1,102 @@ + +#include + +#include +#include +#include +#include +#include +#include + + +namespace jana::tap_chain_tests { + +struct Data { size_t x; }; + +struct Src : public JEventSource { + + Output data_out {this}; + + Src() { + SetCallbackStyle(CallbackStyle::ExpertMode); + data_out.SetShortName("1"); + } + JEventSource::Result Emit(JEvent& evt) override { + data_out().push_back(new Data {evt.GetEventNumber()*3 }); + return Result::Success; + }; +}; + +struct Fac : public JFactory { + Input data_in {this}; + Output data_out {this}; + + Fac() { + data_in.SetDatabundleName("1"); + data_out.SetShortName("2"); + } + void Process(const JEvent&) override { + auto x = data_in().at(0)->x + 7; + data_out().push_back(new Data {x}); + }; +}; + +struct Proc : public JEventProcessor { + Input data_in {this}; + Proc() { + SetCallbackStyle(CallbackStyle::ExpertMode); + data_in.SetDatabundleName("2"); + } + void ProcessSequential(const JEvent&) override { + (void) (data_in().at(0)->x); + }; +}; + + +TEST_CASE("TapChainTests_1") { + + LOG << "Running TapChainTests_1"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + app.Add(new Proc); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTests_4") { + + LOG << "Running TapChainTests_4"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<4; ++i) { + app.Add(new Proc); + } + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTests_16") { + + LOG << "Running TapChainTests_16"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<16; ++i) { + app.Add(new Proc); + } + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + +} + + + From 30ca2acccbc02ece642a364008446094709ebb8d Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 31 May 2026 18:40:35 -0400 Subject: [PATCH 05/16] PerfTests: Consistent, logarithmic plots --- src/programs/perf_tests/HallDReconTopology.cc | 6 +++++- .../perf_tests/MinimalPhysicsEventTopology.cc | 6 +++++- .../perf_tests/MinimalSourceTopology.cc | 5 +++++ .../perf_tests/MinimalUnfolderTopology.cc | 6 ++++++ src/programs/perf_tests/TapChainTests.cc | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/programs/perf_tests/HallDReconTopology.cc b/src/programs/perf_tests/HallDReconTopology.cc index 1b3466817..1bfcb8298 100644 --- a/src/programs/perf_tests/HallDReconTopology.cc +++ b/src/programs/perf_tests/HallDReconTopology.cc @@ -22,7 +22,11 @@ TEST_CASE("HallDReconTopology") { params->SetParameter("jtest:parser_ms", 2); params->SetParameter("jtest:plotter_ms", 2); - params->SetParameter("benchmark:resultsdir", "perftest_halld_recon_topology"); + params->SetParameter("benchmark:resultsdir", "perf_tests"); + params->SetParameter("benchmark:rates_filename", "halld_recon_topology.dat"); + params->SetParameter("benchmark:use_log_scale", true); + params->SetParameter("benchmark:minthreads", "1"); + params->SetParameter("benchmark:maxthreads", "32"); JApplication app(params); auto logger = params->GetLogger("PerfTests"); diff --git a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc index 8c48caaab..ab672a74a 100644 --- a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc +++ b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc @@ -38,7 +38,11 @@ TEST_CASE("MinimalPhysicsEventTopology") { params->SetParameter("jtest:plotter_bytes", 0); params->SetParameter("jtest:plotter_bytes_spread", 0); - params->SetParameter("benchmark:resultsdir", "perftest_minimal_physicsevent_topology"); + params->SetParameter("benchmark:resultsdir", "perf_tests"); + params->SetParameter("benchmark:rates_filename", "minimal_physics_event_topology.dat"); + params->SetParameter("benchmark:use_log_scale", true); + params->SetParameter("benchmark:minthreads", "1"); + params->SetParameter("benchmark:maxthreads", "32"); JApplication app(params); auto logger = params->GetLogger("PerfTests"); diff --git a/src/programs/perf_tests/MinimalSourceTopology.cc b/src/programs/perf_tests/MinimalSourceTopology.cc index b9dcc3e5f..71467ef81 100644 --- a/src/programs/perf_tests/MinimalSourceTopology.cc +++ b/src/programs/perf_tests/MinimalSourceTopology.cc @@ -42,6 +42,11 @@ TEST_CASE("Mini") { TEST_CASE("MinimalSourceTopology") { LOG << "Running MinimalSourceTopology"; JApplication app; + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "minimal_source_topology.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); app.Add(new Src); JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); diff --git a/src/programs/perf_tests/MinimalUnfolderTopology.cc b/src/programs/perf_tests/MinimalUnfolderTopology.cc index e480704f5..971754525 100644 --- a/src/programs/perf_tests/MinimalUnfolderTopology.cc +++ b/src/programs/perf_tests/MinimalUnfolderTopology.cc @@ -98,6 +98,12 @@ TEST_CASE("MinimalUnfolderTopology") { LOG << "Running MinimalUnfolderTopology"; JApplication app; + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "minimal_unfolder_topology.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + app.Add(new BSrc); app.Add(new Unf); app.Add(new PEProc); diff --git a/src/programs/perf_tests/TapChainTests.cc b/src/programs/perf_tests/TapChainTests.cc index 518dba0ba..79e08a55a 100644 --- a/src/programs/perf_tests/TapChainTests.cc +++ b/src/programs/perf_tests/TapChainTests.cc @@ -62,6 +62,12 @@ TEST_CASE("TapChainTests_1") { app.Add(new JFactoryGeneratorT); app.Add(new Proc); + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_1.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } @@ -77,6 +83,12 @@ TEST_CASE("TapChainTests_4") { app.Add(new Proc); } + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_4.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } @@ -91,6 +103,13 @@ TEST_CASE("TapChainTests_16") { for (int i=0; i<16; ++i) { app.Add(new Proc); } + + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_16.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } From 35344a56f54e1f1a6608015238502f76638357bb Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 31 May 2026 18:38:20 -0400 Subject: [PATCH 06/16] JBenchmarker: Make filenames configurable --- src/libraries/JANA/CLI/JBenchmarker.cc | 18 +++++++++++++++--- src/libraries/JANA/CLI/JBenchmarker.h | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/libraries/JANA/CLI/JBenchmarker.cc b/src/libraries/JANA/CLI/JBenchmarker.cc index d7298a8e7..46e59a7ce 100644 --- a/src/libraries/JANA/CLI/JBenchmarker.cc +++ b/src/libraries/JANA/CLI/JBenchmarker.cc @@ -60,6 +60,16 @@ JBenchmarker::JBenchmarker(JApplication* app) : m_app(app) { m_output_dir, "Output directory name for benchmark test results"); + params->SetDefaultParameter( + "benchmark:rates_filename", + m_rates_filename, + "Filename for benchmark rates"); + + params->SetDefaultParameter( + "benchmark:samples_filename", + m_samples_filename, + "Filename for benchmark samples"); + params->SetDefaultParameter( "benchmark:copyscript", m_copy_script, @@ -82,15 +92,17 @@ void JBenchmarker::RunUntilFinished() { << " benchmark:threadstep = " << m_thread_step << std::endl << " benchmark:use_log_scale = " << m_use_log_scale << std::endl << " benchmark:nsamples = " << m_nsamples << std::endl - << " benchmark:resultsdir = " << m_output_dir << std::endl; + << " benchmark:resultsdir = " << m_output_dir << std::endl + << " benchmark:rates_filename = " << m_rates_filename << std::endl + << " benchmark:samples_filename = " << m_samples_filename << std::endl; mkdir(m_output_dir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - std::ofstream samples_file(m_output_dir + "/samples.dat"); + std::ofstream samples_file(m_output_dir + "/" + m_samples_filename); samples_file << "# nthreads rate" << std::endl; - std::ofstream rates_file(m_output_dir + "/rates.dat"); + std::ofstream rates_file(m_output_dir + "/" + m_rates_filename); rates_file << "# nthreads avg_rate rms" << std::endl; diff --git a/src/libraries/JANA/CLI/JBenchmarker.h b/src/libraries/JANA/CLI/JBenchmarker.h index 1674b9aef..b73082a52 100644 --- a/src/libraries/JANA/CLI/JBenchmarker.h +++ b/src/libraries/JANA/CLI/JBenchmarker.h @@ -15,7 +15,10 @@ class JBenchmarker { unsigned m_thread_step = 1; unsigned m_nsamples = 15; std::string m_output_dir = "JANA_Test_Results"; + std::string m_rates_filename = "rates.dat"; + std::string m_samples_filename = "samples.dat"; bool m_copy_script = true; + bool m_include_samples = true; bool m_use_log_scale = false; public: From 34892e2bfa3537a016263914be36e87d73287600 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 31 May 2026 23:53:25 -0400 Subject: [PATCH 07/16] Generate plot for tap chain scale tests --- perf_tests/tap_chain_plot.toml | 23 +++++++++++++++++++++++ scripts/jana-plot-scaletests.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 perf_tests/tap_chain_plot.toml diff --git a/perf_tests/tap_chain_plot.toml b/perf_tests/tap_chain_plot.toml new file mode 100644 index 000000000..f275e878c --- /dev/null +++ b/perf_tests/tap_chain_plot.toml @@ -0,0 +1,23 @@ + +title = "Chain length scaling" +output_filename = "chain_length_scaling.pdf" +use_latex = true + +[[test]] +key = "1 JEventProcessor" +datafile = "tap_chain_tests_1.dat" +t_par = 1 +t_seq = 1 + +[[test]] +key = "4 JEventProcessors" +datafile = "tap_chain_tests_4.dat" +t_par = 1 +t_seq = 1 + +[[test]] +key = "16 JEventProcessors" +datafile = "tap_chain_tests_16.dat" +t_par = 1 +t_seq = 1 + diff --git a/scripts/jana-plot-scaletests.py b/scripts/jana-plot-scaletests.py index 171ac9fc7..e426da0f9 100755 --- a/scripts/jana-plot-scaletests.py +++ b/scripts/jana-plot-scaletests.py @@ -49,7 +49,7 @@ def make_plot(plot_spec, input_dir): tpar = subplot['t_par'] tseq = subplot['t_seq'] - nthreads = np.arange(minnthreads, maxnthreads+1, 1) + #nthreads = np.arange(minnthreads, maxnthreads+1, 1) seq_bottleneck = 1000 / tseq par_bottleneck = 1000 * nthreads / tpar amdahl_ys = 1000 / (tseq + (tpar/nthreads)) From ca70b5e18d32da04a2b1edfdd39f199bbf7ccab8 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Sun, 31 May 2026 23:58:01 -0400 Subject: [PATCH 08/16] Fix MinimalPhysicsEventTopology scaling test --- src/programs/perf_tests/HallDReconTopology.cc | 5 +- .../perf_tests/MinimalPhysicsEventTopology.cc | 64 +++++++++---------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/programs/perf_tests/HallDReconTopology.cc b/src/programs/perf_tests/HallDReconTopology.cc index 1bfcb8298..bb716b8f6 100644 --- a/src/programs/perf_tests/HallDReconTopology.cc +++ b/src/programs/perf_tests/HallDReconTopology.cc @@ -18,9 +18,8 @@ TEST_CASE("HallDReconTopology") { params->SetParameter("jana:loglevel", "off"); // Log levels get set as soon as JApp gets constructed - params->SetParameter("jtest:write_csv", false); - params->SetParameter("jtest:parser_ms", 2); - params->SetParameter("jtest:plotter_ms", 2); + params->SetParameter("jtest:parser:cputime_ms", 2); + params->SetParameter("jtest:plotter:cputime_ms", 2); params->SetParameter("benchmark:resultsdir", "perf_tests"); params->SetParameter("benchmark:rates_filename", "halld_recon_topology.dat"); diff --git a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc index ab672a74a..be0eeef6d 100644 --- a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc +++ b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc @@ -12,40 +12,36 @@ TEST_CASE("MinimalPhysicsEventTopology") { - auto params = new JParameterManager; - params->SetParameter("jana:loglevel", "off"); - - // Log levels get set as soon as JApp gets constructed - params->SetParameter("jtest:write_csv", false); - - params->SetParameter("jtest:parser_ms", 0); - params->SetParameter("jtest:parser_spread", 0); - params->SetParameter("jtest:parser_bytes", 0); - params->SetParameter("jtest:parser_bytes_spread", 0); - - params->SetParameter("jtest:disentangler_ms", 0); - params->SetParameter("jtest:disentangler_spread", 0); - params->SetParameter("jtest:disentangler_bytes", 0); - params->SetParameter("jtest:disentangler_bytes_spread", 0); - - params->SetParameter("jtest:tracker_ms", 0); - params->SetParameter("jtest:tracker_spread", 0); - params->SetParameter("jtest:tracker_bytes", 0); - params->SetParameter("jtest:tracker_bytes_spread", 0); - - params->SetParameter("jtest:plotter_ms", 0); - params->SetParameter("jtest:plotter_spread", 0); - params->SetParameter("jtest:plotter_bytes", 0); - params->SetParameter("jtest:plotter_bytes_spread", 0); - - params->SetParameter("benchmark:resultsdir", "perf_tests"); - params->SetParameter("benchmark:rates_filename", "minimal_physics_event_topology.dat"); - params->SetParameter("benchmark:use_log_scale", true); - params->SetParameter("benchmark:minthreads", "1"); - params->SetParameter("benchmark:maxthreads", "32"); - - JApplication app(params); - auto logger = params->GetLogger("PerfTests"); + JApplication app; + + app.SetParameterValue("jtest:parser:cputime_ms", 0); + app.SetParameterValue("jtest:parser:cputime_spread", 0); + app.SetParameterValue("jtest:parser:bytes", 0); + app.SetParameterValue("jtest:parser:bytes_spread", 0); + + app.SetParameterValue("jtest:disentangler:cputime_ms", 0); + app.SetParameterValue("jtest:disentangler:cputime_spread", 0); + app.SetParameterValue("jtest:disentangler:bytes", 0); + app.SetParameterValue("jtest:disentangler:bytes_spread", 0); + + app.SetParameterValue("jtest:tracker:cputime_ms", 0); + app.SetParameterValue("jtest:tracker:cputime_spread", 0); + app.SetParameterValue("jtest:tracker:bytes", 0); + app.SetParameterValue("jtest:tracker:bytes_spread", 0); + + app.SetParameterValue("jtest:plotter:cputime_ms", 0); + app.SetParameterValue("jtest:plotter:cputime_spread", 0); + app.SetParameterValue("jtest:plotter:bytes", 0); + app.SetParameterValue("jtest:plotter:bytes_spread", 0); + + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "minimal_physics_event_topology.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + //params->SetParameter("jana:loglevel", "off"); + + auto logger = app.GetJParameterManager()->GetLogger("PerfTests"); app.AddPlugin("JTest"); LOG_INFO(logger) << "Running JTest with all sleeps and computations turned off" << LOG_END; From d75c6cacdaa80202bcf29f11e4907effd420c69d Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Fri, 12 Jun 2026 13:36:36 -0400 Subject: [PATCH 09/16] Move mini physics event topology perf test off of JTest --- .../perf_tests/MinimalPhysicsEventTopology.cc | 93 ++++++++++++++----- 1 file changed, 72 insertions(+), 21 deletions(-) diff --git a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc index be0eeef6d..304af29a6 100644 --- a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc +++ b/src/programs/perf_tests/MinimalPhysicsEventTopology.cc @@ -8,45 +8,96 @@ #include #include #include +#include +#include +#include + + +namespace jana::minimal_physics_event_topology { + +struct Data { size_t x; }; + +struct PESrc : public JEventSource { + + Output data_out {this}; + + PESrc() { + SetCallbackStyle(CallbackStyle::ExpertMode); + data_out.SetShortName("1"); + } + JEventSource::Result Emit(JEvent& event) override { + data_out().push_back(new Data {event.GetEventNumber()*3 }); + return Result::Success; + }; +}; + +struct PEFac : public JFactory { + Input data_in {this}; + Output data_out {this}; + PEFac() { + SetLevel(JEventLevel::PhysicsEvent); + data_in.SetDatabundleName("1"); + data_out.SetShortName("2"); + } + void Process(const JEvent&) override { + auto x = data_in().at(0)->x * 10; + data_out().push_back(new Data {x}); + }; +}; + +struct PEProc : public JEventProcessor { + Input data_in {this}; + PEProc() { + SetLevel(JEventLevel::PhysicsEvent); + SetCallbackStyle(CallbackStyle::ExpertMode); + data_in.SetDatabundleName("2"); + } + void ProcessSequential(const JEvent&) override { + (void) (data_in().at(0)->x); + }; +}; TEST_CASE("MinimalPhysicsEventTopology") { - JApplication app; + LOG << "Running MinimalPhysicsEventTopology"; - app.SetParameterValue("jtest:parser:cputime_ms", 0); - app.SetParameterValue("jtest:parser:cputime_spread", 0); - app.SetParameterValue("jtest:parser:bytes", 0); - app.SetParameterValue("jtest:parser:bytes_spread", 0); + JApplication app; + app.SetParameterValue("nthreads", "1"); + app.SetParameterValue("jana:nevents", "10000"); + app.SetParameterValue("jana:backoff_interval", "1"); + //app.SetParameterValue("jana:backoff_interval", "10"); + //app.SetParameterValue("jana:loglevel", "trace"); - app.SetParameterValue("jtest:disentangler:cputime_ms", 0); - app.SetParameterValue("jtest:disentangler:cputime_spread", 0); - app.SetParameterValue("jtest:disentangler:bytes", 0); - app.SetParameterValue("jtest:disentangler:bytes_spread", 0); + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Run(); +} - app.SetParameterValue("jtest:tracker:cputime_ms", 0); - app.SetParameterValue("jtest:tracker:cputime_spread", 0); - app.SetParameterValue("jtest:tracker:bytes", 0); - app.SetParameterValue("jtest:tracker:bytes_spread", 0); +TEST_CASE("MinimalPhysicsEventTopology_Benchmarking") { - app.SetParameterValue("jtest:plotter:cputime_ms", 0); - app.SetParameterValue("jtest:plotter:cputime_spread", 0); - app.SetParameterValue("jtest:plotter:bytes", 0); - app.SetParameterValue("jtest:plotter:bytes_spread", 0); + LOG << "Running MinimalPhysicsEventTopology_Benchmarking"; + JApplication app; app.SetParameterValue("benchmark:resultsdir", "perf_tests"); app.SetParameterValue("benchmark:rates_filename", "minimal_physics_event_topology.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); - //params->SetParameter("jana:loglevel", "off"); + //app.SetParameterValue("jana:backoff_interval", "1"); + app.SetParameterValue("jana:backoff_interval", "1"); + //app.SetParameterValue("jana:loglevel", "trace"); - auto logger = app.GetJParameterManager()->GetLogger("PerfTests"); - app.AddPlugin("JTest"); + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); - LOG_INFO(logger) << "Running JTest with all sleeps and computations turned off" << LOG_END; JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } +} // namespace + + From b4d9c8e6dff8be16af030b41f84dfad0cf844852 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Mon, 15 Jun 2026 13:18:55 -0400 Subject: [PATCH 10/16] perf_tests: Consistent naming conventions --- src/libraries/JANA/Utils/JBenchUtils.cc | 21 +++++ src/libraries/JANA/Utils/JBenchUtils.h | 3 + ...ysicsEventTopology.cc => BasicTopology.cc} | 55 +++++++---- src/programs/perf_tests/HallDReconTopology.cc | 39 -------- .../perf_tests/MinimalSourceTopology.cc | 59 ------------ src/programs/perf_tests/SourceTopology.cc | 93 +++++++++++++++++++ .../{TapChainTests.cc => TapChainTopology.cc} | 20 ++-- ...lUnfolderTopology.cc => UnfoldTopology.cc} | 6 +- 8 files changed, 165 insertions(+), 131 deletions(-) rename src/programs/perf_tests/{MinimalPhysicsEventTopology.cc => BasicTopology.cc} (61%) delete mode 100644 src/programs/perf_tests/HallDReconTopology.cc delete mode 100644 src/programs/perf_tests/MinimalSourceTopology.cc create mode 100644 src/programs/perf_tests/SourceTopology.cc rename src/programs/perf_tests/{TapChainTests.cc => TapChainTopology.cc} (82%) rename src/programs/perf_tests/{MinimalUnfolderTopology.cc => UnfoldTopology.cc} (94%) diff --git a/src/libraries/JANA/Utils/JBenchUtils.cc b/src/libraries/JANA/Utils/JBenchUtils.cc index 5f54d11d6..9bfe59ada 100644 --- a/src/libraries/JANA/Utils/JBenchUtils.cc +++ b/src/libraries/JANA/Utils/JBenchUtils.cc @@ -5,6 +5,7 @@ #include "JBenchUtils.h" #include +#include void JBenchUtils::set_seed(size_t event_number, std::string caller_name) @@ -74,6 +75,26 @@ uint64_t JBenchUtils::write_memory(std::vector& buffer, uint64_t bytes, do } +void JBenchUtils::consume_cpu_us(uint64_t microseconds) { + using clock = std::chrono::steady_clock; + auto deadline = clock::now() + std::chrono::microseconds(microseconds); + + volatile double acc = 1.0; // volatile: optimizer can't elide + while (clock::now() < deadline) { + // FMA is fast but not trivially free; 8 ops per loop body + // avoids tight branch-dominated loops that mispredict badly + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + acc = std::fma(acc, 1.0000001, 0.0000001); + } + // Prevent dead-store elimination at the call site too + asm volatile("" : : "r,m"(acc) : "memory"); +} diff --git a/src/libraries/JANA/Utils/JBenchUtils.h b/src/libraries/JANA/Utils/JBenchUtils.h index 71106d600..d3338ebbc 100644 --- a/src/libraries/JANA/Utils/JBenchUtils.h +++ b/src/libraries/JANA/Utils/JBenchUtils.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -28,4 +29,6 @@ class JBenchUtils { uint64_t read_memory(const std::vector& buffer); uint64_t write_memory(std::vector& buffer, uint64_t bytes, double spread=0.0); + static void consume_cpu_us(uint64_t microsecs); + }; diff --git a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc b/src/programs/perf_tests/BasicTopology.cc similarity index 61% rename from src/programs/perf_tests/MinimalPhysicsEventTopology.cc rename to src/programs/perf_tests/BasicTopology.cc index 304af29a6..cb38fdff0 100644 --- a/src/programs/perf_tests/MinimalPhysicsEventTopology.cc +++ b/src/programs/perf_tests/BasicTopology.cc @@ -13,7 +13,7 @@ #include -namespace jana::minimal_physics_event_topology { +namespace jana::perftest::basic { struct Data { size_t x; }; @@ -58,30 +58,13 @@ struct PEProc : public JEventProcessor { }; -TEST_CASE("MinimalPhysicsEventTopology") { - - LOG << "Running MinimalPhysicsEventTopology"; - - JApplication app; - app.SetParameterValue("nthreads", "1"); - app.SetParameterValue("jana:nevents", "10000"); - app.SetParameterValue("jana:backoff_interval", "1"); - //app.SetParameterValue("jana:backoff_interval", "10"); - //app.SetParameterValue("jana:loglevel", "trace"); - - app.Add(new PESrc); - app.Add(new PEProc); - app.Add(new JFactoryGeneratorT); - app.Run(); -} - -TEST_CASE("MinimalPhysicsEventTopology_Benchmarking") { +TEST_CASE("BasicTopology_Mini") { LOG << "Running MinimalPhysicsEventTopology_Benchmarking"; JApplication app; app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "minimal_physics_event_topology.dat"); + app.SetParameterValue("benchmark:rates_filename", "basic_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); @@ -98,6 +81,38 @@ TEST_CASE("MinimalPhysicsEventTopology_Benchmarking") { } +TEST_CASE("BasicTopology_JTest") { + // 5Hz for full reconstruction + // 20kHz for stripped-down reconstruction (not per-core) + // Base memory allcation: 100 MB/core + 600MB + // 1 thread/event, disentangle 1 event, turn into 40. + // disentangled (single event size) : 12.5 kB / event (before blown up) + // entangled "block of 40": dis * 40 + + auto params = new JParameterManager; + params->SetParameter("jana:loglevel", "off"); + + // Log levels get set as soon as JApp gets constructed + params->SetParameter("jtest:parser:cputime_ms", 2); + params->SetParameter("jtest:plotter:cputime_ms", 2); + + params->SetParameter("benchmark:resultsdir", "perf_tests"); + params->SetParameter("benchmark:rates_filename", "basic_jtest.dat"); + params->SetParameter("benchmark:use_log_scale", true); + params->SetParameter("benchmark:minthreads", "1"); + params->SetParameter("benchmark:maxthreads", "32"); + + JApplication app(params); + auto logger = params->GetLogger("PerfTests"); + app.AddPlugin("JTest"); + + LOG_WARN(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END; + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + + } // namespace diff --git a/src/programs/perf_tests/HallDReconTopology.cc b/src/programs/perf_tests/HallDReconTopology.cc deleted file mode 100644 index bb716b8f6..000000000 --- a/src/programs/perf_tests/HallDReconTopology.cc +++ /dev/null @@ -1,39 +0,0 @@ - -#include - -#include -#include -#include - - -TEST_CASE("HallDReconTopology") { - // 5Hz for full reconstruction - // 20kHz for stripped-down reconstruction (not per-core) - // Base memory allcation: 100 MB/core + 600MB - // 1 thread/event, disentangle 1 event, turn into 40. - // disentangled (single event size) : 12.5 kB / event (before blown up) - // entangled "block of 40": dis * 40 - - auto params = new JParameterManager; - params->SetParameter("jana:loglevel", "off"); - - // Log levels get set as soon as JApp gets constructed - params->SetParameter("jtest:parser:cputime_ms", 2); - params->SetParameter("jtest:plotter:cputime_ms", 2); - - params->SetParameter("benchmark:resultsdir", "perf_tests"); - params->SetParameter("benchmark:rates_filename", "halld_recon_topology.dat"); - params->SetParameter("benchmark:use_log_scale", true); - params->SetParameter("benchmark:minthreads", "1"); - params->SetParameter("benchmark:maxthreads", "32"); - - JApplication app(params); - auto logger = params->GetLogger("PerfTests"); - app.AddPlugin("JTest"); - - LOG_WARN(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END; - JBenchmarker benchmarker(&app); - benchmarker.RunUntilFinished(); -} - - diff --git a/src/programs/perf_tests/MinimalSourceTopology.cc b/src/programs/perf_tests/MinimalSourceTopology.cc deleted file mode 100644 index 71467ef81..000000000 --- a/src/programs/perf_tests/MinimalSourceTopology.cc +++ /dev/null @@ -1,59 +0,0 @@ - -#include "JANA/Utils/JEventLevel.h" -#include - -#include -#include -#include -#include -#include -#include - - -namespace jana::minimal_source_topology { - -struct Data { size_t x; }; - -struct Src : public JEventSource { - - Output data_out {this}; - - Src() { - //SetLevel(JEventLevel::Block); - SetCallbackStyle(CallbackStyle::ExpertMode); - data_out.SetShortName("1"); - } - JEventSource::Result Emit(JEvent& block) override { - data_out().push_back(new Data {block.GetEventNumber()*3 }); - return Result::Success; - }; -}; - -TEST_CASE("Mini") { - LOG << "Running Mini"; - JApplication app; - //app.SetParameterValue("jana:loglevel", "debug"); - app.SetParameterValue("jana:nevents", "4000000"); - app.SetParameterValue("nthreads", "16"); - app.Add(new Src); - app.Run(); -} - -TEST_CASE("MinimalSourceTopology") { - LOG << "Running MinimalSourceTopology"; - JApplication app; - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "minimal_source_topology.dat"); - app.SetParameterValue("benchmark:use_log_scale", true); - app.SetParameterValue("benchmark:minthreads", "1"); - app.SetParameterValue("benchmark:maxthreads", "32"); - app.Add(new Src); - JBenchmarker benchmarker(&app); - benchmarker.RunUntilFinished(); -} - - -} - - - diff --git a/src/programs/perf_tests/SourceTopology.cc b/src/programs/perf_tests/SourceTopology.cc new file mode 100644 index 000000000..3f253b4b4 --- /dev/null +++ b/src/programs/perf_tests/SourceTopology.cc @@ -0,0 +1,93 @@ + +#include + +#include +#include +#include +#include +#include +#include +#include + + +namespace jana::perftest::source { + +struct Data { size_t x; }; + +struct Src : public JEventSource { + + Parameter latency_us {this, "latency_us", 0}; + Output data_out {this}; + + Src() { + SetPrefix("sut"); + SetCallbackStyle(CallbackStyle::ExpertMode); + data_out.SetShortName("1"); + } + JEventSource::Result Emit(JEvent& block) override { + data_out().push_back(new Data {block.GetEventNumber()*3 }); + JBenchUtils::consume_cpu_us(*latency_us); + return Result::Success; + }; +}; + +TEST_CASE("SourceTopology_Mini") { + LOG << "Running SourceTopology_Mini"; + JApplication app; + app.SetParameterValue("sut:latency_us", 0); // Infinity Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "source_mini.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + app.Add(new Src); + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("SourceTopology_Small") { + LOG << "Running SourceTopology_Small"; + JApplication app; + app.SetParameterValue("sut:latency_us", 50); // 20 kHz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "source_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + app.Add(new Src); + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("SourceTopology_Medium") { + LOG << "Running SourceTopology_Medium"; + JApplication app; + app.SetParameterValue("sut:latency_us", 10000); // 100 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "source_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + app.Add(new Src); + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("SourceTopology_Large") { + LOG << "Running SourceTopology_Large"; + JApplication app; + app.SetParameterValue("sut:latency_us", 200000); // 5 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "source_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + app.Add(new Src); + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +} + + + diff --git a/src/programs/perf_tests/TapChainTests.cc b/src/programs/perf_tests/TapChainTopology.cc similarity index 82% rename from src/programs/perf_tests/TapChainTests.cc rename to src/programs/perf_tests/TapChainTopology.cc index 79e08a55a..dcedad9a7 100644 --- a/src/programs/perf_tests/TapChainTests.cc +++ b/src/programs/perf_tests/TapChainTopology.cc @@ -9,7 +9,7 @@ #include -namespace jana::tap_chain_tests { +namespace jana::perftest::tapchain { struct Data { size_t x; }; @@ -53,9 +53,9 @@ struct Proc : public JEventProcessor { }; -TEST_CASE("TapChainTests_1") { +TEST_CASE("TapChainTopology_1_Mini") { - LOG << "Running TapChainTests_1"; + LOG << "Running TapChainTopology_1_Mini"; JApplication app; app.Add(new Src); @@ -63,7 +63,7 @@ TEST_CASE("TapChainTests_1") { app.Add(new Proc); app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_1.dat"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_1_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); @@ -72,9 +72,9 @@ TEST_CASE("TapChainTests_1") { benchmarker.RunUntilFinished(); } -TEST_CASE("TapChainTests_4") { +TEST_CASE("TapChainTopology_4_Mini") { - LOG << "Running TapChainTests_4"; + LOG << "Running TapChainTopology_4_Mini"; JApplication app; app.Add(new Src); @@ -84,7 +84,7 @@ TEST_CASE("TapChainTests_4") { } app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_4.dat"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_4_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); @@ -93,9 +93,9 @@ TEST_CASE("TapChainTests_4") { benchmarker.RunUntilFinished(); } -TEST_CASE("TapChainTests_16") { +TEST_CASE("TapChainTopology_16_Mini") { - LOG << "Running TapChainTests_16"; + LOG << "Running TapChainTopology_16_Mini"; JApplication app; app.Add(new Src); @@ -105,7 +105,7 @@ TEST_CASE("TapChainTests_16") { } app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "tap_chain_tests_16.dat"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_16_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); diff --git a/src/programs/perf_tests/MinimalUnfolderTopology.cc b/src/programs/perf_tests/UnfoldTopology.cc similarity index 94% rename from src/programs/perf_tests/MinimalUnfolderTopology.cc rename to src/programs/perf_tests/UnfoldTopology.cc index 971754525..abc0b1702 100644 --- a/src/programs/perf_tests/MinimalUnfolderTopology.cc +++ b/src/programs/perf_tests/UnfoldTopology.cc @@ -10,7 +10,7 @@ #include -namespace jana::minimal_unfolder_topology { +namespace jana::perftest::unfold { struct Data { size_t x; }; @@ -93,13 +93,13 @@ struct PEProc : public JEventProcessor { }; -TEST_CASE("MinimalUnfolderTopology") { +TEST_CASE("UnfoldToplogy_Mini") { LOG << "Running MinimalUnfolderTopology"; JApplication app; app.SetParameterValue("benchmark:resultsdir", "perf_tests"); - app.SetParameterValue("benchmark:rates_filename", "minimal_unfolder_topology.dat"); + app.SetParameterValue("benchmark:rates_filename", "unfold_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); From 77fbbfcd6c812cab472609b026b62e50426caf42 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Mon, 15 Jun 2026 15:59:26 -0400 Subject: [PATCH 11/16] perf_tests: Add {Small, Medium, Large} cases for each topology --- src/programs/perf_tests/BasicTopology.cc | 84 +++++++- src/programs/perf_tests/TapChainTopology.cc | 228 ++++++++++++++++++++ src/programs/perf_tests/UnfoldTopology.cc | 100 ++++++++- 3 files changed, 405 insertions(+), 7 deletions(-) diff --git a/src/programs/perf_tests/BasicTopology.cc b/src/programs/perf_tests/BasicTopology.cc index cb38fdff0..24f12a5e6 100644 --- a/src/programs/perf_tests/BasicTopology.cc +++ b/src/programs/perf_tests/BasicTopology.cc @@ -11,6 +11,7 @@ #include #include #include +#include namespace jana::perftest::basic { @@ -20,13 +21,16 @@ struct Data { size_t x; }; struct PESrc : public JEventSource { Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; PESrc() { + SetPrefix("src"); SetCallbackStyle(CallbackStyle::ExpertMode); data_out.SetShortName("1"); } JEventSource::Result Emit(JEvent& event) override { data_out().push_back(new Data {event.GetEventNumber()*3 }); + JBenchUtils::consume_cpu_us(*latency_us); return Result::Success; }; }; @@ -34,7 +38,9 @@ struct PESrc : public JEventSource { struct PEFac : public JFactory { Input data_in {this}; Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; PEFac() { + SetPrefix("fac"); SetLevel(JEventLevel::PhysicsEvent); data_in.SetDatabundleName("1"); data_out.SetShortName("2"); @@ -42,35 +48,104 @@ struct PEFac : public JFactory { void Process(const JEvent&) override { auto x = data_in().at(0)->x * 10; data_out().push_back(new Data {x}); + JBenchUtils::consume_cpu_us(*latency_us); }; }; struct PEProc : public JEventProcessor { Input data_in {this}; + Parameter latency_us {this, "latency_us", 0}; PEProc() { + SetPrefix("proc"); SetLevel(JEventLevel::PhysicsEvent); SetCallbackStyle(CallbackStyle::ExpertMode); data_in.SetDatabundleName("2"); } void ProcessSequential(const JEvent&) override { (void) (data_in().at(0)->x); + JBenchUtils::consume_cpu_us(*latency_us); }; }; TEST_CASE("BasicTopology_Mini") { - LOG << "Running MinimalPhysicsEventTopology_Benchmarking"; + LOG << "Running BasicTopology_Mini"; JApplication app; + app.SetParameterValue("src:latency_us", 0); // Infinity Hz + app.SetParameterValue("fac:latency_us", 0); // Infinity Hz + app.SetParameterValue("proc:latency_us", 0); // Infinity Hz app.SetParameterValue("benchmark:resultsdir", "perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); app.SetParameterValue("benchmark:maxthreads", "32"); - //app.SetParameterValue("jana:backoff_interval", "1"); - app.SetParameterValue("jana:backoff_interval", "1"); - //app.SetParameterValue("jana:loglevel", "trace"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("BasicTopology_Small") { + + LOG << "Running BasicTopology_Small"; + + JApplication app; + app.SetParameterValue("src:latency_us", 0); + app.SetParameterValue("fac:latency_us", 1000000/5000); // 5 kHz + app.SetParameterValue("proc:latency_us", 0); + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("BasicTopology_Medium") { + + LOG << "Running BasicTopology_Medium"; + + JApplication app; + app.SetParameterValue("src:latency_us", 0); + app.SetParameterValue("fac:latency_us", 1000000/50); // 50 Hz + app.SetParameterValue("proc:latency_us", 0); + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} +TEST_CASE("BasicTopology_Large") { + + LOG << "Running BasicTopology_Large"; + + JApplication app; + app.SetParameterValue("src:latency_us", 0); // Infinity Hz + app.SetParameterValue("fac:latency_us", 1000000/5); // 5 Hz + app.SetParameterValue("proc:latency_us", 0); // 100 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); app.Add(new PESrc); app.Add(new PEProc); @@ -112,7 +187,6 @@ TEST_CASE("BasicTopology_JTest") { } - } // namespace diff --git a/src/programs/perf_tests/TapChainTopology.cc b/src/programs/perf_tests/TapChainTopology.cc index dcedad9a7..9b540c80b 100644 --- a/src/programs/perf_tests/TapChainTopology.cc +++ b/src/programs/perf_tests/TapChainTopology.cc @@ -7,6 +7,7 @@ #include #include #include +#include namespace jana::perftest::tapchain { @@ -16,13 +17,16 @@ struct Data { size_t x; }; struct Src : public JEventSource { Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; Src() { + SetPrefix("src"); SetCallbackStyle(CallbackStyle::ExpertMode); data_out.SetShortName("1"); } JEventSource::Result Emit(JEvent& evt) override { data_out().push_back(new Data {evt.GetEventNumber()*3 }); + JBenchUtils::consume_cpu_us(*latency_us); return Result::Success; }; }; @@ -30,25 +34,31 @@ struct Src : public JEventSource { struct Fac : public JFactory { Input data_in {this}; Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; Fac() { + SetPrefix("fac"); data_in.SetDatabundleName("1"); data_out.SetShortName("2"); } void Process(const JEvent&) override { auto x = data_in().at(0)->x + 7; data_out().push_back(new Data {x}); + JBenchUtils::consume_cpu_us(*latency_us); }; }; struct Proc : public JEventProcessor { Input data_in {this}; + Parameter latency_us {this, "latency_us", 0}; Proc() { + SetPrefix("proc"); SetCallbackStyle(CallbackStyle::ExpertMode); data_in.SetDatabundleName("2"); } void ProcessSequential(const JEvent&) override { (void) (data_in().at(0)->x); + JBenchUtils::consume_cpu_us(*latency_us); }; }; @@ -62,6 +72,9 @@ TEST_CASE("TapChainTopology_1_Mini") { app.Add(new JFactoryGeneratorT); app.Add(new Proc); + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 0); // Inf Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz app.SetParameterValue("benchmark:resultsdir", "perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_1_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); @@ -104,6 +117,9 @@ TEST_CASE("TapChainTopology_16_Mini") { app.Add(new Proc); } + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 0); // Inf Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz app.SetParameterValue("benchmark:resultsdir", "perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_16_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); @@ -114,6 +130,218 @@ TEST_CASE("TapChainTopology_16_Mini") { benchmarker.RunUntilFinished(); } +TEST_CASE("TapChainTopology_1_Small") { + + LOG << "Running TapChainTopology_1_Small"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + app.Add(new Proc); + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_1_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_4_Small") { + + LOG << "Running TapChainTopology_4_Small"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<4; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_4_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_16_Small") { + + LOG << "Running TapChainTopology_16_Small"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<16; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_16_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + +TEST_CASE("TapChainTopology_1_Medium") { + + LOG << "Running TapChainTopology_1_Medium"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + app.Add(new Proc); + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_1_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_4_Medium") { + + LOG << "Running TapChainTopology_4_Medium"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<4; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_4_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_16_Medium") { + + LOG << "Running TapChainTopology_16_Medium"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<16; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_16_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_1_Large") { + + LOG << "Running TapChainTopology_1_Large"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + app.Add(new Proc); + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_1_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_4_Large") { + + LOG << "Running TapChainTopology_4_Large"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<4; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_4_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("TapChainTopology_16_Large") { + + LOG << "Running TapChainTopology_16_Large"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<16; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 0); // Inf Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz + app.SetParameterValue("proc:latency_us", 0); // Inf Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_16_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + } diff --git a/src/programs/perf_tests/UnfoldTopology.cc b/src/programs/perf_tests/UnfoldTopology.cc index abc0b1702..ad1ca84ac 100644 --- a/src/programs/perf_tests/UnfoldTopology.cc +++ b/src/programs/perf_tests/UnfoldTopology.cc @@ -8,6 +8,7 @@ #include #include #include +#include namespace jana::perftest::unfold { @@ -17,14 +18,17 @@ struct Data { size_t x; }; struct BSrc : public JEventSource { Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; BSrc() { + SetPrefix("bsrc"); SetLevel(JEventLevel::Block); SetCallbackStyle(CallbackStyle::ExpertMode); data_out.SetShortName("1"); } JEventSource::Result Emit(JEvent& block) override { data_out().push_back(new Data {block.GetEventNumber()*3 }); + JBenchUtils::consume_cpu_us(*latency_us); return Result::Success; }; }; @@ -32,8 +36,10 @@ struct BSrc : public JEventSource { struct BFac : public JFactory { Input data_in {this}; Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; BFac() { + SetPrefix("bfac"); SetLevel(JEventLevel::Block); data_in.SetDatabundleName("1"); data_out.SetShortName("2"); @@ -41,14 +47,17 @@ struct BFac : public JFactory { void Process(const JEvent&) override { auto x = data_in().at(0)->x + 7; data_out().push_back(new Data {x}); + JBenchUtils::consume_cpu_us(*latency_us); }; }; struct Unf : public JEventUnfolder { Input parent_data_in {this}; Output child_data_out {this}; + Parameter latency_us {this, "latency_us", 0}; Unf() { + SetPrefix("unf"); SetParentLevel(JEventLevel::Block); SetChildLevel(JEventLevel::PhysicsEvent); SetCallbackStyle(CallbackStyle::ExpertMode); @@ -58,6 +67,7 @@ struct Unf : public JEventUnfolder { JEventUnfolder::Result Unfold(const JEvent&, JEvent&, int child_nr) override { auto x = parent_data_in().at(0)->x * 10 + child_nr; child_data_out().push_back(new Data{x}); + JBenchUtils::consume_cpu_us(*latency_us); if (child_nr == 9) { return Result::NextChildNextParent; @@ -69,7 +79,9 @@ struct Unf : public JEventUnfolder { struct PEFac : public JFactory { Input data_in {this}; Output data_out {this}; + Parameter latency_us {this, "latency_us", 0}; PEFac() { + SetPrefix("pefac"); SetLevel(JEventLevel::PhysicsEvent); data_in.SetDatabundleName("3"); data_out.SetShortName("4"); @@ -77,27 +89,36 @@ struct PEFac : public JFactory { void Process(const JEvent&) override { auto x = data_in().at(0)->x * 10; data_out().push_back(new Data {x}); + JBenchUtils::consume_cpu_us(*latency_us); }; }; struct PEProc : public JEventProcessor { Input data_in {this}; + Parameter latency_us {this, "latency_us", 0}; PEProc() { + SetPrefix("peproc"); SetLevel(JEventLevel::PhysicsEvent); SetCallbackStyle(CallbackStyle::ExpertMode); data_in.SetDatabundleName("4"); } void ProcessSequential(const JEvent&) override { (void) (data_in().at(0)->x); + JBenchUtils::consume_cpu_us(*latency_us); }; }; -TEST_CASE("UnfoldToplogy_Mini") { +TEST_CASE("UnfoldTopology_Mini") { - LOG << "Running MinimalUnfolderTopology"; + LOG << "Running UnfoldTopology_Mini"; JApplication app; + app.SetParameterValue("bsrc:latency_us", 0); // Infinity Hz + app.SetParameterValue("bfac:latency_us", 0); // Infinity Hz + app.SetParameterValue("unf:latency_us", 0); // Infinity Hz + app.SetParameterValue("pefac:latency_us", 0); // Infinity Hz + app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz app.SetParameterValue("benchmark:resultsdir", "perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); @@ -114,6 +135,81 @@ TEST_CASE("UnfoldToplogy_Mini") { benchmarker.RunUntilFinished(); } +TEST_CASE("UnfoldTopology_Small") { + LOG << "Running UnfoldTopology_Small"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 0); // Infinity Hz + app.SetParameterValue("bfac:latency_us", 1'000'000 / 500); // 500 Hz + app.SetParameterValue("unf:latency_us", 0); // Infinity Hz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_small.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("UnfoldTopology_Medium") { + LOG << "Running UnfoldTopology_Medium"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 0); // Infinity Hz + app.SetParameterValue("bfac:latency_us", 1'000'000 / 10); // 10 Hz + app.SetParameterValue("unf:latency_us", 0); // Infinity Hz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_medium.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + +TEST_CASE("UnfoldTopology_Large") { + LOG << "Running UnfoldTopology_Large"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 0); // Infinity Hz + app.SetParameterValue("bfac:latency_us", 1'000'000*2); // 0.5 Hz + app.SetParameterValue("unf:latency_us", 0); // Infinity Hz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 5); // 5 Hz + app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_large.dat"); + app.SetParameterValue("benchmark:use_log_scale", true); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "32"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + } From 711b3606e361e6d9b9616f0f1bf8fa9406b606d0 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Tue, 16 Jun 2026 00:03:58 -0400 Subject: [PATCH 12/16] perf_tests: Add saturation and pipelining tests --- src/programs/perf_tests/BasicTopology.cc | 66 ++++++++++++++++++ src/programs/perf_tests/TapChainTopology.cc | 23 +++++++ src/programs/perf_tests/UnfoldTopology.cc | 76 +++++++++++++++++++++ 3 files changed, 165 insertions(+) diff --git a/src/programs/perf_tests/BasicTopology.cc b/src/programs/perf_tests/BasicTopology.cc index 24f12a5e6..7e5eab1bd 100644 --- a/src/programs/perf_tests/BasicTopology.cc +++ b/src/programs/perf_tests/BasicTopology.cc @@ -112,6 +112,28 @@ TEST_CASE("BasicTopology_Small") { benchmarker.RunUntilFinished(); } +TEST_CASE("BasicTopology_Small_Saturation") { + + LOG << "Running BasicTopology_Small_Saturation"; + + JApplication app; + app.SetParameterValue("src:latency_us", 1'000'000 / 40'000); // 40 kHz + app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("proc:latency_us", 1'000'000 / 40'000); // 40 kHz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_small_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + TEST_CASE("BasicTopology_Medium") { LOG << "Running BasicTopology_Medium"; @@ -133,6 +155,28 @@ TEST_CASE("BasicTopology_Medium") { JBenchmarker benchmarker(&app); benchmarker.RunUntilFinished(); } + +TEST_CASE("BasicTopology_Medium_Saturation") { + + LOG << "Running BasicTopology_Medium_Saturation"; + + JApplication app; + app.SetParameterValue("src:latency_us", 1'000'000 / 400); // 400 Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 50); // 50 Hz + app.SetParameterValue("proc:latency_us", 1'000'000 / 400); // 400 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_medium_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} TEST_CASE("BasicTopology_Large") { LOG << "Running BasicTopology_Large"; @@ -155,6 +199,28 @@ TEST_CASE("BasicTopology_Large") { benchmarker.RunUntilFinished(); } +TEST_CASE("BasicTopology_Large_Saturation") { + + LOG << "Running BasicTopology_Large_Saturation"; + + JApplication app; + app.SetParameterValue("src:latency_us", 1'000'000/40); // 40 Hz + app.SetParameterValue("fac:latency_us", 1'000'000/5); // 5 Hz + app.SetParameterValue("proc:latency_us", 1'000'000/40); // 40 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "basic_large_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new PESrc); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + TEST_CASE("BasicTopology_JTest") { // 5Hz for full reconstruction diff --git a/src/programs/perf_tests/TapChainTopology.cc b/src/programs/perf_tests/TapChainTopology.cc index 9b540c80b..e45bc6c75 100644 --- a/src/programs/perf_tests/TapChainTopology.cc +++ b/src/programs/perf_tests/TapChainTopology.cc @@ -341,6 +341,29 @@ TEST_CASE("TapChainTopology_16_Large") { benchmarker.RunUntilFinished(); } +TEST_CASE("TapChainTopology_Pipelining") { + + LOG << "Running TapChainTopology_Pipelining"; + + JApplication app; + app.Add(new Src); + app.Add(new JFactoryGeneratorT); + for (int i=0; i<4; ++i) { + app.Add(new Proc); + } + + app.SetParameterValue("src:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("proc:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "tapchain_pipelining.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} } diff --git a/src/programs/perf_tests/UnfoldTopology.cc b/src/programs/perf_tests/UnfoldTopology.cc index ad1ca84ac..7be02095d 100644 --- a/src/programs/perf_tests/UnfoldTopology.cc +++ b/src/programs/perf_tests/UnfoldTopology.cc @@ -160,6 +160,31 @@ TEST_CASE("UnfoldTopology_Small") { benchmarker.RunUntilFinished(); } +TEST_CASE("UnfoldTopology_Small_Saturation") { + LOG << "Running UnfoldTopology_Small_Saturation"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 1'000'000 / 2'000); // 2 kHz + app.SetParameterValue("bfac:latency_us", 1'000'000 / 500); // 500 Hz + app.SetParameterValue("unf:latency_us", 1'000'000 / 20'000); // 20 kHz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 5000); // 5 kHz + app.SetParameterValue("peproc:latency_us", 1'000'000 / 20'000); // 20 kHz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_small_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + TEST_CASE("UnfoldTopology_Medium") { LOG << "Running UnfoldTopology_Medium"; @@ -185,6 +210,31 @@ TEST_CASE("UnfoldTopology_Medium") { benchmarker.RunUntilFinished(); } +TEST_CASE("UnfoldTopology_Medium_Saturation") { + LOG << "Running UnfoldTopology_Medium"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 1'000'000 / 40); // 40 Hz + app.SetParameterValue("bfac:latency_us", 1'000'000 / 10); // 10 Hz + app.SetParameterValue("unf:latency_us", 1'000'000 / 400); // 400 Hz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 100); // 100 Hz + app.SetParameterValue("peproc:latency_us", 1'000'000 / 400); // 400 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_medium_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + TEST_CASE("UnfoldTopology_Large") { LOG << "Running UnfoldTopology_Large"; @@ -211,6 +261,32 @@ TEST_CASE("UnfoldTopology_Large") { } +TEST_CASE("UnfoldTopology_Large_Saturation") { + LOG << "Running UnfoldTopology_Large_Saturation"; + + JApplication app; + app.SetParameterValue("bsrc:latency_us", 1'000'000 / 2); // 2 Hz + app.SetParameterValue("bfac:latency_us", 1'000'000*2); // 0.5 Hz + app.SetParameterValue("unf:latency_us", 1'000'000 / 20); // 20 Hz + app.SetParameterValue("pefac:latency_us", 1'000'000 / 5); // 5 Hz + app.SetParameterValue("peproc:latency_us", 1'000'000 / 20); // 20 Hz + app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:rates_filename", "unfold_large_saturation.dat"); + app.SetParameterValue("benchmark:use_log_scale", false); + app.SetParameterValue("benchmark:minthreads", "1"); + app.SetParameterValue("benchmark:maxthreads", "16"); + + app.Add(new BSrc); + app.Add(new Unf); + app.Add(new PEProc); + app.Add(new JFactoryGeneratorT); + app.Add(new JFactoryGeneratorT); + + JBenchmarker benchmarker(&app); + benchmarker.RunUntilFinished(); +} + + } From 7bb48ca087b81b1171ac6e0075846e080c98ca8d Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Tue, 16 Jun 2026 00:18:26 -0400 Subject: [PATCH 13/16] perf_test: Add perf_test results to docs/ --- docs/perf_tests/basic_jtest.dat | 7 +++++ docs/perf_tests/basic_large.dat | 7 +++++ docs/perf_tests/basic_large_saturation.dat | 15 +++++++++++ docs/perf_tests/basic_medium.dat | 7 +++++ docs/perf_tests/basic_medium_saturation.dat | 17 ++++++++++++ docs/perf_tests/basic_mini.dat | 7 +++++ docs/perf_tests/basic_small.dat | 7 +++++ docs/perf_tests/basic_small_saturation.dat | 17 ++++++++++++ docs/perf_tests/source_large.dat | 7 +++++ docs/perf_tests/source_medium.dat | 7 +++++ docs/perf_tests/source_mini.dat | 7 +++++ docs/perf_tests/source_small.dat | 7 +++++ .../perf_tests}/tap_chain_plot.toml | 0 docs/perf_tests/tapchain_16_large.dat | 7 +++++ docs/perf_tests/tapchain_16_medium.dat | 7 +++++ docs/perf_tests/tapchain_16_mini.dat | 7 +++++ docs/perf_tests/tapchain_16_small.dat | 7 +++++ docs/perf_tests/tapchain_1_large.dat | 7 +++++ docs/perf_tests/tapchain_1_medium.dat | 7 +++++ docs/perf_tests/tapchain_1_mini.dat | 7 +++++ docs/perf_tests/tapchain_1_small.dat | 7 +++++ docs/perf_tests/tapchain_4_large.dat | 7 +++++ docs/perf_tests/tapchain_4_medium.dat | 7 +++++ docs/perf_tests/tapchain_4_mini.dat | 7 +++++ docs/perf_tests/tapchain_4_small.dat | 7 +++++ docs/perf_tests/tapchain_pipelining.dat | 17 ++++++++++++ docs/perf_tests/unfold_large_saturation.dat | 17 ++++++++++++ docs/perf_tests/unfold_medium.dat | 7 +++++ docs/perf_tests/unfold_medium_saturation.dat | 17 ++++++++++++ docs/perf_tests/unfold_mini.dat | 1 + docs/perf_tests/unfold_small.dat | 7 +++++ docs/perf_tests/unfold_small_saturation.dat | 17 ++++++++++++ src/programs/perf_tests/BasicTopology.cc | 16 ++++++------ src/programs/perf_tests/SourceTopology.cc | 8 +++--- src/programs/perf_tests/TapChainTopology.cc | 26 +++++++++---------- src/programs/perf_tests/UnfoldTopology.cc | 14 +++++----- 36 files changed, 311 insertions(+), 32 deletions(-) create mode 100644 docs/perf_tests/basic_jtest.dat create mode 100644 docs/perf_tests/basic_large.dat create mode 100644 docs/perf_tests/basic_large_saturation.dat create mode 100644 docs/perf_tests/basic_medium.dat create mode 100644 docs/perf_tests/basic_medium_saturation.dat create mode 100644 docs/perf_tests/basic_mini.dat create mode 100644 docs/perf_tests/basic_small.dat create mode 100644 docs/perf_tests/basic_small_saturation.dat create mode 100644 docs/perf_tests/source_large.dat create mode 100644 docs/perf_tests/source_medium.dat create mode 100644 docs/perf_tests/source_mini.dat create mode 100644 docs/perf_tests/source_small.dat rename {perf_tests => docs/perf_tests}/tap_chain_plot.toml (100%) create mode 100644 docs/perf_tests/tapchain_16_large.dat create mode 100644 docs/perf_tests/tapchain_16_medium.dat create mode 100644 docs/perf_tests/tapchain_16_mini.dat create mode 100644 docs/perf_tests/tapchain_16_small.dat create mode 100644 docs/perf_tests/tapchain_1_large.dat create mode 100644 docs/perf_tests/tapchain_1_medium.dat create mode 100644 docs/perf_tests/tapchain_1_mini.dat create mode 100644 docs/perf_tests/tapchain_1_small.dat create mode 100644 docs/perf_tests/tapchain_4_large.dat create mode 100644 docs/perf_tests/tapchain_4_medium.dat create mode 100644 docs/perf_tests/tapchain_4_mini.dat create mode 100644 docs/perf_tests/tapchain_4_small.dat create mode 100644 docs/perf_tests/tapchain_pipelining.dat create mode 100644 docs/perf_tests/unfold_large_saturation.dat create mode 100644 docs/perf_tests/unfold_medium.dat create mode 100644 docs/perf_tests/unfold_medium_saturation.dat create mode 100644 docs/perf_tests/unfold_mini.dat create mode 100644 docs/perf_tests/unfold_small.dat create mode 100644 docs/perf_tests/unfold_small_saturation.dat diff --git a/docs/perf_tests/basic_jtest.dat b/docs/perf_tests/basic_jtest.dat new file mode 100644 index 000000000..b376c095e --- /dev/null +++ b/docs/perf_tests/basic_jtest.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 4.03 0.38 + 2 8.37 1.58 + 4 15.97 0.46 + 8 31.77 2.71 + 16 60.03 1.59 + 32 91.61 6.06 diff --git a/docs/perf_tests/basic_large.dat b/docs/perf_tests/basic_large.dat new file mode 100644 index 000000000..a10d32c71 --- /dev/null +++ b/docs/perf_tests/basic_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 5.03 0.11 + 2 10.00 0.00 + 4 21.50 5.31 + 8 39.97 1.77 + 16 79.85 4.35 + 32 158.84 2.02 diff --git a/docs/perf_tests/basic_large_saturation.dat b/docs/perf_tests/basic_large_saturation.dat new file mode 100644 index 000000000..9e7c2626f --- /dev/null +++ b/docs/perf_tests/basic_large_saturation.dat @@ -0,0 +1,15 @@ +# nthreads avg_rate rms + 1 4.17 0.36 + 2 8.37 0.46 + 3 12.50 0.48 + 4 16.67 0.47 + 5 20.87 0.34 + 6 25.00 0.00 + 7 29.20 0.40 + 8 33.30 0.44 + 9 37.53 0.50 + 10 41.70 0.44 + 11 45.77 0.40 + 12 49.86 0.35 + 13 49.93 0.25 + 14 49.93 0.25 diff --git a/docs/perf_tests/basic_medium.dat b/docs/perf_tests/basic_medium.dat new file mode 100644 index 000000000..36d0e99db --- /dev/null +++ b/docs/perf_tests/basic_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 50.03 0.13 + 2 100.00 0.00 + 4 200.13 0.50 + 8 399.90 0.37 + 16 797.01 3.32 + 32 1354.36 16.89 diff --git a/docs/perf_tests/basic_medium_saturation.dat b/docs/perf_tests/basic_medium_saturation.dat new file mode 100644 index 000000000..700aed18d --- /dev/null +++ b/docs/perf_tests/basic_medium_saturation.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 40.01 0.03 + 2 79.93 0.25 + 3 120.00 0.00 + 4 159.80 0.54 + 5 199.67 0.47 + 6 239.57 0.48 + 7 279.63 0.46 + 8 319.43 0.70 + 9 359.70 0.44 + 10 397.73 0.68 + 11 395.08 1.00 + 12 396.73 1.61 + 13 398.27 1.18 + 14 398.07 1.12 + 15 397.80 0.98 + 16 397.90 2.00 diff --git a/docs/perf_tests/basic_mini.dat b/docs/perf_tests/basic_mini.dat new file mode 100644 index 000000000..f30f7221c --- /dev/null +++ b/docs/perf_tests/basic_mini.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 190930.83 2488.46 + 2 231752.10 5585.27 + 4 141533.50 1581.23 + 8 106649.87 1349.99 + 16 87466.40 1185.79 + 32 83267.93 679.62 diff --git a/docs/perf_tests/basic_small.dat b/docs/perf_tests/basic_small.dat new file mode 100644 index 000000000..cc60ec9e9 --- /dev/null +++ b/docs/perf_tests/basic_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 4858.43 4.12 + 2 9703.20 6.65 + 4 19375.80 15.53 + 8 38578.50 35.43 + 16 71851.62 2097.06 + 32 43205.17 944.35 diff --git a/docs/perf_tests/basic_small_saturation.dat b/docs/perf_tests/basic_small_saturation.dat new file mode 100644 index 000000000..f90036d56 --- /dev/null +++ b/docs/perf_tests/basic_small_saturation.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 3888.83 10.25 + 2 7786.33 4.86 + 3 11679.20 11.70 + 4 15569.80 5.46 + 5 19419.43 6.57 + 6 23277.30 34.13 + 7 27173.50 25.67 + 8 30967.57 41.99 + 9 33661.67 116.82 + 10 31492.67 217.84 + 11 30610.73 228.05 + 12 31255.63 571.08 + 13 31506.47 419.38 + 14 31313.00 1150.40 + 15 30833.60 1009.03 + 16 30601.77 666.70 diff --git a/docs/perf_tests/source_large.dat b/docs/perf_tests/source_large.dat new file mode 100644 index 000000000..5bb84f2b4 --- /dev/null +++ b/docs/perf_tests/source_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 5.00 0.00 + 2 5.07 0.25 + 4 4.93 0.25 + 8 5.07 0.25 + 16 5.00 0.00 + 32 5.00 0.00 diff --git a/docs/perf_tests/source_medium.dat b/docs/perf_tests/source_medium.dat new file mode 100644 index 000000000..416fcfe0f --- /dev/null +++ b/docs/perf_tests/source_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 99.92 0.25 + 2 99.93 0.25 + 4 99.93 0.25 + 8 99.93 0.25 + 16 99.93 0.25 + 32 99.93 0.25 diff --git a/docs/perf_tests/source_mini.dat b/docs/perf_tests/source_mini.dat new file mode 100644 index 000000000..b17a8b4a1 --- /dev/null +++ b/docs/perf_tests/source_mini.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 553822.67 4162.75 + 2 443977.00 3920.34 + 4 260414.27 2358.93 + 8 262189.37 3135.67 + 16 275358.57 11117.66 + 32 291814.23 5436.96 diff --git a/docs/perf_tests/source_small.dat b/docs/perf_tests/source_small.dat new file mode 100644 index 000000000..0a2baa6b6 --- /dev/null +++ b/docs/perf_tests/source_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 19215.60 14.45 + 2 18904.53 30.81 + 4 18906.60 14.63 + 8 18856.73 38.95 + 16 18837.30 27.80 + 32 18836.17 42.77 diff --git a/perf_tests/tap_chain_plot.toml b/docs/perf_tests/tap_chain_plot.toml similarity index 100% rename from perf_tests/tap_chain_plot.toml rename to docs/perf_tests/tap_chain_plot.toml diff --git a/docs/perf_tests/tapchain_16_large.dat b/docs/perf_tests/tapchain_16_large.dat new file mode 100644 index 000000000..adc73154a --- /dev/null +++ b/docs/perf_tests/tapchain_16_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 5.00 0.00 + 2 10.00 0.00 + 4 20.13 0.34 + 8 39.80 2.29 + 16 79.94 2.62 + 32 159.82 0.36 diff --git a/docs/perf_tests/tapchain_16_medium.dat b/docs/perf_tests/tapchain_16_medium.dat new file mode 100644 index 000000000..9b3404ff3 --- /dev/null +++ b/docs/perf_tests/tapchain_16_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 99.67 0.60 + 2 199.17 0.96 + 4 398.47 1.15 + 8 796.60 1.74 + 16 1581.94 9.75 + 32 1575.83 22.02 diff --git a/docs/perf_tests/tapchain_16_mini.dat b/docs/perf_tests/tapchain_16_mini.dat new file mode 100644 index 000000000..572f8ab39 --- /dev/null +++ b/docs/perf_tests/tapchain_16_mini.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 30710.97 341.10 + 2 47995.77 568.76 + 4 43288.43 199.97 + 8 39253.33 488.96 + 16 17947.70 246.77 + 32 10354.67 89.94 diff --git a/docs/perf_tests/tapchain_16_small.dat b/docs/perf_tests/tapchain_16_small.dat new file mode 100644 index 000000000..41868b5f2 --- /dev/null +++ b/docs/perf_tests/tapchain_16_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 4299.23 4.51 + 2 8532.77 15.58 + 4 16914.37 13.05 + 8 29549.13 2884.24 + 16 19457.10 317.42 + 32 9017.37 317.93 diff --git a/docs/perf_tests/tapchain_1_large.dat b/docs/perf_tests/tapchain_1_large.dat new file mode 100644 index 000000000..6f9ee751c --- /dev/null +++ b/docs/perf_tests/tapchain_1_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 5.06 0.23 + 2 10.00 0.37 + 4 21.87 4.11 + 8 39.70 1.39 + 16 79.99 3.18 + 32 159.15 2.21 diff --git a/docs/perf_tests/tapchain_1_medium.dat b/docs/perf_tests/tapchain_1_medium.dat new file mode 100644 index 000000000..72f376cb4 --- /dev/null +++ b/docs/perf_tests/tapchain_1_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 99.87 0.34 + 2 200.20 1.33 + 4 399.60 0.80 + 8 800.53 4.29 + 16 1558.88 20.35 + 32 2047.32 67.26 diff --git a/docs/perf_tests/tapchain_1_mini.dat b/docs/perf_tests/tapchain_1_mini.dat new file mode 100644 index 000000000..b58ecb690 --- /dev/null +++ b/docs/perf_tests/tapchain_1_mini.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 188570.13 2518.54 + 2 248379.20 8791.90 + 4 140491.40 1144.09 + 8 106527.73 1302.45 + 16 87772.90 839.54 + 32 82710.43 1024.06 diff --git a/docs/perf_tests/tapchain_1_small.dat b/docs/perf_tests/tapchain_1_small.dat new file mode 100644 index 000000000..09a7db41c --- /dev/null +++ b/docs/perf_tests/tapchain_1_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 4860.50 2.53 + 2 9697.40 7.67 + 4 19359.60 20.08 + 8 38571.07 25.57 + 16 72145.49 1563.42 + 32 43778.06 344.54 diff --git a/docs/perf_tests/tapchain_4_large.dat b/docs/perf_tests/tapchain_4_large.dat new file mode 100644 index 000000000..5ed562305 --- /dev/null +++ b/docs/perf_tests/tapchain_4_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 5.03 0.11 + 2 10.00 0.00 + 4 20.07 0.25 + 8 40.87 2.03 + 16 80.23 2.98 + 32 158.98 1.70 diff --git a/docs/perf_tests/tapchain_4_medium.dat b/docs/perf_tests/tapchain_4_medium.dat new file mode 100644 index 000000000..bfcf61ed5 --- /dev/null +++ b/docs/perf_tests/tapchain_4_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 99.77 0.40 + 2 199.50 0.88 + 4 399.47 0.88 + 8 798.57 1.28 + 16 1586.63 10.06 + 32 1878.10 30.02 diff --git a/docs/perf_tests/tapchain_4_mini.dat b/docs/perf_tests/tapchain_4_mini.dat new file mode 100644 index 000000000..dc20a3b84 --- /dev/null +++ b/docs/perf_tests/tapchain_4_mini.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 93235.03 473.91 + 2 106363.43 530.25 + 4 115753.13 655.35 + 8 72784.50 1207.79 + 16 48907.10 493.74 + 32 42051.63 896.34 diff --git a/docs/perf_tests/tapchain_4_small.dat b/docs/perf_tests/tapchain_4_small.dat new file mode 100644 index 000000000..9f99014d0 --- /dev/null +++ b/docs/perf_tests/tapchain_4_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 4730.80 7.26 + 2 9418.97 11.14 + 4 18782.47 32.13 + 8 37206.27 104.26 + 16 60806.00 1318.17 + 32 29372.92 202.33 diff --git a/docs/perf_tests/tapchain_pipelining.dat b/docs/perf_tests/tapchain_pipelining.dat new file mode 100644 index 000000000..4f42cc361 --- /dev/null +++ b/docs/perf_tests/tapchain_pipelining.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 16.66 0.47 + 2 33.30 0.44 + 3 49.97 0.12 + 4 66.63 0.46 + 5 83.30 0.44 + 6 100.00 0.00 + 7 99.93 0.25 + 8 99.93 0.25 + 9 100.00 0.00 + 10 99.90 0.27 + 11 99.93 0.25 + 12 100.00 0.00 + 13 99.93 0.25 + 14 99.93 0.25 + 15 99.87 0.34 + 16 100.00 0.00 diff --git a/docs/perf_tests/unfold_large_saturation.dat b/docs/perf_tests/unfold_large_saturation.dat new file mode 100644 index 000000000..46fe9a8c5 --- /dev/null +++ b/docs/perf_tests/unfold_large_saturation.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 0.37 0.46 + 2 2.27 1.61 + 3 5.40 1.54 + 4 7.30 1.50 + 5 9.07 1.06 + 6 10.90 1.07 + 7 12.60 1.31 + 8 14.43 1.25 + 9 16.37 1.49 + 10 17.87 1.09 + 11 19.77 0.40 + 12 20.00 0.00 + 13 19.93 0.25 + 14 20.00 0.00 + 15 20.00 0.00 + 16 20.00 0.01 diff --git a/docs/perf_tests/unfold_medium.dat b/docs/perf_tests/unfold_medium.dat new file mode 100644 index 000000000..f58590914 --- /dev/null +++ b/docs/perf_tests/unfold_medium.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 49.88 0.45 + 2 100.03 0.12 + 4 200.00 0.97 + 8 399.93 1.53 + 16 796.81 4.08 + 32 1406.16 17.78 diff --git a/docs/perf_tests/unfold_medium_saturation.dat b/docs/perf_tests/unfold_medium_saturation.dat new file mode 100644 index 000000000..63d8ceefb --- /dev/null +++ b/docs/perf_tests/unfold_medium_saturation.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 34.86 5.98 + 2 72.50 1.20 + 3 108.33 1.35 + 4 144.33 1.35 + 5 180.17 1.50 + 6 216.23 1.17 + 7 251.27 1.81 + 8 285.70 3.56 + 9 320.73 3.02 + 10 351.20 1.80 + 11 383.87 4.04 + 12 387.92 4.03 + 13 396.37 1.72 + 14 396.67 1.14 + 15 395.54 2.95 + 16 396.50 0.91 diff --git a/docs/perf_tests/unfold_mini.dat b/docs/perf_tests/unfold_mini.dat new file mode 100644 index 000000000..62613e6be --- /dev/null +++ b/docs/perf_tests/unfold_mini.dat @@ -0,0 +1 @@ +# nthreads avg_rate rms diff --git a/docs/perf_tests/unfold_small.dat b/docs/perf_tests/unfold_small.dat new file mode 100644 index 000000000..d45c5e60a --- /dev/null +++ b/docs/perf_tests/unfold_small.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 2448.52 2.87 + 2 4896.73 5.89 + 4 9778.10 7.40 + 8 19442.83 33.62 + 16 35760.35 1565.34 + 32 26004.94 209.94 diff --git a/docs/perf_tests/unfold_small_saturation.dat b/docs/perf_tests/unfold_small_saturation.dat new file mode 100644 index 000000000..f59828d90 --- /dev/null +++ b/docs/perf_tests/unfold_small_saturation.dat @@ -0,0 +1,17 @@ +# nthreads avg_rate rms + 1 1764.42 22.17 + 2 3538.43 3.98 + 3 5298.67 18.36 + 4 7030.50 25.42 + 5 8778.37 16.27 + 6 10510.17 35.15 + 7 12228.70 24.27 + 8 13812.60 18.31 + 9 15293.10 131.17 + 10 16301.37 83.67 + 11 16669.40 205.62 + 12 16760.97 145.09 + 13 16401.73 181.22 + 14 16348.50 287.65 + 15 16725.03 132.58 + 16 16747.83 128.27 diff --git a/src/programs/perf_tests/BasicTopology.cc b/src/programs/perf_tests/BasicTopology.cc index 7e5eab1bd..c9e21a9aa 100644 --- a/src/programs/perf_tests/BasicTopology.cc +++ b/src/programs/perf_tests/BasicTopology.cc @@ -76,7 +76,7 @@ TEST_CASE("BasicTopology_Mini") { app.SetParameterValue("src:latency_us", 0); // Infinity Hz app.SetParameterValue("fac:latency_us", 0); // Infinity Hz app.SetParameterValue("proc:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -98,7 +98,7 @@ TEST_CASE("BasicTopology_Small") { app.SetParameterValue("src:latency_us", 0); app.SetParameterValue("fac:latency_us", 1000000/5000); // 5 kHz app.SetParameterValue("proc:latency_us", 0); - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -120,7 +120,7 @@ TEST_CASE("BasicTopology_Small_Saturation") { app.SetParameterValue("src:latency_us", 1'000'000 / 40'000); // 40 kHz app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("proc:latency_us", 1'000'000 / 40'000); // 40 kHz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_small_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); @@ -142,7 +142,7 @@ TEST_CASE("BasicTopology_Medium") { app.SetParameterValue("src:latency_us", 0); app.SetParameterValue("fac:latency_us", 1000000/50); // 50 Hz app.SetParameterValue("proc:latency_us", 0); - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -164,7 +164,7 @@ TEST_CASE("BasicTopology_Medium_Saturation") { app.SetParameterValue("src:latency_us", 1'000'000 / 400); // 400 Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 50); // 50 Hz app.SetParameterValue("proc:latency_us", 1'000'000 / 400); // 400 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_medium_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); @@ -185,7 +185,7 @@ TEST_CASE("BasicTopology_Large") { app.SetParameterValue("src:latency_us", 0); // Infinity Hz app.SetParameterValue("fac:latency_us", 1000000/5); // 5 Hz app.SetParameterValue("proc:latency_us", 0); // 100 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -207,7 +207,7 @@ TEST_CASE("BasicTopology_Large_Saturation") { app.SetParameterValue("src:latency_us", 1'000'000/40); // 40 Hz app.SetParameterValue("fac:latency_us", 1'000'000/5); // 5 Hz app.SetParameterValue("proc:latency_us", 1'000'000/40); // 40 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "basic_large_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); @@ -237,7 +237,7 @@ TEST_CASE("BasicTopology_JTest") { params->SetParameter("jtest:parser:cputime_ms", 2); params->SetParameter("jtest:plotter:cputime_ms", 2); - params->SetParameter("benchmark:resultsdir", "perf_tests"); + params->SetParameter("benchmark:resultsdir", "docs/perf_tests"); params->SetParameter("benchmark:rates_filename", "basic_jtest.dat"); params->SetParameter("benchmark:use_log_scale", true); params->SetParameter("benchmark:minthreads", "1"); diff --git a/src/programs/perf_tests/SourceTopology.cc b/src/programs/perf_tests/SourceTopology.cc index 3f253b4b4..63d603d49 100644 --- a/src/programs/perf_tests/SourceTopology.cc +++ b/src/programs/perf_tests/SourceTopology.cc @@ -35,7 +35,7 @@ TEST_CASE("SourceTopology_Mini") { LOG << "Running SourceTopology_Mini"; JApplication app; app.SetParameterValue("sut:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "source_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -49,7 +49,7 @@ TEST_CASE("SourceTopology_Small") { LOG << "Running SourceTopology_Small"; JApplication app; app.SetParameterValue("sut:latency_us", 50); // 20 kHz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "source_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -63,7 +63,7 @@ TEST_CASE("SourceTopology_Medium") { LOG << "Running SourceTopology_Medium"; JApplication app; app.SetParameterValue("sut:latency_us", 10000); // 100 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "source_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -77,7 +77,7 @@ TEST_CASE("SourceTopology_Large") { LOG << "Running SourceTopology_Large"; JApplication app; app.SetParameterValue("sut:latency_us", 200000); // 5 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "source_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); diff --git a/src/programs/perf_tests/TapChainTopology.cc b/src/programs/perf_tests/TapChainTopology.cc index e45bc6c75..b38dc9363 100644 --- a/src/programs/perf_tests/TapChainTopology.cc +++ b/src/programs/perf_tests/TapChainTopology.cc @@ -75,7 +75,7 @@ TEST_CASE("TapChainTopology_1_Mini") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 0); // Inf Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_1_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -96,7 +96,7 @@ TEST_CASE("TapChainTopology_4_Mini") { app.Add(new Proc); } - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_4_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -120,7 +120,7 @@ TEST_CASE("TapChainTopology_16_Mini") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 0); // Inf Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_16_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -142,7 +142,7 @@ TEST_CASE("TapChainTopology_1_Small") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_1_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -166,7 +166,7 @@ TEST_CASE("TapChainTopology_4_Small") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_4_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -190,7 +190,7 @@ TEST_CASE("TapChainTopology_16_Small") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_16_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -213,7 +213,7 @@ TEST_CASE("TapChainTopology_1_Medium") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_1_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -237,7 +237,7 @@ TEST_CASE("TapChainTopology_4_Medium") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_4_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -261,7 +261,7 @@ TEST_CASE("TapChainTopology_16_Medium") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_16_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -283,7 +283,7 @@ TEST_CASE("TapChainTopology_1_Large") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_1_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -307,7 +307,7 @@ TEST_CASE("TapChainTopology_4_Large") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_4_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -331,7 +331,7 @@ TEST_CASE("TapChainTopology_16_Large") { app.SetParameterValue("src:latency_us", 0); // Inf Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 5); // 5 Hz app.SetParameterValue("proc:latency_us", 0); // Inf Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_16_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -355,7 +355,7 @@ TEST_CASE("TapChainTopology_Pipelining") { app.SetParameterValue("src:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("fac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("proc:latency_us", 1'000'000 / 100); // 100 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "tapchain_pipelining.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); diff --git a/src/programs/perf_tests/UnfoldTopology.cc b/src/programs/perf_tests/UnfoldTopology.cc index 7be02095d..918fc41e9 100644 --- a/src/programs/perf_tests/UnfoldTopology.cc +++ b/src/programs/perf_tests/UnfoldTopology.cc @@ -119,7 +119,7 @@ TEST_CASE("UnfoldTopology_Mini") { app.SetParameterValue("unf:latency_us", 0); // Infinity Hz app.SetParameterValue("pefac:latency_us", 0); // Infinity Hz app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_mini.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -144,7 +144,7 @@ TEST_CASE("UnfoldTopology_Small") { app.SetParameterValue("unf:latency_us", 0); // Infinity Hz app.SetParameterValue("pefac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_small.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -169,7 +169,7 @@ TEST_CASE("UnfoldTopology_Small_Saturation") { app.SetParameterValue("unf:latency_us", 1'000'000 / 20'000); // 20 kHz app.SetParameterValue("pefac:latency_us", 1'000'000 / 5000); // 5 kHz app.SetParameterValue("peproc:latency_us", 1'000'000 / 20'000); // 20 kHz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_small_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); @@ -194,7 +194,7 @@ TEST_CASE("UnfoldTopology_Medium") { app.SetParameterValue("unf:latency_us", 0); // Infinity Hz app.SetParameterValue("pefac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_medium.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -219,7 +219,7 @@ TEST_CASE("UnfoldTopology_Medium_Saturation") { app.SetParameterValue("unf:latency_us", 1'000'000 / 400); // 400 Hz app.SetParameterValue("pefac:latency_us", 1'000'000 / 100); // 100 Hz app.SetParameterValue("peproc:latency_us", 1'000'000 / 400); // 400 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_medium_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); @@ -244,7 +244,7 @@ TEST_CASE("UnfoldTopology_Large") { app.SetParameterValue("unf:latency_us", 0); // Infinity Hz app.SetParameterValue("pefac:latency_us", 1'000'000 / 5); // 5 Hz app.SetParameterValue("peproc:latency_us", 0); // Infinity Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_large.dat"); app.SetParameterValue("benchmark:use_log_scale", true); app.SetParameterValue("benchmark:minthreads", "1"); @@ -270,7 +270,7 @@ TEST_CASE("UnfoldTopology_Large_Saturation") { app.SetParameterValue("unf:latency_us", 1'000'000 / 20); // 20 Hz app.SetParameterValue("pefac:latency_us", 1'000'000 / 5); // 5 Hz app.SetParameterValue("peproc:latency_us", 1'000'000 / 20); // 20 Hz - app.SetParameterValue("benchmark:resultsdir", "perf_tests"); + app.SetParameterValue("benchmark:resultsdir", "docs/perf_tests"); app.SetParameterValue("benchmark:rates_filename", "unfold_large_saturation.dat"); app.SetParameterValue("benchmark:use_log_scale", false); app.SetParameterValue("benchmark:minthreads", "1"); From c27c2221864c82e5e84c4a753deee115e9877767 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Mon, 1 Jun 2026 01:12:43 -0400 Subject: [PATCH 14/16] JExecutionEngine: Only check for pause when already pausing or draining --- src/libraries/JANA/Engine/JExecutionEngine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index be3669cf2..916ef82e2 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -611,7 +611,7 @@ void JExecutionEngine::FindNextReadyTask_Unsafe(Task& task, WorkerState& worker) // Note that our worker threads will still wait at ExchangeTask() until they get // shut down separately during Scale(). - if (m_runstatus == RunStatus::Running || m_runstatus == RunStatus::Pausing || m_runstatus == RunStatus::Draining) { + if (m_runstatus == RunStatus::Pausing || m_runstatus == RunStatus::Draining) { // We want to avoid scenarios such as where the topology already Finished but then gets reset to Paused // This also leaves a cleaner narrative in the logs. From bc8baa6251299a4dc0fc2fb5fa37e7cba3f030de Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Mon, 1 Jun 2026 12:39:08 -0400 Subject: [PATCH 15/16] JExecutionEngine: Wake fewer workers --- src/libraries/JANA/Engine/JExecutionEngine.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index 916ef82e2..60fd6a94e 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -495,7 +495,9 @@ void JExecutionEngine::ExchangeTask(Task& task, size_t worker_id, bool nonblocki // Notify one worker, who will notify the next, etc, as long as FindNextReadyTaskUnsafe() succeeds. // After FindNextReadyTaskUnsafe fails, all threads block until the next returning worker reactivates the // notification chain. - m_condvar.notify_one(); + if (task.arrow != nullptr && task.arrow->IsParallel()) { + m_condvar.notify_one(); + } } From 13a0b930487cb6d91033fb75912e1775a458fc78 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Tue, 16 Jun 2026 02:00:17 -0400 Subject: [PATCH 16/16] Re-run perf tests --- docs/perf_tests/basic_jtest.dat | 12 +- docs/perf_tests/basic_large.dat | 10 +- docs/perf_tests/basic_large_saturation.dat | 30 +-- docs/perf_tests/basic_medium.dat | 12 +- docs/perf_tests/basic_medium_saturation.dat | 28 +-- docs/perf_tests/basic_mini.dat | 12 +- docs/perf_tests/basic_small.dat | 12 +- docs/perf_tests/basic_small_saturation.dat | 32 +-- docs/perf_tests/samples.dat | 241 +++++++++++++++++++ docs/perf_tests/source_large.dat | 6 +- docs/perf_tests/source_medium.dat | 10 +- docs/perf_tests/source_mini.dat | 12 +- docs/perf_tests/source_small.dat | 12 +- docs/perf_tests/tapchain_16_large.dat | 8 +- docs/perf_tests/tapchain_16_medium.dat | 12 +- docs/perf_tests/tapchain_16_mini.dat | 12 +- docs/perf_tests/tapchain_16_small.dat | 12 +- docs/perf_tests/tapchain_1_large.dat | 12 +- docs/perf_tests/tapchain_1_medium.dat | 12 +- docs/perf_tests/tapchain_1_mini.dat | 12 +- docs/perf_tests/tapchain_1_small.dat | 12 +- docs/perf_tests/tapchain_4_large.dat | 8 +- docs/perf_tests/tapchain_4_medium.dat | 12 +- docs/perf_tests/tapchain_4_mini.dat | 12 +- docs/perf_tests/tapchain_4_small.dat | 12 +- docs/perf_tests/tapchain_pipelining.dat | 28 +-- docs/perf_tests/unfold_large.dat | 7 + docs/perf_tests/unfold_large_saturation.dat | 30 +-- docs/perf_tests/unfold_medium.dat | 12 +- docs/perf_tests/unfold_medium_saturation.dat | 32 +-- docs/perf_tests/unfold_mini.dat | 6 + docs/perf_tests/unfold_small.dat | 12 +- docs/perf_tests/unfold_small_saturation.dat | 32 +-- 33 files changed, 490 insertions(+), 234 deletions(-) create mode 100644 docs/perf_tests/samples.dat create mode 100644 docs/perf_tests/unfold_large.dat diff --git a/docs/perf_tests/basic_jtest.dat b/docs/perf_tests/basic_jtest.dat index b376c095e..2ab3bcd4e 100644 --- a/docs/perf_tests/basic_jtest.dat +++ b/docs/perf_tests/basic_jtest.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 4.03 0.38 - 2 8.37 1.58 - 4 15.97 0.46 - 8 31.77 2.71 - 16 60.03 1.59 - 32 91.61 6.06 + 1 4.03 0.53 + 2 8.07 0.68 + 4 15.97 0.94 + 8 31.93 1.57 + 16 61.46 3.20 + 32 92.77 4.87 diff --git a/docs/perf_tests/basic_large.dat b/docs/perf_tests/basic_large.dat index a10d32c71..52a4393bf 100644 --- a/docs/perf_tests/basic_large.dat +++ b/docs/perf_tests/basic_large.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 5.03 0.11 + 1 5.00 0.00 2 10.00 0.00 - 4 21.50 5.31 - 8 39.97 1.77 - 16 79.85 4.35 - 32 158.84 2.02 + 4 21.70 6.56 + 8 39.43 1.72 + 16 80.01 2.43 + 32 158.83 2.24 diff --git a/docs/perf_tests/basic_large_saturation.dat b/docs/perf_tests/basic_large_saturation.dat index 9e7c2626f..e3c91a8e6 100644 --- a/docs/perf_tests/basic_large_saturation.dat +++ b/docs/perf_tests/basic_large_saturation.dat @@ -1,15 +1,17 @@ # nthreads avg_rate rms - 1 4.17 0.36 - 2 8.37 0.46 - 3 12.50 0.48 - 4 16.67 0.47 - 5 20.87 0.34 - 6 25.00 0.00 - 7 29.20 0.40 - 8 33.30 0.44 - 9 37.53 0.50 - 10 41.70 0.44 - 11 45.77 0.40 - 12 49.86 0.35 - 13 49.93 0.25 - 14 49.93 0.25 + 1 3.98 0.08 + 2 8.07 0.25 + 3 12.03 0.12 + 4 16.00 0.00 + 5 20.00 0.00 + 6 24.00 0.00 + 7 28.00 0.00 + 8 32.03 0.12 + 9 36.00 0.00 + 10 40.00 0.00 + 11 40.00 0.00 + 12 40.00 0.00 + 13 39.93 0.25 + 14 40.00 0.00 + 15 39.93 0.25 + 16 40.00 0.00 diff --git a/docs/perf_tests/basic_medium.dat b/docs/perf_tests/basic_medium.dat index 36d0e99db..598bda9cb 100644 --- a/docs/perf_tests/basic_medium.dat +++ b/docs/perf_tests/basic_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 50.03 0.13 - 2 100.00 0.00 - 4 200.13 0.50 - 8 399.90 0.37 - 16 797.01 3.32 - 32 1354.36 16.89 + 1 49.94 0.24 + 2 100.10 0.52 + 4 199.87 0.50 + 8 400.03 3.16 + 16 797.37 1.77 + 32 1385.96 11.83 diff --git a/docs/perf_tests/basic_medium_saturation.dat b/docs/perf_tests/basic_medium_saturation.dat index 700aed18d..f2025fda6 100644 --- a/docs/perf_tests/basic_medium_saturation.dat +++ b/docs/perf_tests/basic_medium_saturation.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms 1 40.01 0.03 2 79.93 0.25 - 3 120.00 0.00 - 4 159.80 0.54 - 5 199.67 0.47 - 6 239.57 0.48 - 7 279.63 0.46 - 8 319.43 0.70 - 9 359.70 0.44 - 10 397.73 0.68 - 11 395.08 1.00 - 12 396.73 1.61 - 13 398.27 1.18 - 14 398.07 1.12 - 15 397.80 0.98 - 16 397.90 2.00 + 3 119.93 0.25 + 4 159.90 0.37 + 5 199.83 0.35 + 6 239.90 0.27 + 7 279.87 0.34 + 8 319.70 0.44 + 9 359.73 0.44 + 10 397.67 0.79 + 11 397.23 0.75 + 12 396.83 0.85 + 13 397.30 0.57 + 14 397.30 0.44 + 15 397.27 0.77 + 16 396.63 2.13 diff --git a/docs/perf_tests/basic_mini.dat b/docs/perf_tests/basic_mini.dat index f30f7221c..c8a856ade 100644 --- a/docs/perf_tests/basic_mini.dat +++ b/docs/perf_tests/basic_mini.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 190930.83 2488.46 - 2 231752.10 5585.27 - 4 141533.50 1581.23 - 8 106649.87 1349.99 - 16 87466.40 1185.79 - 32 83267.93 679.62 + 1 192548.67 909.47 + 2 228309.97 8005.31 + 4 157134.13 2124.88 + 8 138713.43 2024.73 + 16 125931.90 4604.27 + 32 117078.33 6739.70 diff --git a/docs/perf_tests/basic_small.dat b/docs/perf_tests/basic_small.dat index cc60ec9e9..dfc06a690 100644 --- a/docs/perf_tests/basic_small.dat +++ b/docs/perf_tests/basic_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 4858.43 4.12 - 2 9703.20 6.65 - 4 19375.80 15.53 - 8 38578.50 35.43 - 16 71851.62 2097.06 - 32 43205.17 944.35 + 1 4765.23 43.28 + 2 9643.33 33.80 + 4 19230.50 116.03 + 8 38369.27 139.56 + 16 67814.23 2100.95 + 32 46497.08 3820.91 diff --git a/docs/perf_tests/basic_small_saturation.dat b/docs/perf_tests/basic_small_saturation.dat index f90036d56..850c4f02e 100644 --- a/docs/perf_tests/basic_small_saturation.dat +++ b/docs/perf_tests/basic_small_saturation.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms - 1 3888.83 10.25 - 2 7786.33 4.86 - 3 11679.20 11.70 - 4 15569.80 5.46 - 5 19419.43 6.57 - 6 23277.30 34.13 - 7 27173.50 25.67 - 8 30967.57 41.99 - 9 33661.67 116.82 - 10 31492.67 217.84 - 11 30610.73 228.05 - 12 31255.63 571.08 - 13 31506.47 419.38 - 14 31313.00 1150.40 - 15 30833.60 1009.03 - 16 30601.77 666.70 + 1 3878.47 11.41 + 2 7766.60 5.48 + 3 11638.87 15.66 + 4 15549.30 13.82 + 5 19365.33 25.11 + 6 23227.90 32.14 + 7 27069.33 52.31 + 8 30702.44 142.87 + 9 33474.97 108.34 + 10 33224.83 64.16 + 11 32529.70 327.39 + 12 32592.27 262.56 + 13 31563.40 847.31 + 14 31986.87 367.67 + 15 31814.23 348.19 + 16 31706.07 360.37 diff --git a/docs/perf_tests/samples.dat b/docs/perf_tests/samples.dat new file mode 100644 index 000000000..d79ea9c87 --- /dev/null +++ b/docs/perf_tests/samples.dat @@ -0,0 +1,241 @@ +# nthreads rate + 1 0.28 + 1 1.00 + 1 0.00 + 1 1.00 + 1 0.00 + 1 0.00 + 1 1.00 + 1 0.00 + 1 0.00 + 1 1.00 + 1 0.00 + 1 0.00 + 1 1.00 + 1 0.00 + 1 0.00 + 2 1.50 + 2 2.00 + 2 4.00 + 2 3.00 + 2 1.00 + 2 5.00 + 2 5.00 + 2 2.00 + 2 3.00 + 2 5.00 + 2 2.00 + 2 4.00 + 2 5.00 + 2 3.00 + 2 3.00 + 3 7.00 + 3 3.00 + 3 6.00 + 3 7.00 + 3 3.00 + 3 7.00 + 3 5.00 + 3 5.00 + 3 4.00 + 3 7.00 + 3 5.00 + 3 7.00 + 3 2.00 + 3 6.00 + 3 7.00 + 4 8.00 + 4 7.00 + 4 6.00 + 4 7.00 + 4 10.00 + 4 3.00 + 4 7.00 + 4 10.00 + 4 7.00 + 4 5.00 + 4 8.00 + 4 8.00 + 4 7.00 + 4 5.00 + 4 8.00 + 5 10.00 + 5 8.00 + 5 8.00 + 5 11.00 + 5 8.00 + 5 8.00 + 5 10.00 + 5 8.00 + 5 9.00 + 5 10.00 + 5 8.00 + 5 9.00 + 5 8.00 + 5 10.00 + 5 9.00 + 6 10.50 + 6 13.00 + 6 11.00 + 6 9.00 + 6 9.00 + 6 14.00 + 6 10.00 + 6 9.00 + 6 12.00 + 6 10.00 + 6 10.00 + 6 11.00 + 6 11.00 + 6 9.00 + 6 11.00 + 7 13.50 + 7 12.00 + 7 12.00 + 7 12.00 + 7 14.00 + 7 11.00 + 7 13.00 + 7 12.00 + 7 10.00 + 7 15.00 + 7 11.00 + 7 14.00 + 7 13.00 + 7 11.00 + 7 13.00 + 8 16.00 + 8 10.00 + 8 14.00 + 8 15.00 + 8 13.00 + 8 10.00 + 8 19.00 + 8 13.00 + 8 13.00 + 8 12.00 + 8 16.00 + 8 12.00 + 8 11.00 + 8 11.00 + 8 16.00 + 9 16.50 + 9 14.00 + 9 16.00 + 9 15.00 + 9 15.00 + 9 18.00 + 9 14.00 + 9 16.00 + 9 17.00 + 9 14.00 + 9 17.00 + 9 16.00 + 9 16.00 + 9 17.00 + 9 15.00 + 10 18.50 + 10 16.00 + 10 17.00 + 10 18.00 + 10 15.00 + 10 19.00 + 10 18.00 + 10 17.00 + 10 16.00 + 10 19.00 + 10 16.00 + 10 19.00 + 10 18.00 + 10 16.00 + 10 18.00 + 11 19.50 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 20.00 + 11 18.00 + 11 19.00 + 11 20.00 + 11 20.00 + 11 19.00 + 12 19.00 + 12 19.00 + 12 20.00 + 12 19.98 + 12 20.00 + 12 19.00 + 12 20.00 + 12 20.00 + 12 19.00 + 12 20.00 + 12 20.00 + 12 20.00 + 12 20.00 + 12 20.00 + 12 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 20.00 + 13 19.00 + 13 19.00 + 13 19.00 + 13 19.00 + 13 20.00 + 13 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 14 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 20.00 + 15 18.98 + 15 20.00 + 15 20.00 + 15 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 + 16 20.00 diff --git a/docs/perf_tests/source_large.dat b/docs/perf_tests/source_large.dat index 5bb84f2b4..5ac7fcf23 100644 --- a/docs/perf_tests/source_large.dat +++ b/docs/perf_tests/source_large.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms 1 5.00 0.00 - 2 5.07 0.25 - 4 4.93 0.25 - 8 5.07 0.25 + 2 5.00 0.00 + 4 5.00 0.00 + 8 5.00 0.00 16 5.00 0.00 32 5.00 0.00 diff --git a/docs/perf_tests/source_medium.dat b/docs/perf_tests/source_medium.dat index 416fcfe0f..74fa5dc1e 100644 --- a/docs/perf_tests/source_medium.dat +++ b/docs/perf_tests/source_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 99.92 0.25 - 2 99.93 0.25 - 4 99.93 0.25 - 8 99.93 0.25 - 16 99.93 0.25 + 1 99.65 0.46 + 2 99.80 0.40 + 4 99.73 0.44 + 8 99.87 0.34 + 16 99.73 0.44 32 99.93 0.25 diff --git a/docs/perf_tests/source_mini.dat b/docs/perf_tests/source_mini.dat index b17a8b4a1..a43c7affc 100644 --- a/docs/perf_tests/source_mini.dat +++ b/docs/perf_tests/source_mini.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 553822.67 4162.75 - 2 443977.00 3920.34 - 4 260414.27 2358.93 - 8 262189.37 3135.67 - 16 275358.57 11117.66 - 32 291814.23 5436.96 + 1 571538.63 1652.21 + 2 573767.63 4950.00 + 4 570312.60 6909.59 + 8 575544.80 710.41 + 16 574226.97 4402.65 + 32 576220.87 1423.82 diff --git a/docs/perf_tests/source_small.dat b/docs/perf_tests/source_small.dat index 0a2baa6b6..62dddf86d 100644 --- a/docs/perf_tests/source_small.dat +++ b/docs/perf_tests/source_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 19215.60 14.45 - 2 18904.53 30.81 - 4 18906.60 14.63 - 8 18856.73 38.95 - 16 18837.30 27.80 - 32 18836.17 42.77 + 1 19223.73 18.36 + 2 19160.77 63.97 + 4 19101.03 103.28 + 8 19138.20 26.04 + 16 19047.70 74.41 + 32 19060.43 91.53 diff --git a/docs/perf_tests/tapchain_16_large.dat b/docs/perf_tests/tapchain_16_large.dat index adc73154a..6356d4dca 100644 --- a/docs/perf_tests/tapchain_16_large.dat +++ b/docs/perf_tests/tapchain_16_large.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms 1 5.00 0.00 2 10.00 0.00 - 4 20.13 0.34 - 8 39.80 2.29 - 16 79.94 2.62 - 32 159.82 0.36 + 4 20.07 0.57 + 8 40.13 0.81 + 16 79.83 5.17 + 32 158.82 1.51 diff --git a/docs/perf_tests/tapchain_16_medium.dat b/docs/perf_tests/tapchain_16_medium.dat index 9b3404ff3..6ad9b7ea3 100644 --- a/docs/perf_tests/tapchain_16_medium.dat +++ b/docs/perf_tests/tapchain_16_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 99.67 0.60 - 2 199.17 0.96 - 4 398.47 1.15 - 8 796.60 1.74 - 16 1581.94 9.75 - 32 1575.83 22.02 + 1 99.53 0.50 + 2 198.93 1.00 + 4 398.00 1.51 + 8 794.45 4.21 + 16 1573.40 11.86 + 32 1839.75 28.12 diff --git a/docs/perf_tests/tapchain_16_mini.dat b/docs/perf_tests/tapchain_16_mini.dat index 572f8ab39..9f090ca74 100644 --- a/docs/perf_tests/tapchain_16_mini.dat +++ b/docs/perf_tests/tapchain_16_mini.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 30710.97 341.10 - 2 47995.77 568.76 - 4 43288.43 199.97 - 8 39253.33 488.96 - 16 17947.70 246.77 - 32 10354.67 89.94 + 1 30381.97 546.07 + 2 42471.33 1310.46 + 4 42298.23 1021.10 + 8 37348.20 1409.38 + 16 27397.50 1021.15 + 32 27339.00 1120.14 diff --git a/docs/perf_tests/tapchain_16_small.dat b/docs/perf_tests/tapchain_16_small.dat index 41868b5f2..bfa785447 100644 --- a/docs/perf_tests/tapchain_16_small.dat +++ b/docs/perf_tests/tapchain_16_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 4299.23 4.51 - 2 8532.77 15.58 - 4 16914.37 13.05 - 8 29549.13 2884.24 - 16 19457.10 317.42 - 32 9017.37 317.93 + 1 4291.43 10.49 + 2 8534.51 22.30 + 4 16919.70 44.73 + 8 32322.07 369.66 + 16 25432.77 414.78 + 32 22783.20 298.34 diff --git a/docs/perf_tests/tapchain_1_large.dat b/docs/perf_tests/tapchain_1_large.dat index 6f9ee751c..0c25718a3 100644 --- a/docs/perf_tests/tapchain_1_large.dat +++ b/docs/perf_tests/tapchain_1_large.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 5.06 0.23 - 2 10.00 0.37 - 4 21.87 4.11 - 8 39.70 1.39 - 16 79.99 3.18 - 32 159.15 2.21 + 1 5.05 0.20 + 2 10.07 0.25 + 4 20.37 0.90 + 8 40.77 5.26 + 16 79.79 2.41 + 32 159.13 2.08 diff --git a/docs/perf_tests/tapchain_1_medium.dat b/docs/perf_tests/tapchain_1_medium.dat index 72f376cb4..d8ce94d9b 100644 --- a/docs/perf_tests/tapchain_1_medium.dat +++ b/docs/perf_tests/tapchain_1_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 99.87 0.34 - 2 200.20 1.33 - 4 399.60 0.80 - 8 800.53 4.29 - 16 1558.88 20.35 - 32 2047.32 67.26 + 1 99.97 0.29 + 2 199.80 0.40 + 4 401.20 4.97 + 8 798.87 2.00 + 16 1581.54 11.64 + 32 2141.22 67.64 diff --git a/docs/perf_tests/tapchain_1_mini.dat b/docs/perf_tests/tapchain_1_mini.dat index b58ecb690..8b3ff8ba1 100644 --- a/docs/perf_tests/tapchain_1_mini.dat +++ b/docs/perf_tests/tapchain_1_mini.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 188570.13 2518.54 - 2 248379.20 8791.90 - 4 140491.40 1144.09 - 8 106527.73 1302.45 - 16 87772.90 839.54 - 32 82710.43 1024.06 + 1 186451.30 3754.39 + 2 222209.90 14427.90 + 4 140394.80 9895.93 + 8 135044.63 3637.39 + 16 124828.17 5194.98 + 32 128929.50 2842.95 diff --git a/docs/perf_tests/tapchain_1_small.dat b/docs/perf_tests/tapchain_1_small.dat index 09a7db41c..ce5ee23b4 100644 --- a/docs/perf_tests/tapchain_1_small.dat +++ b/docs/perf_tests/tapchain_1_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 4860.50 2.53 - 2 9697.40 7.67 - 4 19359.60 20.08 - 8 38571.07 25.57 - 16 72145.49 1563.42 - 32 43778.06 344.54 + 1 4843.00 13.04 + 2 9676.78 24.87 + 4 19299.10 40.60 + 8 38288.80 157.82 + 16 65746.85 3535.38 + 32 46664.77 1872.14 diff --git a/docs/perf_tests/tapchain_4_large.dat b/docs/perf_tests/tapchain_4_large.dat index 5ed562305..30e9e826c 100644 --- a/docs/perf_tests/tapchain_4_large.dat +++ b/docs/perf_tests/tapchain_4_large.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms 1 5.03 0.11 2 10.00 0.00 - 4 20.07 0.25 - 8 40.87 2.03 - 16 80.23 2.98 - 32 158.98 1.70 + 4 20.13 0.34 + 8 40.63 3.46 + 16 80.09 3.36 + 32 158.29 1.84 diff --git a/docs/perf_tests/tapchain_4_medium.dat b/docs/perf_tests/tapchain_4_medium.dat index bfcf61ed5..d1f7ed7f8 100644 --- a/docs/perf_tests/tapchain_4_medium.dat +++ b/docs/perf_tests/tapchain_4_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 99.77 0.40 - 2 199.50 0.88 - 4 399.47 0.88 - 8 798.57 1.28 - 16 1586.63 10.06 - 32 1878.10 30.02 + 1 99.75 0.41 + 2 199.87 0.62 + 4 399.80 2.01 + 8 798.23 1.62 + 16 1589.36 6.14 + 32 1957.87 31.81 diff --git a/docs/perf_tests/tapchain_4_mini.dat b/docs/perf_tests/tapchain_4_mini.dat index dc20a3b84..2587e7e74 100644 --- a/docs/perf_tests/tapchain_4_mini.dat +++ b/docs/perf_tests/tapchain_4_mini.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 93235.03 473.91 - 2 106363.43 530.25 - 4 115753.13 655.35 - 8 72784.50 1207.79 - 16 48907.10 493.74 - 32 42051.63 896.34 + 1 90187.40 1958.89 + 2 101823.93 2097.91 + 4 109760.03 3449.42 + 8 90616.70 4449.21 + 16 83729.63 2426.49 + 32 82653.90 3065.21 diff --git a/docs/perf_tests/tapchain_4_small.dat b/docs/perf_tests/tapchain_4_small.dat index 9f99014d0..8d3bf2f83 100644 --- a/docs/perf_tests/tapchain_4_small.dat +++ b/docs/perf_tests/tapchain_4_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 4730.80 7.26 - 2 9418.97 11.14 - 4 18782.47 32.13 - 8 37206.27 104.26 - 16 60806.00 1318.17 - 32 29372.92 202.33 + 1 4663.85 36.99 + 2 9313.53 75.28 + 4 18764.37 45.94 + 8 37350.40 105.98 + 16 60937.73 4344.56 + 32 44171.79 454.10 diff --git a/docs/perf_tests/tapchain_pipelining.dat b/docs/perf_tests/tapchain_pipelining.dat index 4f42cc361..264627179 100644 --- a/docs/perf_tests/tapchain_pipelining.dat +++ b/docs/perf_tests/tapchain_pipelining.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms - 1 16.66 0.47 - 2 33.30 0.44 - 3 49.97 0.12 - 4 66.63 0.46 - 5 83.30 0.44 - 6 100.00 0.00 - 7 99.93 0.25 - 8 99.93 0.25 - 9 100.00 0.00 - 10 99.90 0.27 + 1 16.67 0.47 + 2 33.37 0.46 + 3 49.90 0.27 + 4 66.57 0.48 + 5 83.33 0.47 + 6 99.67 0.70 + 7 99.87 0.34 + 8 99.80 0.40 + 9 99.93 0.25 + 10 99.87 0.34 11 99.93 0.25 - 12 100.00 0.00 - 13 99.93 0.25 + 12 99.43 1.49 + 13 99.87 0.34 14 99.93 0.25 - 15 99.87 0.34 - 16 100.00 0.00 + 15 99.93 0.25 + 16 99.87 0.34 diff --git a/docs/perf_tests/unfold_large.dat b/docs/perf_tests/unfold_large.dat new file mode 100644 index 000000000..ea17820c1 --- /dev/null +++ b/docs/perf_tests/unfold_large.dat @@ -0,0 +1,7 @@ +# nthreads avg_rate rms + 1 2.54 1.99 + 2 4.97 1.37 + 4 10.13 0.81 + 8 20.27 2.35 + 16 40.36 2.26 + 32 80.02 3.30 diff --git a/docs/perf_tests/unfold_large_saturation.dat b/docs/perf_tests/unfold_large_saturation.dat index 46fe9a8c5..66d1f8ec9 100644 --- a/docs/perf_tests/unfold_large_saturation.dat +++ b/docs/perf_tests/unfold_large_saturation.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms - 1 0.37 0.46 - 2 2.27 1.61 - 3 5.40 1.54 - 4 7.30 1.50 - 5 9.07 1.06 - 6 10.90 1.07 - 7 12.60 1.31 - 8 14.43 1.25 - 9 16.37 1.49 - 10 17.87 1.09 - 11 19.77 0.40 - 12 20.00 0.00 - 13 19.93 0.25 + 1 0.35 0.46 + 2 3.23 1.33 + 3 5.40 1.67 + 4 7.07 1.77 + 5 8.93 1.00 + 6 10.63 1.44 + 7 12.43 1.33 + 8 13.40 2.50 + 9 15.77 1.20 + 10 17.37 1.27 + 11 19.70 0.57 + 12 19.73 0.44 + 13 19.73 0.44 14 20.00 0.00 - 15 20.00 0.00 - 16 20.00 0.01 + 15 19.93 0.25 + 16 20.00 0.00 diff --git a/docs/perf_tests/unfold_medium.dat b/docs/perf_tests/unfold_medium.dat index f58590914..0d93ed13a 100644 --- a/docs/perf_tests/unfold_medium.dat +++ b/docs/perf_tests/unfold_medium.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 49.88 0.45 - 2 100.03 0.12 - 4 200.00 0.97 - 8 399.93 1.53 - 16 796.81 4.08 - 32 1406.16 17.78 + 1 50.03 0.46 + 2 99.93 0.25 + 4 200.00 0.63 + 8 399.97 1.55 + 16 797.68 2.69 + 32 1388.09 20.02 diff --git a/docs/perf_tests/unfold_medium_saturation.dat b/docs/perf_tests/unfold_medium_saturation.dat index 63d8ceefb..9de051443 100644 --- a/docs/perf_tests/unfold_medium_saturation.dat +++ b/docs/perf_tests/unfold_medium_saturation.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms - 1 34.86 5.98 - 2 72.50 1.20 - 3 108.33 1.35 - 4 144.33 1.35 - 5 180.17 1.50 - 6 216.23 1.17 - 7 251.27 1.81 - 8 285.70 3.56 - 9 320.73 3.02 - 10 351.20 1.80 - 11 383.87 4.04 - 12 387.92 4.03 - 13 396.37 1.72 - 14 396.67 1.14 - 15 395.54 2.95 - 16 396.50 0.91 + 1 35.66 2.89 + 2 72.30 1.29 + 3 106.47 1.54 + 4 141.67 1.25 + 5 176.93 1.91 + 6 212.30 1.29 + 7 245.67 2.15 + 8 280.43 4.61 + 9 314.37 4.13 + 10 348.40 3.03 + 11 384.67 2.49 + 12 395.90 2.22 + 13 396.83 1.75 + 14 397.47 0.88 + 15 395.50 4.05 + 16 391.37 5.31 diff --git a/docs/perf_tests/unfold_mini.dat b/docs/perf_tests/unfold_mini.dat index 62613e6be..efb2bc836 100644 --- a/docs/perf_tests/unfold_mini.dat +++ b/docs/perf_tests/unfold_mini.dat @@ -1 +1,7 @@ # nthreads avg_rate rms + 1 146191.03 1159.40 + 2 123631.97 1250.02 + 4 122254.20 3335.23 + 8 106006.57 2424.04 + 16 99135.43 2055.58 + 32 99163.60 987.07 diff --git a/docs/perf_tests/unfold_small.dat b/docs/perf_tests/unfold_small.dat index d45c5e60a..34499c3f2 100644 --- a/docs/perf_tests/unfold_small.dat +++ b/docs/perf_tests/unfold_small.dat @@ -1,7 +1,7 @@ # nthreads avg_rate rms - 1 2448.52 2.87 - 2 4896.73 5.89 - 4 9778.10 7.40 - 8 19442.83 33.62 - 16 35760.35 1565.34 - 32 26004.94 209.94 + 1 2450.25 4.38 + 2 4897.90 5.82 + 4 9768.87 9.73 + 8 19431.07 20.00 + 16 35987.13 876.49 + 32 28486.33 568.00 diff --git a/docs/perf_tests/unfold_small_saturation.dat b/docs/perf_tests/unfold_small_saturation.dat index f59828d90..06fb2d39d 100644 --- a/docs/perf_tests/unfold_small_saturation.dat +++ b/docs/perf_tests/unfold_small_saturation.dat @@ -1,17 +1,17 @@ # nthreads avg_rate rms - 1 1764.42 22.17 - 2 3538.43 3.98 - 3 5298.67 18.36 - 4 7030.50 25.42 - 5 8778.37 16.27 - 6 10510.17 35.15 - 7 12228.70 24.27 - 8 13812.60 18.31 - 9 15293.10 131.17 - 10 16301.37 83.67 - 11 16669.40 205.62 - 12 16760.97 145.09 - 13 16401.73 181.22 - 14 16348.50 287.65 - 15 16725.03 132.58 - 16 16747.83 128.27 + 1 1789.15 1.84 + 2 3549.03 2.71 + 3 5256.70 5.21 + 4 6953.33 12.23 + 5 8649.73 10.02 + 6 10343.23 20.45 + 7 11944.30 30.49 + 8 13586.83 36.57 + 9 15152.83 58.26 + 10 16452.90 58.52 + 11 17298.20 148.43 + 12 17247.50 95.88 + 13 17210.83 61.02 + 14 17172.87 245.58 + 15 17141.60 114.92 + 16 17160.97 122.61