- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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?
Thanks,
John
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jonh,
Not sure if it is still intrested. The libiomp5 is Intel OpenMP runtime library, which is from Intel Compiler. MKL use it. I just try the library from MKL 10.1.0.018 (the old version installed on my machine, the latest one is MKL 11.0 update 4) .. The problem does not exhibited.
for example, the code is
int imax = 50;
omp_set_num_threads(2);
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic) // this does not work for threads != default
// #pragma omp parallel for // this works properly for threads != default
#endif
link libiomp5mt.lib.
the result is like
42 -0.105245
1 44 0.894755
0 45 -0.105245
1 46 0.894755
0 47 -0.105245
1 48 0.894755
0 49 -0.105245.
It starts 2 threads.
On the other hands, Intel Compiler have removed the libiomp5mt.lib because some reason. please see http://software.intel.com/en-us/articles/openmp-support-change and http://software.intel.com/en-us/forums/topic/328168
So I guess it may be a bug of libiomp5, but have been fixed in later version.
Best Regards,
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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