Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:41

0001 
0002 // Copyright 2022, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 
0006 // PerfTests is designed to make it easy to see how changes to JANA's internals affect its performance on
0007 // a variety of workloads we care about.
0008 
0009 #include <JANA/JApplication.h>
0010 #include <JANA/JFactoryGenerator.h>
0011 #include <JANA/CLI/JBenchmarker.h>
0012 #if HAVE_PODIO
0013 #include <PodioStressTest.h>
0014 #endif
0015 
0016 
0017 
0018 int main() {
0019     
0020     {
0021 
0022         // 5Hz for full reconstruction
0023         // 20kHz for stripped-down reconstruction (not per-core)
0024         // Base memory allcation: 100 MB/core + 600MB
0025         // 1 thread/event, disentangle 1 event, turn into 40.
0026         // disentangled (single event size) : 12.5 kB / event (before blown up)
0027         // entangled "block of 40": dis * 40
0028         
0029         auto params = new JParameterManager;
0030         params->SetParameter("jana:loglevel", "off");
0031 
0032         // Log levels get set as soon as JApp gets constructed
0033         params->SetParameter("jtest:write_csv", false);
0034         params->SetParameter("jtest:parser_ms", 2);
0035         params->SetParameter("jtest:plotter_ms", 2);
0036 
0037         params->SetParameter("benchmark:resultsdir", "perftest_fake_halldrecon");
0038 
0039         JApplication app(params);
0040         auto logger = params->GetLogger("PerfTests");
0041         app.AddPlugin("JTest");
0042 
0043         LOG_INFO(logger) << "Running JTest tuned to imitate halld_recon" << LOG_END;
0044         JBenchmarker benchmarker(&app);
0045         benchmarker.RunUntilFinished();
0046     }
0047 
0048 
0049     {
0050 
0051         auto params = new JParameterManager;
0052         params->SetParameter("jana:loglevel", "off");
0053 
0054         // Log levels get set as soon as JApp gets constructed
0055         params->SetParameter("jtest:write_csv", false);
0056 
0057         params->SetParameter("jtest:parser_ms", 0);
0058         params->SetParameter("jtest:parser_spread", 0);
0059         params->SetParameter("jtest:parser_bytes", 0);
0060         params->SetParameter("jtest:parser_bytes_spread", 0);
0061 
0062         params->SetParameter("jtest:disentangler_ms", 0);
0063         params->SetParameter("jtest:disentangler_spread", 0);
0064         params->SetParameter("jtest:disentangler_bytes", 0);
0065         params->SetParameter("jtest:disentangler_bytes_spread", 0);
0066 
0067         params->SetParameter("jtest:tracker_ms", 0);
0068         params->SetParameter("jtest:tracker_spread", 0);
0069         params->SetParameter("jtest:tracker_bytes", 0);
0070         params->SetParameter("jtest:tracker_bytes_spread", 0);
0071 
0072         params->SetParameter("jtest:plotter_ms", 0);
0073         params->SetParameter("jtest:plotter_spread", 0);
0074         params->SetParameter("jtest:plotter_bytes", 0);
0075         params->SetParameter("jtest:plotter_bytes_spread", 0);
0076 
0077         params->SetParameter("benchmark:resultsdir", "perftest_pure_overhead");
0078 
0079         JApplication app(params);
0080         auto logger = params->GetLogger("PerfTests");
0081         app.AddPlugin("JTest");
0082 
0083         LOG_INFO(logger) << "Running JTest with all sleeps and computations turned off" << LOG_END;
0084         JBenchmarker benchmarker(&app);
0085         benchmarker.RunUntilFinished();
0086     }
0087 
0088 #if HAVE_PODIO
0089     {
0090         // Test that we can link against PODIO datamodel
0091         // TODO: Delete me 
0092         ExampleHitCollection c;
0093 
0094         auto params = new JParameterManager;
0095         params->SetParameter("jana:loglevel", "off");
0096         JApplication app(params);
0097         auto logger = params->GetLogger("PerfTests");
0098         // TODO: Add Podio sources, processors, and factories just like JTest
0099         LOG_INFO(logger) << "Running PODIO stress test" << LOG_END;
0100         JBenchmarker benchmarker(&app);
0101         benchmarker.RunUntilFinished();
0102     }
0103 #endif
0104 
0105     // Next: Run with subevents
0106     // Next: Run with more and more arrows to see how that scales
0107     // Next: Barrier events
0108 
0109 }