[parsec-users] Blackscholes and icc

Hampton, Mark mark.hampton at intel.com
Mon Dec 8 15:50:29 EST 2008


The bs_thread() function in the blackscholes benchmark calls BlkSchlsEqEuroNoDiv() and assigns the result to the "price" variable.  However, unless ERR_CHK is defined, the price variable is never used.  This doesn't cause a problem when compiling the benchmark with gcc; however, when compiling with icc (I'm using version 11.0.069, and saw the same behavior with version 10.1.017) and using optimization level -O2 or -O3, the compiler recognizes that price is never used and removes the call to BlkSchlsEqEuroNoDiv(), resulting in no computation being performed.  I made a temporary fix for my purposes by adding "assert(price>=0.0||price<0.0);" after the assignment to price, but I figured that it would be good to address the issue in the next release of Parsec.  Thanks.

Mark Hampton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/parsec-users/attachments/20081208/be393ba7/attachment.html>

More information about the parsec-users mailing list