NO

Author Topic: Testing OpenMP on new poide 8 rc2  (Read 2685 times)

Offline lingo

  • Member
  • *
  • Posts: 27
Testing OpenMP on new poide 8 rc2
« on: April 15, 2014, 10:43:57 AM »
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.

Code: [Select]
#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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2107
Re: Testing OpenMP on new poide 8 rc2
« Reply #1 on: April 17, 2014, 07:52:06 AM »
Seems to be a bug in x64.
occasionally trash esi, when when compiled without -Ze and optimization.

EDIT: example project
« Last Edit: April 20, 2014, 10:52:43 PM by TimoVJL »
May the source be with you

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Testing OpenMP on new poide 8 rc2
« Reply #2 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...
/Pelle

Offline lingo

  • Member
  • *
  • Posts: 27
Re: Testing OpenMP on new poide 8 rc2
« Reply #3 on: April 22, 2014, 07:44:57 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