Skip to content

Commit

Permalink
Merge pull request #2377 from sstsimulator/devel
Browse files Browse the repository at this point in the history
Automatically Merged using SST Master Branch Merger
  • Loading branch information
sst-autotester authored Jul 26, 2024
2 parents fd2a3ac + 6b5a4ac commit 5bf213f
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/sst/elements/memHierarchy/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ EXTRA_DIST = \
tests/testNoninclusive-2.py \
tests/testPrefetchParams.py \
tests/testThroughputThrottling.py \
tests/testRangeCheck.py \
tests/testScratchCache-1.py \
tests/testScratchCache-2.py \
tests/testScratchCache-3.py \
Expand Down Expand Up @@ -253,6 +254,7 @@ EXTRA_DIST = \
tests/refFiles/test_memHA_Noninclusive_1.out \
tests/refFiles/test_memHA_Noninclusive_2.out \
tests/refFiles/test_memHA_PrefetchParams.out \
tests/refFiles/test_memHA_RangeCheck.out \
tests/refFiles/test_memHA_ScratchCache_1.out \
tests/refFiles/test_memHA_ScratchCache_2.out \
tests/refFiles/test_memHA_ScratchCache_3.out \
Expand Down
47 changes: 28 additions & 19 deletions src/sst/elements/memHierarchy/memNICBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class MemNICBase : public MemLinkBase {
#define MEMNICBASE_ELI_PARAMS MEMLINKBASE_ELI_PARAMS, \
{ "group", "(int) Group ID. See params 'sources' and 'destinations'. If not specified, the parent component will guess.", "1"},\
{ "sources", "(comma-separated list of ints) List of group IDs that serve as sources for this component. If not specified, defaults to 'group - 1'.", "group-1"},\
{ "destinations", "(comma-separated list of ints) List of group IDs that serve as destinations for this component. If not specified, defaults to 'group + 1'.", "group+1"}
{ "destinations", "(comma-separated list of ints) List of group IDs that serve as destinations for this component. If not specified, defaults to 'group + 1'.", "group+1"},\
{ "range_check", "(int) Enable initial check for overlapping memory ranges. 0=Disabled 1=Enabled", "1"}

SST_ELI_REGISTER_SUBCOMPONENT_DERIVED_API(SST::MemHierarchy::MemNICBase, SST::MemHierarchy::MemLinkBase)

Expand Down Expand Up @@ -402,30 +403,33 @@ class MemNICBase : public MemLinkBase {
}
}
destEndpointInfo = newDests;

