Measure a command¶
Use this to find out how long a command takes. The lesson behind it is Measuring.
Steps¶
- Load the program once, and start timing after
load: loading takes about a second. - Send the command many times, 20 or more, one after the other, each with its own
wait. - For each run, keep two numbers:
event.microseconds, the card's clock, and the difference of twotime.perf_counter()readings aroundsubmitandwait, the host's. - Report the middle value (
statistics.median) with the smallest and the largest. Do not report the first run: on the host's clock it was nearly four times the middle. - Say which clock the number is from. The card's clock is the time the cores worked; the host's is the time your program waited, and it includes the trips to the card.
To hide the trips, send many commands before the first wait
(Many commands).