Skip to content

Commit

Permalink
cleanup latency code
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Lavin committed Jan 13, 2025
1 parent 1ff1526 commit b90e8c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 49 deletions.
48 changes: 4 additions & 44 deletions src/sst/elements/ariel/arielcore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <iostream>
#include <exception>
#include <stdexcept>
#include <typeinfo>

#ifdef HAVE_CUDA
#include <../balar/balar_event.h>
Expand Down Expand Up @@ -64,7 +63,6 @@ ArielCore::ArielCore(ComponentId_t id, ArielTunnel *tunnel,
writePayloads = params.find<int>("writepayloadtrace") == 0 ? false : true;
coreQ = new std::queue<ArielEvent*>();
pendingTransactions = new std::unordered_map<StandardMem::Request::id_t, RequestInfo>();
//startTimes = new std::unordered_map<StandardMem::Request::id_t, uint64_t>();
pending_transaction_count = 0;

#ifdef HAVE_CUDA
Expand Down Expand Up @@ -188,7 +186,6 @@ void ArielCore::commitReadEvent(const uint64_t address,
#endif
pending_transaction_count++;
pendingTransactions->insert( std::pair<StandardMem::Request::id_t, RequestInfo>(req->getID(), {req, getCurrentSimTime(timeconverter)}) );
//startTimes->insert( std::pair<StandardMem::Request::id_t, uint64_t>(req->getID(), getCurrentSimTime(timeconverter)) );
#ifdef HAVE_CUDA
}
#endif
Expand Down Expand Up @@ -237,7 +234,6 @@ void ArielCore::commitWriteEvent(const uint64_t address,
#endif
pending_transaction_count++;
pendingTransactions->insert( std::pair<StandardMem::Request::id_t, RequestInfo>(req->getID(), {req, getCurrentSimTime(timeconverter)}) );
//startTimes->insert( std::pair<StandardMem::Request::id_t, uint64_t>(req->getID(), getCurrentSimTime(timeconverter)) );
#ifdef HAVE_CUDA
}
#endif
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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<StandardMem::ReadResp*>(event)) {
updateStats(rresp, find_entry->second.start);
} else if (wresp = dynamic_cast<StandardMem::WriteResp*>(event)) {
updateStats(wresp, find_entry->second.start);
if (dynamic_cast<StandardMem::ReadResp*>(event)) {
statReadLatency->addData(getCurrentSimTime(timeconverter) - find_entry->second.start);
} else if (dynamic_cast<StandardMem::WriteResp*>(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()));
Expand All @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions src/sst/elements/ariel/arielcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -245,8 +242,6 @@ class ArielCore : public ComponentExtension {
#endif

std::unordered_map<StandardMem::Request::id_t, RequestInfo>* pendingTransactions;
//std::unordered_map<StandardMem::Request::id_t, StandardMem::Request*>* pendingTransactions;
//std::unordered_map<StandardMem::Request::id_t, uint64_t>* startTimes;
uint32_t maxIssuePerCycle;
uint32_t maxQLength;
uint64_t cacheLineSize;
Expand Down

0 comments on commit b90e8c4

Please sign in to comment.