There was an earlier thread on this forum, with a similar problem relating to an earlier version of MKL. The thread indicated that this was a bug fixed in later versions of MKL!
Any help is greatly appreciated.
Attached is VS project to reproduce the problem. The Debug/Release configurations are for the problem dll case and the Static Debug/Static Release Configurations are for the working static linking case. Change the constant NUM_ELEMENTS defined in MKLTestApp.cpp to change the vector size.Setting the value to3389 or larger, will produce bad results in the dll case.
Some more info...
The problem happens when openMP support is turned on in the project. My guess is there is some conflict between openMP libraries in Visual Studio 2008and the ones used in MKL.
Also, if I pass the same pointer for the input andoutput (i.e, VdSqrt(n, a, a)) , I get incorrect output for large vectors. Is this a new restrictionin MKL 10.2? It used to work for earlier versions.
The link advisor on the forum page would indicate how the command line version of linking should go (possibly the static version).
Thanks for test case. No, this is an unknown problem for 10.2 and there are no restriction for this functionality.
I didn't build and run your application yet, however the linking line you are using:
AdditionalDependencies="libiomp5md.lib mkl_intel_c_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib"
Is looks correct to me.
We need to check the problem on our side.
i used the test you proveided and I couldn't reproduce the result.
the output I got:
Press any key to continue . . .
#define NUM_ELEMENTS 33890
some more details aboutthe environment I tested:
CPU -- Intel Core2 Quad CPU @ 2.66GHz
MKL version -- Package ID: w_mkl_p_10.2.1.019
What is the CPU type you are working on?
Thanks for the reply. I was successful in configuring the project and run it with the MKL libiomp5md instead of the Microsoft vcomp90 libraries only if I do not link to any other mkl libraries. When I link with the mkl libraries (mkl_intel_thread_dll.lib mkl_intel_c_dll.lib mkl_core_dll.lib), it tries tolink tothe Microsoft vcomp90 library.
I have added compiler option /D_OPENMP_NOFORCE_MANIFEST and used /nodefaultlib:vcomp90 as recommended in this article
I can't get it to work with the MKL libraries.
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
so it appears that nodefaultlib requires vcomp.lib and vcompd.lib to be spelled out. In fact, there is no vcomp90 in my installation of VC9, so the spellings I quote are correct.
In case it's of interest, if you link with libiompprof5md, (as is recommended for thread profiler), but run normally without thread profiler, a file name guide.gvs is written each time you run, which contains statistics on OpenMP performance. All parallel regions in MSVC compiled code are lumped together, but the MKL parallel regions should be summarized separately.
I was finally able to get it to work by adding /NODEFAULTLIB:"vcomp.lib" /NODEFAULTLIB:"vcompd.lib".
The vcomp90 is actually the dll name but the stub libraries are vcomp.lib and vcompd.lib.
Thanks for the help.
I just started using vsSqrt and am noticing the same behaviors. vsSqrt seems to be wrong in a similar manner as described in this post. I am using the MKL v11 and Composer 13 with Visual Studio 2010. Any explicit instruction on how to get the right version of OpenMP in place would be greatly appreciated.