Skip to content

Commit 1427cd6

Browse files
committed
[bench-dma] Always calculate throughput based on effective size
1 parent 7680b0b commit 1427cd6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/CommandLineUtilities/ProgramDmaBench.cxx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ class ProgramDmaBench : public Program
125125
options.add_options()("bytes",
126126
SuffixOption<uint64_t>::make(&mOptions.maxBytes)->default_value("0"),
127127
"Limit of bytes to transfer. Give 0 for infinite.");
128-
options.add_options()("byte-count",
129-
po::bool_switch(&mOptions.byteCountEnabled),
130-
"Flag to enable byte-count; use the actual dma page for throughput (not always 8K)");
131128
options.add_options()("buffer-full-check",
132129
po::bool_switch(&mOptions.bufferFullCheck),
133130
"Test how quickly the readout buffer gets full, if it's not emptied");
@@ -524,9 +521,7 @@ class ProgramDmaBench : public Program
524521

525522
atStartOfSuperpage = false; //Update the boolean value as soon as we move...
526523

527-
if (mOptions.byteCountEnabled && !(mOptions.dataSourceString == "INTERNAL")) {
528-
mByteCount.fetch_add(pageSize, std::memory_order_relaxed);
529-
}
524+
mByteCount.fetch_add(pageSize, std::memory_order_relaxed);
530525
readoutBytes += pageSize;
531526
}
532527

@@ -918,7 +913,7 @@ class ProgramDmaBench : public Program
918913
format % mSuperpagesReadOut.load(std::memory_order_relaxed);
919914

920915
double runTime = std::chrono::duration<double>(steady_clock::now() - mRunTime.start).count();
921-
double bytes = mOptions.byteCountEnabled ? double(mByteCount.load(std::memory_order_relaxed)) : double(mSuperpagesReadOut.load(std::memory_order_relaxed)) * mSuperpageSize;
916+
double bytes = double(mByteCount.load(std::memory_order_relaxed));
922917
double Gb = bytes * 8 / (1000 * 1000 * 1000);
923918
double Gbps = Gb / runTime;
924919
format % Gbps;
@@ -965,7 +960,7 @@ class ProgramDmaBench : public Program
965960
{
966961
// Calculating throughput
967962
double runTime = std::chrono::duration<double>(mRunTime.end - mRunTime.start).count();
968-
double bytes = mOptions.byteCountEnabled ? double(mByteCount.load()) : double(mSuperpagesReadOut.load() * mSuperpageSize);
963+
double bytes = double(mByteCount.load());
969964
double GB = bytes / (1000 * 1000 * 1000);
970965
double GBs = GB / runTime;
971966
double GiB = bytes / (1024 * 1024 * 1024);
@@ -1155,7 +1150,6 @@ class ProgramDmaBench : public Program
11551150
uint64_t pauseRead;
11561151
size_t maxRdhPacketCounter;
11571152
bool stbrd = false;
1158-
bool byteCountEnabled = false;
11591153
bool bypassFirmwareCheck = false;
11601154
uint32_t timeFrameLength = 256;
11611155
bool printSuperpageChange = false;

0 commit comments

Comments
 (0)