Skip to content

Commit da6f69c

Browse files
committed
benchmark code cleanup
1 parent 9bf1525 commit da6f69c

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

SEBenchmarks/src/program/BenchVariablePsfStack.cpp

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class BenchVariablePsfStack : public Elements::Program {
4848
po::options_description options{};
4949
options.add_options()
5050
("iterations", po::value<int>()->default_value(100000), "Number of getPsf calls to benchmark")
51-
("measures", po::value<int>()->default_value(10), "Number of timing measurements to take")
52-
("fits-file", po::value<std::string>()->default_value(""), "FITS file containing PSF stack (optional, will use nullptr if not provided)");
51+
("measures", po::value<int>()->default_value(3), "Number of timing measurements to take")
52+
("fits-file", po::value<std::string>()->default_value(""), "FITS file containing PSF stack");
5353
return options;
5454
}
5555

@@ -70,10 +70,11 @@ class BenchVariablePsfStack : public Elements::Program {
7070
logger.info() << "Using FITS file: " << fits_file;
7171
} catch (const std::exception& e) {
7272
logger.error() << "Failed to load FITS file '" << fits_file << "': " << e.what();
73-
logger.info() << "Continuing with nullptr - this will likely cause exceptions during getPsf() calls";
73+
return Elements::ExitCode::DATAERR;
7474
}
7575
} else {
76-
logger.info() << "No FITS file provided - using nullptr (will likely cause exceptions)";
76+
logger.error() << "No FITS file provided";
77+
return Elements::ExitCode::USAGE;
7778
}
7879

7980
try {
@@ -125,28 +126,7 @@ class BenchVariablePsfStack : public Elements::Program {
125126

126127
} catch (const std::exception& e) {
127128
logger.error() << "Error initializing VariablePsfStack: " << e.what();
128-
logger.info() << "This is expected with nullptr parameter - fix the FITS file parameter later";
129-
130-
// Still run a basic timing test to measure overhead
131-
std::cout << "Running basic timing test without actual PSF operations..." << std::endl;
132-
std::cout << "Iterations,Measurement,Time_nanoseconds" << std::endl;
133-
134-
for (int m = 0; m < measures; ++m) {
135-
timer::cpu_timer timer;
136-
timer.stop();
137-
138-
timer.start();
139-
for (int i = 0; i < iterations; ++i) {
140-
// Just measure the overhead of generating random values and vector creation
141-
std::vector<double> values = {random_dist(random_generator), random_dist(random_generator)};
142-
volatile auto size = values.size();
143-
(void)size;
144-
}
145-
timer.stop();
146-
147-
auto elapsed_ns = timer.elapsed().wall;
148-
std::cout << iterations << "," << (m + 1) << "," << elapsed_ns << std::endl;
149-
}
129+
return Elements::ExitCode::DATAERR;
150130
}
151131

152132
return Elements::ExitCode::OK;

0 commit comments

Comments
 (0)