OK, so DISKIO, the continuing mission to boldly go where I haven't gone before! LOL
Working through what seems like funny results, outcomes that change based on duration of the test, which to me implies an overflow.
In the case of the Dhrystone benchmark for the CPU, here is the pertinent section of the code:
...
void run_dhrystone (void)
{
long lDhryTime = dhry_stone ();
/* originally, time is measured in ms */
lDhryTime = (lDhryTime + 5) / 10;
/* now it is in units of 10 ms */
if (lDhryTime == 0)
lDhryTime = 1; /* if less than 10 ms, then assume at least 10 ms */
/* now calculate runs per second */
ulDhryStones = Number_Of_Runs * 100 / lDhryTime;
/* by the time we cross 20 million dhrystones per second with a CPU,
we will hopefully have only 64-bit machines to run this on ... */
#ifdef DEBUG
printf("\n DEBUG => lDhryTime is: %ld", lDhryTime);
printf("\n DEBUG => Number_Of_runs is: %lu", Number_Of_Runs);
printf("\n DEBUG => ulDhryStones is: %lld", ulDhryStones);
printf("\n\n DEBUG => ULONG size is: %d\n", sizeof(ULONG));
printf(" DEBUG => ULONG bit size is: %d\n", sizeof(ULONG) * CHAR_BIT);
printf("\n DEBUG => LONG LONG size is: %d\n", sizeof(long long));
printf(" DEBUG => LONG LONG bit size is: %d\n", sizeof(long long) * CHAR_BIT);
#endif /* DEBUG */
} // end of run_dhrystone
...
...and what I'm seeing is the following weird situation:
1) t=5 secs
Dhrystone benchmark for this CPU:
DEBUG => lDhryTime is: 502
DEBUG => Number_Of_runs is: 31084783
DEBUG => ulDhryStones is: 6192187 6192187 runs/sec
DEBUG => ULONG size is: 4
DEBUG => ULONG bit size is: 32
DEBUG => LONG LONG size is: 8
DEBUG => LONG LONG bit size is: 64
2) t=7 secs
Dhrystone benchmark for this CPU:
DEBUG => lDhryTime is: 1003
DEBUG => Number_Of_runs is: 65230248
DEBUG => ulDhryStones is: 2221393 2221393 runs/sec
DEBUG => ULONG size is: 4
DEBUG => ULONG bit size is: 32
DEBUG => LONG LONG size is: 8
DEBUG => LONG LONG bit size is: 64
Clearly, the result for t=7 secs is wrong.
ulDhryStones is defined as 'long long', was originally 'ULONG' but it looked like it was overflowing so I changed it to 'long long', but that's still not big enough.
So this is the weird part (to me anyways), long long is a substantial –9,223,372,036,854,775,807 to 9,223,372,036,854,775,807, so why am I seeing this? Is my printf use of '%lld' incorrect?