summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--src/run.cpp9
2 files changed, 9 insertions, 1 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..28f1574
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Fix the fucked up iteration prediction when using many threads.
diff --git a/src/run.cpp b/src/run.cpp
index c78f89a..c3e2495 100644
--- a/src/run.cpp
+++ b/src/run.cpp
@@ -116,7 +116,13 @@ int Run::run() {
this->exp->prefetch_hint);
// calculate the number of iterations
- if (this->exp->iterations <= 0) {
+ /*
+ * As soon as the thread count rises, this calculation HUGELY
+ * differs between runs. What does cause this? Threads are already
+ * limited to certain CPUs, so it's not caused by excessive switching.
+ * Strange cache behaviour?
+ */
+ if (0 == this->exp->iterations) {
volatile static double istart = 0;
volatile static double istop = 0;
volatile static double elapsed = 0;
@@ -155,6 +161,7 @@ int Run::run() {
} else {
this->exp->iterations = std::max(1.0, 0.9999 + iters / elapsed);
}
+ //printf("Tested %d iterations: took %f seconds; scheduling %d iterations\n", iters, elapsed, this->exp->iterations);
}
this->bp->barrier();
}