From b90e8c45558cab727b76f88552c4529172e27aae Mon Sep 17 00:00:00 2001 From: Patrick Lavin Date: Mon, 13 Jan 2025 11:43:37 -0700 Subject: [PATCH] cleanup latency code --- src/sst/elements/ariel/arielcore.cc | 48 +++-------------------------- src/sst/elements/ariel/arielcore.h | 5 --- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/src/sst/elements/ariel/arielcore.cc b/src/sst/elements/ariel/arielcore.cc index 68b7237718..80c74fb8c1 100644 --- a/src/sst/elements/ariel/arielcore.cc +++ b/src/sst/elements/ariel/arielcore.cc @@ -19,7 +19,6 @@ #include #include #include -#include #ifdef HAVE_CUDA #include <../balar/balar_event.h> @@ -64,7 +63,6 @@ ArielCore::ArielCore(ComponentId_t id, ArielTunnel *tunnel, writePayloads = params.find("writepayloadtrace") == 0 ? false : true; coreQ = new std::queue(); pendingTransactions = new std::unordered_map(); - //startTimes = new std::unordered_map(); pending_transaction_count = 0; #ifdef HAVE_CUDA @@ -188,7 +186,6 @@ void ArielCore::commitReadEvent(const uint64_t address, #endif pending_transaction_count++; pendingTransactions->insert( std::pair(req->getID(), {req, getCurrentSimTime(timeconverter)}) ); - //startTimes->insert( std::pair(req->getID(), getCurrentSimTime(timeconverter)) ); #ifdef HAVE_CUDA } #endif @@ -237,7 +234,6 @@ void ArielCore::commitWriteEvent(const uint64_t address, #endif pending_transaction_count++; pendingTransactions->insert( std::pair(req->getID(), {req, getCurrentSimTime(timeconverter)}) ); - //startTimes->insert( std::pair(req->getID(), getCurrentSimTime(timeconverter)) ); #ifdef HAVE_CUDA } #endif @@ -268,20 +264,6 @@ void ArielCore::commitFlushEvent(const uint64_t address, } } -/* -void ArielCore::updateStats(StandardMem::Request* req, uint64_t start) { - // do nothing -} -*/ - -void ArielCore::updateStats(StandardMem::ReadResp* req, uint64_t start) { - statReadLatency->addData(getCurrentSimTime(timeconverter) - start); -} - -void ArielCore::updateStats(StandardMem::WriteResp* req, uint64_t start) { - statWriteLatency->addData(getCurrentSimTime(timeconverter) - start); -} - void ArielCore::handleEvent(StandardMem::Request* event) { ARIEL_CORE_VERBOSE(4, output->verbose(CALL_INFO, 4, 0, "Core %" PRIu32 " handling a memory event.\n", coreID)); StandardMem::Request::id_t mev_id = event->getID(); @@ -504,14 +486,10 @@ void ArielCore::handleEvent(StandardMem::Request* event) { #else if(find_entry != pendingTransactions->end()) { #endif - //event->handle(stdMemHandlers); - //updateStats(event, find_entry->second.start); - StandardMem::ReadResp* rresp; - StandardMem::WriteResp* wresp; - if (rresp = dynamic_cast(event)) { - updateStats(rresp, find_entry->second.start); - } else if (wresp = dynamic_cast(event)) { - updateStats(wresp, find_entry->second.start); + if (dynamic_cast(event)) { + statReadLatency->addData(getCurrentSimTime(timeconverter) - find_entry->second.start); + } else if (dynamic_cast(event)) { + statWriteLatency->addData(getCurrentSimTime(timeconverter) - find_entry->second.start); } ARIEL_CORE_VERBOSE(4, output->verbose(CALL_INFO, 4, 0, "Correctly identified event in pending transactions, removing from list, before there are: %" PRIu32 " transactions pending.\n", (uint32_t) pendingTransactions->size())); @@ -527,15 +505,6 @@ void ArielCore::handleEvent(StandardMem::Request* event) { } void ArielCore::StdMemHandler::handle(StandardMem::ReadResp* resp) { - /* - auto start = core->startTimes->find(resp->getID()); - if (start != core->startTimes->end()) { - core->statReadLatency->addData(core->getCurrentSimTime(core->timeconverter) - start->second); - core->startTimes->erase(start); - } else { - core->output->fatal(CALL_INFO, -4, "Memory event response to core: %" PRIu32 " was not found in pending list.\n", core->coreID); - } - */ #ifdef HAVE_CUDA // Update total ACK and Page ACK core->setAckTransfer(core->getAckTransfer() + resp->size); @@ -555,15 +524,6 @@ void ArielCore::StdMemHandler::handle(StandardMem::ReadResp* resp) { } void ArielCore::StdMemHandler::handle(StandardMem::WriteResp* resp) { - /* - auto start = core->startTimes->find(resp->getID()); - if (start != core->startTimes->end()) { - core->statWriteLatency->addData(core->getCurrentSimTime(core->timeconverter) - start->second); - core->startTimes->erase(start); - } else { - core->output->fatal(CALL_INFO, -4, "Memory event response to core: %" PRIu32 " was not found in pending list.\n", core->coreID); - } - */ #ifdef HAVE_CUDA // Update total ACK and Page ACK core->setAckTransfer(core->getAckTransfer() + resp->size); diff --git a/src/sst/elements/ariel/arielcore.h b/src/sst/elements/ariel/arielcore.h index 1aa5f04b3b..bdf77f22c6 100644 --- a/src/sst/elements/ariel/arielcore.h +++ b/src/sst/elements/ariel/arielcore.h @@ -152,9 +152,6 @@ class ArielCore : public ComponentExtension { void setGpuLink(Link* gpulink); #endif - void updateStats(StandardMem::Request* req, uint64_t start); - void updateStats(StandardMem::ReadResp* req, uint64_t start); - void updateStats(StandardMem::WriteResp* req, uint64_t start); void handleEvent(StandardMem::Request* event); void handleReadRequest(ArielReadEvent* wEv); void handleWriteRequest(ArielWriteEvent* wEv); @@ -245,8 +242,6 @@ class ArielCore : public ComponentExtension { #endif std::unordered_map* pendingTransactions; - //std::unordered_map* pendingTransactions; - //std::unordered_map* startTimes; uint32_t maxIssuePerCycle; uint32_t maxQLength; uint64_t cacheLineSize;