Skip to content

Commit

Permalink
only print out necessary stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwu928 committed May 8, 2024
1 parent 87ef544 commit 92a37f3
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pando-drv/element/DrvCore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class DrvCore : public SST::Component {

void outputPhaseStatistics() {
output_->verbose(CALL_INFO, 1, DEBUG_CLK, "writing phase statistics\n");
performStatFileOutput("Dump " + std::to_string(stat_dump_cnt_));
performStatFileOutput("Dump," + std::to_string(stat_dump_cnt_));
stat_dump_cnt_++;
performGlobalStatisticOutput();
}
Expand Down
28 changes: 28 additions & 0 deletions pando-drv/tests/PANDOHammerDrvX.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@
DrvXTile.enableAllCoreStats()
if (arguments.all_stats):
sst.enableAllStatisticsForAllComponents()
if (arguments.perf_stats):
sst.enableStatisticsForComponentType(
"Drv.DrvCore",
["total_stall_cycles_when_ready",
"total_stall_cycles",
"total_busy_cycles",
"phase_comp_stall_cycles_when_ready",
"phase_comm_stall_cycles_when_ready",
"phase_stall_cycles",
"phase_busy_cycles"])
sst.enableStatisticsForComponentType(
"memHierarchy.MemNIC",
["send_bit_count",
"recv_bit_count",
"output_port_stalls",
"idle_time"])
sst.enableStatisticsForComponentType(
"merlin.hr_router",
["send_bit_count",
"recv_bit_count",
"output_port_stalls",
"idle_time"])
sst.enableStatisticsForComponentType(
"merlin.Bridge",
["send_bit_count",
"recv_bit_count",
"output_port_stalls",
"idle_time"])

sst.setStatisticLoadLevel(arguments.stats_load_level)
sst.setStatisticOutput("sst.statOutputCSV", {"filepath" : "stats.csv", "separator" : ","})
1 change: 1 addition & 0 deletions pando-drv/tests/drv.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def set_bits(word, hi, lo, value):
parser.add_argument("--test-name", type=str, default="", help="Name of the test")
parser.add_argument("--core-stats", action="store_true", help="enable core statistics")
parser.add_argument("--all-stats", action="store_true", help="enable all statistics")
parser.add_argument("--perf-stats", action="store_true", help="enable performance statistics")
parser.add_argument("--stats-load-level", type=int, default=0, help="load level for statistics")
parser.add_argument("--stats-preallocated-phase", type=int, default=16, help="preallocated number of phases for statistics")
parser.add_argument("--trace-remote-pxn-memory", action="store_true", help="trace remote pxn memory accesses")
Expand Down
4 changes: 2 additions & 2 deletions scripts/run-drv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ${DBG} sst -n ${HOST_THREADS} \
--core-threads=${HARTS} \
--drvx-stack-in-l1sp \
--pxn-dram-size=${MAIN_MEMORY_SIZE} \
--all-stats \
--perf-stats \
--stats-load-level=5 \
--stats-preallocated-phase=2 \
--stats-preallocated-phase=64 \
${PROG} $@
2 changes: 1 addition & 1 deletion sst-core-src/src/sst/core/statapi/statengine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ StatisticProcessingEngine::endOfSimulation()
// will cause all of this code to be executed anyway
// so really we are double dumping the end-of-time stats

output_to_stat_file("Simulation End");
output_to_stat_file("Dump,Last");

// Output the Event based Statistics
for ( StatisticBase* stat : m_EventStatisticArray ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,40 @@ MemBackendConvertor::MemBackendConvertor(ComponentId_t id, Params& params, MemBa
stat_cyclesAttemptIssueButRejected = registerStatistic<uint64_t>( "cycles_attempted_issue_but_rejected" );
stat_totalCycles = registerStatistic<uint64_t>( "total_cycles" );

stat_GetSReqReceived->setFlagResetCountOnOutput(true);
stat_GetSXReqReceived->setFlagResetCountOnOutput(true);
stat_GetXReqReceived->setFlagResetCountOnOutput(true);
stat_WriteReqReceived->setFlagResetCountOnOutput(true);
stat_PutMReqReceived->setFlagResetCountOnOutput(true);
stat_outstandingReqs->setFlagResetCountOnOutput(true);
stat_ReqSent->setFlagResetCountOnOutput(true);
stat_ACMReqSent->setFlagResetCountOnOutput(true);
stat_GetSLatency->setFlagResetCountOnOutput(true);
stat_GetSXLatency->setFlagResetCountOnOutput(true);
stat_GetXLatency->setFlagResetCountOnOutput(true);
stat_WriteLatency->setFlagResetCountOnOutput(true);
stat_PutMLatency->setFlagResetCountOnOutput(true);
stat_cyclesWithIssue->setFlagResetCountOnOutput(true);
stat_cyclesAttemptIssueButRejected->setFlagResetCountOnOutput(true);
stat_totalCycles->setFlagResetCountOnOutput(true);

stat_GetSReqReceived->setFlagClearDataOnOutput(true);
stat_GetSXReqReceived->setFlagClearDataOnOutput(true);
stat_GetXReqReceived->setFlagClearDataOnOutput(true);
stat_WriteReqReceived->setFlagClearDataOnOutput(true);
stat_PutMReqReceived->setFlagClearDataOnOutput(true);
stat_outstandingReqs->setFlagClearDataOnOutput(true);
stat_ReqSent->setFlagClearDataOnOutput(true);
stat_ACMReqSent->setFlagClearDataOnOutput(true);
stat_GetSLatency->setFlagClearDataOnOutput(true);
stat_GetSXLatency->setFlagClearDataOnOutput(true);
stat_GetXLatency->setFlagClearDataOnOutput(true);
stat_WriteLatency->setFlagClearDataOnOutput(true);
stat_PutMLatency->setFlagClearDataOnOutput(true);
stat_cyclesWithIssue->setFlagClearDataOnOutput(true);
stat_cyclesAttemptIssueButRejected->setFlagClearDataOnOutput(true);
stat_totalCycles->setFlagClearDataOnOutput(true);

m_clockOn = true; /* Maybe parent should set this */
// NOTE: m_secEnabled: 0 - security primitives disabled, 1 - security primitives enabled (needs m_aesEncryptOrDecrypt options to behave correctly)
m_secEnabled = params.find<uint32_t>("aes_enable_security", 0);
Expand Down
6 changes: 6 additions & 0 deletions sst-elements-src/src/sst/elements/merlin/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ class Bridge : public SST::Component {

nic.stat_recv = registerStatistic<uint64_t>("pkts_received_net" + std::to_string(id));
nic.stat_send = registerStatistic<uint64_t>("pkts_sent_net" + std::to_string(id));

nic.stat_recv->setFlagResetCountOnOutput(true);
nic.stat_send->setFlagResetCountOnOutput(true);

nic.stat_recv->setFlagClearDataOnOutput(true);
nic.stat_send->setFlagClearDataOnOutput(true);
}

bool handleIncoming(int vn, uint8_t id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ hr_router::hr_router(ComponentId_t cid, Params& params) :
std::string port_name("port");
port_name = port_name + std::to_string(i);
xbar_stalls[i] = registerStatistic<uint64_t>("xbar_stalls",port_name);

xbar_stalls[i]->setFlagResetCountOnOutput(true);
xbar_stalls[i]->setFlagClearDataOnOutput(true);
}

init_vcs();
Expand Down
12 changes: 12 additions & 0 deletions sst-elements-src/src/sst/elements/merlin/interfaces/linkControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ LinkControl::LinkControl(ComponentId_t cid, Params &params, int vns) :
output_port_stalls = registerStatistic<uint64_t>("output_port_stalls");
idle_time = registerStatistic<uint64_t>("idle_time");

packet_latency->setFlagResetCountOnOutput(true);
send_bit_count->setFlagResetCountOnOutput(true);
recv_bit_count->setFlagResetCountOnOutput(true);
output_port_stalls->setFlagResetCountOnOutput(true);
idle_time->setFlagResetCountOnOutput(true);

packet_latency->setFlagClearDataOnOutput(true);
send_bit_count->setFlagClearDataOnOutput(true);
recv_bit_count->setFlagClearDataOnOutput(true);
output_port_stalls->setFlagClearDataOnOutput(true);
idle_time->setFlagClearDataOnOutput(true);

last_time = 0;
last_recv_time = 0;
}
Expand Down
16 changes: 16 additions & 0 deletions sst-elements-src/src/sst/elements/merlin/interfaces/portControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,22 @@ PortControl::PortControl(ComponentId_t cid, Params& params, Router* rif, int rt
idle_time = registerStatistic<uint64_t>("idle_time", port_name);
width_adj_count = registerStatistic<uint64_t>("width_adj_count", port_name);

send_bit_count->setFlagResetCountOnOutput(true);
recv_bit_count->setFlagResetCountOnOutput(true);
send_packet_count->setFlagResetCountOnOutput(true);
recv_packet_count->setFlagResetCountOnOutput(true);
output_port_stalls->setFlagResetCountOnOutput(true);
idle_time->setFlagResetCountOnOutput(true);
width_adj_count->setFlagResetCountOnOutput(true);

send_bit_count->setFlagClearDataOnOutput(true);
recv_bit_count->setFlagClearDataOnOutput(true);
send_packet_count->setFlagClearDataOnOutput(true);
recv_packet_count->setFlagClearDataOnOutput(true);
output_port_stalls->setFlagClearDataOnOutput(true);
idle_time->setFlagClearDataOnOutput(true);
width_adj_count->setFlagClearDataOnOutput(true);

// set the SAI metrics to 0
stalled = 0;
active = 0;
Expand Down

0 comments on commit 92a37f3

Please sign in to comment.