When I use MVC++ compiler running normally, using Intel c++ compiler the loop execution out-of-order(thread = 1).
The following code:
HANDLE *flag = new HANDLE[mNumberOfWorkers];
for(int i=0; i<mNumberOfWorkers; i++)
WaitForMultipleObjects(mNumberOfWorkers, flag, true, INFINITE);
for (int h = 0; h < mNumberOfWorkers; h++)
for (int i=0, imax=Size; i<imax; i++)
The above function OSGeoWorker is not over, When the program execution to image=0.
The function OSGeoWorker and loop(for (int i=0, imax=Size; i<imax; i++)) run alternately.
how can I find the error in the program?
Thank you !
Do you use equivalent compiler optimization levels for the 2 compilers, e.g.
/Ox /fp:precise for both
/Ox /fp:fast for MSVC++ and /Ox /fp:source for ICL?
MSVC has no optimization as aggressive as the ICL defaults.
Do you mean that single thread which is executing OSGeoWorker did not terminate? Did you check any terminating conditions inside aferementioned function like: infinite loops?
I seems cannot reproduce this with a simple test case using your code snippet.
What's the Intel compiler version you are using? And how about the compiler options?
A reproducible test case is preferred to root cause the problem.