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

Suppressing error messages.

I have been attempting to replace the random number generator I have in my code with MKL's generator. In one subroutine, I would like to check if a specific stream, for example, type(vsl_stream_state) rng, is initialized. I have not found a straightforward way of doing this with MKL functions. As an alternative, I wanted to use vslGetStreamStateBrng. If the returned value is VSL_ERROR_NULL_PTR then rng is not initialized. However, when rng is indeed uninitialized, in addition to returning the corresponding error value, MKL also prints an error message to the screen: 'Intel MKL ERROR: Parameter 1 was incorrect on entry to vslGetStreamStateBrn.' This is also true for vslCopyStreamState and vslGetStreamSize. For my case, this is entirely unnecessary as 'NULL pointer' is one of the expected outcome and is handled properly in my subroutine. I would like to know if there is a way to disable this message, by either setting up MKL to avoid printing error messages to the screen, or by using a different method to check if a random stream is initialized. I have read something about an MKL subroutine xerbla, which appears to handle such scenario. But I did not understand exactly how to use my own version of the subroutine to suppress the error messages. In addition, I actually only want to suppress this single message, not the other ones. Thank you very much, any suggestion is appreciated.
0 Kudos
0 Replies