Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

BLOCK_SIZE in vdRngLognormal

ron_sobey
Beginner
723 Views
I am new to using IMKL. I will be primarily using in for running numerical simulations. In trying to understand how to use MKL I was programming in an example from Sergey Maidanov's paper Monte Carlo Options Pricing Using Various Industry Library Solutions, which I got from the Intel web site. In this paper for MKL he uses a variable called BLOCK_SIZE when he sets up his call to vdRngLognormal. He doesn't doesn't give a value for BLOCK_SIZE nor does he give any explanation on how to determine what it should be. Is the value for BLOCK_SIZE that will give the best performance dependent on the machine the code is run on, or the BRNG that is called for the random numbers?
0 Kudos
1 Reply
Intel_C_Intel
Employee
723 Views
The only reason to block is to use cache more effectively. You want a blocksize large enough that the VSL performance approaches the asymptotic performance for the function (see http://www.intel.com/software/products/mkl/data/vsl/vsl_performance_data.htm) but is not so large that there is cache thrashing. As the performance reference shows, vectors of about 1K in length give you a substantial percentage of the ultimate performance for the various random number generators. Bruce
0 Kudos
Reply