We have a program that we for various reasons we on rare occasion need to link statically. When we do, we encounter the following problem with a parallel for loop. The conditions are
A. Program linked statically with libiomp5mt.lib
B. The number of threads are set different than the default number of threads, i.e., the number of threads that would be used if OMP_NUM_THREADS is not set or omp_set_num_threads() is not used.
C. The schedule(dynamic), schedule(dynamic,X) or schedule(static,X) is used in the for loop. 'schedule(static)' or no schedule does not exhibit the problem.
Under these conditions, the for loop will only execute the first loop of the iteration and then exit.
Our platform is MS Vista 64, MS Visual Studio 2008, MS C++ compiler, Intel MKL 10.0.5.025. I have attached a visual studio project that exhibits the problem.
If VCOMP is used instead of libiomp, the problem does not occur.
We are wondering if this is an MKL problem or a MS VS problem, or possibly something we are unaware of with OpenMP?