Hakon,<br>
>From the comment &quot;note-- skip first iteration&quot;, 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&#39;s just what someone was thinking when they fumbled :-) So I
suggest looking at the initialization of avgtime[], which isn&#39;t in the
snippet.<br>
<br>
But of course such a typo would account for your error, but I&#39;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> &lt;<a href="mailto:hbugge@platform.com">hbugge@platform.com</a>&gt; 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>
 &nbsp; &nbsp;for (k=1; k&lt;NTIMES; k++) /* note -- skip first iteration */<br>
 &nbsp; &nbsp; &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp;for (j=0; j&lt;4; j++)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;avgtime[j] = avgtime[j] + times[j][k];<br>
<br>
and later:<br>
<br>
 &nbsp; &nbsp;for (j=0; j&lt;4; j++) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;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>
<br />-- 
<br />This message has been scanned for viruses and
<br />dangerous content by
<a href="http://www.mailscanner.info/"><b>MailScanner</b></a>, and is
<br />believed to be clean.