Skip to content
Snippets Groups Projects
Commit 9945be26 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

eval?Locality: experiment

parent 9568f3a4
No related branches found
No related tags found
No related merge requests found
......@@ -127,19 +127,27 @@ static void performRound(State& state,
uint8_t* fiberData = fiberArgs->fiberData;
unsigned int bytesPerFiber = fiberArgs->state->bytesPerFiber;
// 75% Chance that this fiber will do work.
if (fiberData[0] < 192) {
for (unsigned int i = 0; i < bytesPerFiber; i++) {
fiberData[i] += fiberArgs->roundData;
for (unsigned int i = 0; i < bytesPerFiber; i++) {
unsigned int next = (i + L1_DCACHE_SIZE + fiberData[i]) % bytesPerFiber;
fiberData[i] -= fiberData[next];
fiberData[i] += fiberArgs->roundData;
/*
if (fiberData[i] < 128) {
fiberData[i] += fiberArgs->roundData / 2;
}
if (fiberData[i] > 192) {
fiberData[i] -= (fiberArgs->roundData * 4);
}
*/
if (i == (bytesPerFiber * 0.75)) {
if (fiberData[i] < 128) {
fiberData[i] += fiberArgs->roundData / 2;
}
if (fiberData[i] > 192) {
fiberData[i] -= (fiberArgs->roundData * 4);
break;
}
}
}
#ifdef FIBER_METADATA
fiberMetadata->end = std::chrono::high_resolution_clock::now();
#endif
......@@ -201,8 +209,8 @@ int main(UNUSED_ARG int argc, UNUSED_ARG char *argv[]) {
enableStacktraceOnAborts();
RuntimeVariant runtimeVariant = ws;
unsigned int rounds = 10;
unsigned int seed = 42;
unsigned int rounds = 20;
unsigned int seed = 4231;
int opt;
while ((opt = getopt(argc, argv, "m:")) != -1) {
......@@ -225,8 +233,8 @@ int main(UNUSED_ARG int argc, UNUSED_ARG char *argv[]) {
}
unsigned int coreCount = 4;
unsigned int bytesPerFiber = L1_DCACHE_SIZE / 4;
unsigned int fiberCount = coreCount * 6;
unsigned int bytesPerFiber = L1_DCACHE_SIZE / 2;
unsigned int fiberCount = coreCount * 4;
std::chrono::time_point<std::chrono::high_resolution_clock> start, end;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment