Skip to content
Snippets Groups Projects
Commit cc5f2362 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Report deadtime when using a fixed delay, note how bad nanosleep is, must be a...

Report deadtime when using a fixed delay, note how bad nanosleep is, must be a major source of mismatch in our timings
parent 0406525b
No related branches found
No related tags found
3 merge requests!9Draft: Multiple threads for inject, send and recv.,!3Draft: Multi injectors many,!1Increase no. of injection threads to 2
...@@ -95,7 +95,8 @@ static void injection_runner(int qid) { ...@@ -95,7 +95,8 @@ static void injection_runner(int qid) {
* are below that (we time the ticks this loop takes without any waiting * are below that (we time the ticks this loop takes without any waiting
* and use that). Otherwise we wait a while. Note we need to convert the * and use that). Otherwise we wait a while. Note we need to convert the
* ticks of the log file into nanoseconds, that requires the original * ticks of the log file into nanoseconds, that requires the original
* CPU frequency. */ * CPU frequency. Note nanosleep is not very accurate and seems to have
* a base line at 50us using tests on Durham COSMA. */
if (dt > looptics) { if (dt > looptics) {
struct timespec sleep; struct timespec sleep;
sleep.tv_sec = 0; sleep.tv_sec = 0;
...@@ -168,7 +169,7 @@ static void injection_runner(int qid) { ...@@ -168,7 +169,7 @@ static void injection_runner(int qid) {
message("%d injections completed, sends = %d, recvs = %d", ind_req[qid], message("%d injections completed, sends = %d, recvs = %d", ind_req[qid],
nr_sends, nr_recvs); nr_sends, nr_recvs);
message("remaining sends = %d, recvs = %d", todo_send, todo_recv); message("remaining sends = %d, recvs = %d", todo_send, todo_recv);
if (usetics) message("deadtime %.3f ms", deadtime / 1.0e6); if (usetics|| waitns > 0) message("deadtime %.3f ms", deadtime / 1.0e6);
} }
message("took %.3f %s.", clocks_from_ticks(getticks() - starttics), message("took %.3f %s.", clocks_from_ticks(getticks() - starttics),
clocks_getunit()); clocks_getunit());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment