[parsec-users] Blackscholes issues

Kurtov, Nikolay nikolay.kurtov at intel.com
Wed Jun 18 06:23:49 EDT 2008


Hello everyone,

 

Publishing such a benchmark as Blackscholes was a great job,
unfortunately blackscholes.c contains some issues.

I'd like to see them resolved.

 

1.	Not enough memory allocated for OptionType, there should be one
more byte for '\0'.

(297)          data[loopnum].OptionType = new
char[strlen(temp->OptionType)];

 

2.	Wrong string comparison:

(329)        otype[i]      = (data[i].OptionType == "P") ? 1 : 0;

 

3. optionData.txt contains about 1000 objects and value of numOptions is
overridden at the very beginning of the program:

      (54) int numOptions = 960;

(287) numOptions = atoi(argv[2]);

 

3.	Redundant calculations, at (198) xD2 is assigned a value that
doesn't depends on only on (196) and (197)

(188)    xD1 = xRiskFreeRate + xPowerTerm;

(189)    xD2 = xRiskFreeRate - xPowerTerm;

(190)    xD1 = xD1 * xTime;

(191)    xD2 = xD2 * xTime;

        

(193)   xD1 = xD1 + xLogTerm;

(194)   xD2 = xD2 + xLogTerm;

 

(196)   xDen = xVolatility * xSqrtTime;

(197)   xD1 = xD1 / xDen;

 

(198)      xD2 = xD1 -  xDen;

 

4.	If fptype is float, calculation results for some Options can
exceed 1e-5, but never exceeds 1e-4

(246)            if( fabs(priceDelta) >= 1e-5 ){

 

5.	It always prints 8:

(337)         printf("Size of data: %d\n", sizeof(data) +
sizeof(otype));

 

6.	Some unreferenced variables declared on lines (78), (147),
(224), (286).

 

 

Regards,

Nikolay Kurtov

 


--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park, 
17 Krylatskaya Str., Bldg 4, Moscow 121614, 
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/parsec-users/attachments/20080618/37a648c4/attachment.html>


More information about the parsec-users mailing list