awk error message: division by zero attempted

Hi,

I'm executing unixbench tool v4.1 on an embedded system and I'm getting these error messages:

Execl Throughput 1 2 3awk: /unixbench/unixbench-4.1.0/pgms/loops.awk:38: (FILENAME=- FNR=4) fatal: division by zero attempted

Pipe Throughput 1 2 3 4 5 6 7 8 9 10awk: /unixbench/unixbench-4.1.0/pgms/loops.awk:38: (FILENAME=- FNR=4) fatal: division by zero attempted

and some other more... I have attached the awk script that is being used by the tool...

Could someone please let me know where the error could be and how to fix it or workaround it ?...

I'll appreciate any info regarding this...

Regards,

Rogelio M.

If you look in the awk script, it is pretty obvious where the division error is....

if(loops) { rsum += loops/secs;

You DO know that script has been written in 1991, and computing power has increased by a factor of 2 every 18 months since then (according to Moore's Law). This means that (if I didn't use the wrong calculation formula) a loop that took 1 second then has to be run about 10000 times (give or take). The loops used in your benchmark finish so fast, that any calculation using the time expired (like line 38ff in your script) may as well use zero.

Use the input you have a few thousand times over, and you might get results, maybe even slightly meaningful ones. Or if it's just raw CPU power you're interested in, calculate Pi to a few thousand digits after the decimal point. That way, if you finish too fast, just add a few.

Hi,

yes, I was aware that the error is in line 38 of the script... But I wanted to know why that was happening... Why the variable is getting a zero in it...

I just got the binaries and tried to execute it... I'll check if there's a newer version of it...

Thank you guys!!

Regards,

Rogelio M.