int stopAfter = 20; // This is error checking, if it takes too long, stop
for (auto et = destEndpointInfo.begin(); et != destEndpointInfo.end(); et++) {
for (auto it = std::next(et,1); it != destEndpointInfo.end(); it++) {
if (it->name == et->name) continue; // Not a problem
if ((it->region).doesIntersect(et->region)) {
dbg.fatal(CALL_INFO, -1, "%s, Error: Found destinations on the network with overlapping address regions. Cannot generate routing table."
"\n Destination 1: %s\n Destination 2: %s\n",
getName().c_str(), it->toString().c_str(), et->toString().c_str());

// This algorithm can take an extremely long time for some memory configurations.
if (range_check > 0) {
int stopAfter = 20; // This is error checking, if it takes too long, stop
for (auto et = destEndpointInfo.begin(); et != destEndpointInfo.end(); et++) {
for (auto it = std::next(et,1); it != destEndpointInfo.end(); it++) {
if (it->name == et->name) continue; // Not a problem
if ((it->region).doesIntersect(et->region)) {
dbg.fatal(CALL_INFO, -1, "%s, Error: Found destinations on the network with overlapping address regions. Cannot generate routing table."
"\n Destination 1: %s\n Destination 2: %s\n",
getName().c_str(), it->toString().c_str(), et->toString().c_str());
}
stopAfter--;
if (stopAfter == 0) {
stopAfter = -1;
break;
}
}
stopAfter--;
if (stopAfter == 0) {
if (stopAfter <= 0) {
stopAfter = -1;
break;
}
}
if (stopAfter <= 0) {
stopAfter = -1;
break;
}
if (stopAfter == -1)
dbg.debug(_L2_, "%s, Notice: Too many regions to complete error check for overlapping destination regions. Checked first 20 pairs. To disable this check set range_check parameter to 0\n",
getName().c_str());
}
if (stopAfter == -1)
dbg.debug(_L2_, "%s, Notice: Too many regions to complete error check for overlapping destination regions. Checked first 20 pairs.\n",
getName().c_str());

for (auto it = networkAddressMap.begin(); it != networkAddressMap.end(); it++) {
dbg.debug(_L10_, " Address: %s -> %" PRIu64 "\n", it->first.c_str(), it->second);
Expand Down Expand Up @@ -536,6 +540,7 @@ class MemNICBase : public MemLinkBase {

// Other parameters
std::unordered_set<uint32_t> sourceIDs, destIDs; // IDs which this endpoint cares about
uint32_t range_check = true; // Enable overlapping range check

private:

Expand All @@ -561,6 +566,10 @@ class MemNICBase : public MemLinkBase {
params.find_array<uint32_t>("destinations", dstArr);
destIDs = std::unordered_set<uint32_t>(dstArr.begin(), dstArr.end());
}

// range_check current is off(0) or on(1) but is using a uint32_t to
// allow for future selection of different algorithms.
range_check=params.find<uint32_t>("range_check", 1);

std::stringstream sources, destinations;
uint32_t id;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
memory0 start=0x0 end=0x3FE07FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory1 start=0x8000000 end=0x3FE0FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory2 start=0x10000000 end=0x3FE17FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory3 start=0x18000000 end=0x3FE1FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory4 start=0x20000000 end=0x3FE27FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory5 start=0x28000000 end=0x3FE2FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory6 start=0x30000000 end=0x3FE37FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory7 start=0x38000000 end=0x3FE3FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory8 start=0x40000000 end=0x3FE47FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory9 start=0x48000000 end=0x3FE4FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory10 start=0x50000000 end=0x3FE57FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory11 start=0x58000000 end=0x3FE5FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory12 start=0x60000000 end=0x3FE67FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory13 start=0x68000000 end=0x3FE6FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory14 start=0x70000000 end=0x3FE77FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory15 start=0x78000000 end=0x3FE7FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory16 start=0x80000000 end=0x3FE87FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory17 start=0x88000000 end=0x3FE8FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory18 start=0x90000000 end=0x3FE97FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory19 start=0x98000000 end=0x3FE9FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory20 start=0xA0000000 end=0x3FEA7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory21 start=0xA8000000 end=0x3FEAFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory22 start=0xB0000000 end=0x3FEB7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory23 start=0xB8000000 end=0x3FEBFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory24 start=0xC0000000 end=0x3FEC7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory25 start=0xC8000000 end=0x3FECFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory26 start=0xD0000000 end=0x3FED7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory27 start=0xD8000000 end=0x3FEDFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory28 start=0xE0000000 end=0x3FEE7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory29 start=0xE8000000 end=0x3FEEFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory30 start=0xF0000000 end=0x3FEF7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory31 start=0xF8000000 end=0x3FEFFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory32 start=0x100000000 end=0x3FF07FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory33 start=0x108000000 end=0x3FF0FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory34 start=0x110000000 end=0x3FF17FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory35 start=0x118000000 end=0x3FF1FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory36 start=0x120000000 end=0x3FF27FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory37 start=0x128000000 end=0x3FF2FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory38 start=0x130000000 end=0x3FF37FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory39 start=0x138000000 end=0x3FF3FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory40 start=0x140000000 end=0x3FF47FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory41 start=0x148000000 end=0x3FF4FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory42 start=0x150000000 end=0x3FF57FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory43 start=0x158000000 end=0x3FF5FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory44 start=0x160000000 end=0x3FF67FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory45 start=0x168000000 end=0x3FF6FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory46 start=0x170000000 end=0x3FF77FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory47 start=0x178000000 end=0x3FF7FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory48 start=0x180000000 end=0x3FF87FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory49 start=0x188000000 end=0x3FF8FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory50 start=0x190000000 end=0x3FF97FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory51 start=0x198000000 end=0x3FF9FFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory52 start=0x1A0000000 end=0x3FFA7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory53 start=0x1A8000000 end=0x3FFAFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory54 start=0x1B0000000 end=0x3FFB7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory55 start=0x1B8000000 end=0x3FFBFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory56 start=0x1C0000000 end=0x3FFC7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory57 start=0x1C8000000 end=0x3FFCFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory58 start=0x1D0000000 end=0x3FFD7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory59 start=0x1D8000000 end=0x3FFDFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory60 start=0x1E0000000 end=0x3FFE7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory61 start=0x1E8000000 end=0x3FFEFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory62 start=0x1F0000000 end=0x3FFF7FFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
memory63 start=0x1F8000000 end=0x3FFFFFFFFFF size=0x1000000000 interleave_size=128MiB interleave_step=8192MiB
Simulation is complete, simulated time: 175.616 us
Loading

0 comments on commit 5bf213f

Please sign in to comment.