1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

workloads/dhrystone: fix run with num loops and delay

Fix output when running for a specified number of loops (rather than
duration) and adding delay to threads. Previously, the output for the
last thread was not printed due to a missing check for a negative
duration.
This commit is contained in:
Sergei Trofimov 2017-12-08 09:21:00 +00:00 committed by marcbonnici
parent 5729df0a5b
commit 4069e37f6b
3 changed files with 6 additions and 2 deletions

View File

@ -567,12 +567,15 @@ run_dhrystone(int duration, int num_threads, long num_loops, int delay) {
sleep(delay);
}
run_for_duration(duration - delay * (num_threads - 1), loops_per_thread);
actual_duration = duration - delay * (num_threads - 1);
if (actual_duration < 0)
actual_duration = 0;
run_for_duration(actual_duration, loops_per_thread);
for (i = 0; i < num_threads; i++) {
int status, w;
do {
w= wait(&status);
w = wait(&status);
} while (w != -1 && (!WIFEXITED(status) && !WIFSIGNALED(status)));
}
@ -584,6 +587,7 @@ run_dhrystone(int duration, int num_threads, long num_loops, int delay) {
run_for_duration(int duration, long num_loops) {
clock_t end = clock() + duration * CLOCKS_PER_SEC;
do {
Proc0(num_loops, duration == 0);
} while (clock() < end);