- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

I have developed a function to generate a vector of random numbers. However, there are two problems:

1. When the number of random numbers to be generated is too large (e.g. 50000^2), it will output: MKL ERROR: Parameter 3 was incorrect on entry to vdRngUniform.

2. When the left bound is a positive number (i.e. a = 300 b = 100), the function violates the left bound condition and returns minimum value of zero! However, if 'a' is a negative number, it works correctly!

Can you please help? Thank you.

Afshin

int RNG_UNIF ( long int N, double a, double b, double *P ) { // N number of random values to be generated // a is the left bound // b is the right bound VSLStreamStatePtr stream; int errcode = 0; srand(time(0)); long seed = rand(); /***** Initialize *****/ errcode = vslNewStream( &stream, VSL_BRNG_MT2203, seed ); if (errcode != 0) goto err; /***** Call RNG *****/ errcode = vdRngUniform( VSL_RNG_METHOD_UNIFORM_STD_ACCURATE, stream, N, P, a, b ); if (errcode != 0) goto err; vslDeleteStream(&stream); err: return errcode; }

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

did you link with ILP64 libraries?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Yes. I used the following switches: -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -liomp5 -O2

I am using Intel MKL 2019 in Linux environment. How about the second problem?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

50000^2 > int 32, therefore you have to link with ILP64 libs instead of LP64 ones. Please check user's guide or mkl linker adviser how to link properly

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page