Hakon,<br>
>From the comment "note-- skip first iteration", I would have guessed
that avgtime[0] had been initialized with the first time (instead of
zero) so that NTIMES instead of NTIMES-1 would have been correct. Or
maybe that's just what someone was thinking when they fumbled :-) So I
suggest looking at the initialization of avgtime[], which isn't in the
snippet.<br>
<br>
But of course such a typo would account for your error, but I'd check the initialization before changing the code.<br>
Peter<br><br><div><span class="gmail_quote">On 1/29/09, <b class="gmail_sendername">Håkon Bugge</b> <<a href="mailto:hbugge@platform.com">hbugge@platform.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I just ran stream_omp (C code) and noticed the average timing often was less than minimum timing.<br>
Turns out, there is a bug in the code (snip from <a href="http://www.cs.virginia.edu/stream/FTP/Code/Versions/stream_omp.c" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cs.virginia.edu/stream/FTP/Code/Versions/stream_omp.c</a>):<br>
<br>
for (k=1; k<NTIMES; k++) /* note -- skip first iteration */<br>
{<br>
for (j=0; j<4; j++)<br>
{<br>
avgtime[j] = avgtime[j] + times[j][k];<br>
<br>
and later:<br>
<br>
for (j=0; j<4; j++) {<br>
avgtime[j] = avgtime[j]/(double)NTIMES;<br>
<br>
Obviously, the divisor should have been (NTIMES-1).<br>
<br>
<br>
As a curiosity, the first time I corrected a well known and publicly used benchmark was in 1986, <a href="http://mvb.saic.com/freeware/vax88a3/rcas88/nets88/gnucbench.txt" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mvb.saic.com/freeware/vax88a3/rcas88/nets88/gnucbench.txt</a><br>
<br>
Am I getting too old for this?<br>
<br>
<br>
<br>
Thanks, Håkon<br>
<br>
<br>
_______________________________________________<br>
Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Beowulf@beowulf.org</a><br>
To change your subscription (digest mode or unsubscribe) visit <a href="http://www.beowulf.org/mailman/listinfo/beowulf" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
</blockquote></div><br>