Skip to content

Commit 3633a39

Browse files
committed
Fix csv output inconsistency
Always add the columns that have invalid data to make sure columns always align
1 parent eb88c38 commit 3633a39

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/pcm-memory.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,9 @@ void display_bandwidth_csv(PCM *m, memdata_t *md, uint64 /*elapsedTime*/, const
505505
{
506506
for (uint64 channel = 0; channel < max_imc_channels; ++channel)
507507
{
508+
bool invalid_data = false;
508509
if (md->iMC_Rd_socket_chan[skt][channel] < 0.0 && md->iMC_Wr_socket_chan[skt][channel] < 0.0) //If the channel read neg. value, the channel is not working; skip it.
509-
continue;
510+
invalid_data = true;
510511

511512
choose(outputType,
512513
[printSKT]() {
@@ -516,9 +517,12 @@ void display_bandwidth_csv(PCM *m, memdata_t *md, uint64 /*elapsedTime*/, const
516517
cout << "Ch" << channel << "Read,"
517518
<< "Ch" << channel << "Write,";
518519
},
519-
[&md, &skt, &channel]() {
520-
cout << setw(8) << md->iMC_Rd_socket_chan[skt][channel] << ','
521-
<< setw(8) << md->iMC_Wr_socket_chan[skt][channel] << ',';
520+
[&md, &skt, &channel, &invalid_data]() {
521+
if (invalid_data)
522+
cout << ",,";
523+
else
524+
cout << setw(8) << md->iMC_Rd_socket_chan[skt][channel] << ','
525+
<< setw(8) << md->iMC_Wr_socket_chan[skt][channel] << ',';
522526
});
523527

524528
if (md->metrics == Pmem)

0 commit comments

Comments
 (0)