Meanwhile i processed some tests with OpenMP.
Note: Never used it before, so maybe i misunderstood things.
But there are some strange results, i didn't expected:
First: It seems not possible to debug an openmp program directly
(only with disabledopenmp option).
Then, there is some odd behaviour:
Take example (using Win7 64-bit). So,
- It shall not necessary to use omp.h, but it crashes without it.
- Otherwise without using omp.h, it crashes not, if i use /Ze.
M$ extensions shall also not necessary using the code.
#define _USE_MATH_DEFINES
#include <stdio.h>
//#include <omp.h>
#include <math.h>
int main(int argc, char *argv[])
{
const int size = 256;
double sinTable[size];
#pragma omp parallel for
for(int n=0; n<size; ++n)
sinTable[n] = sin(2 * M_PI * n / size);
return 0;
}
Whats Your experience?
Thx
Lingo
Seems to be a bug in x64.
occasionally trash esi, when when compiled without -Ze and optimization.
EDIT: example project
Can I get the *exact* compiler options please, since I can't immediately see a problem here...
Quote from: Pelle on April 20, 2014, 11:34:54 AM
Can I get the *exact* compiler options please, since I can't immediately see a problem here...
The program above crashes with these compiler options:
-std:C11 -Tx64-coff -Ot -Ob1 -fp:precise -W1 -Gr -openmp
Hint: Further examinations show, that the sharing of the size
variable - exactly the declaration as const - seems the problem.
HTH
Lingo