Is OpenMP expected to work with the Gfortran under Windows?
Al
Al
The first time I released OpenMP-enabled binaries, I added the -openmp
suffix to the name and posted an announcement on comp.lang.fortran.
Since then, all the Windows binaries posted have OpenMP support.
I'll be digging into your problem when I get some time.
Thanks for the bug-report,
FX
Brian Dessent <brian>at<dessent>dot<net> writes:
| It depends on whether you're talking about MinGW or Cygwin. For
MinGW
| then you'll need to first install the pthreads-win32 library before
| building gfortran/gcc, and possibly forcing the --enable-
threads=posix
| option since the MinGW default is --enable-threads=win32. Since
Cygwin
| provides the pthreads API you don't need an external library there
and
| it should work OOTB.
It seems thus as if one needs a special GCC/gfortran build for OpenMP.
> and the execution is actualy 50% slower than a G95
> (experimental 4.1 MinGW) version that does not support OpenMP.
This is with or without -fopenmp? Is there a difference in speed
between the two? Based on Brian's answer, I would expect that the -
fopenmp version is slightly slower and uses only one CPU.
Tobias
Yes, but this is exactly the procedure I follow to create the Windows
binaries, so they should really have OpenMP enabled. The fact that
they compile with -fopenmp and then sucessfully run (even with
extremely poor performance) indicates that the build procedure is
apparently OK.
As I said, I'll try to experiment some more. In the meantime, Al, if
you could get a short self-contained code that exhibits the behaviour
you see, it would help me get there faster.
Thanks,
FX
set omp_num_threads=2
I now get a different behavior. A Win32 exception occurs when the
second thread starts while the master continues on. When I get time,
I'll investigate further.
I should say that this OpenMP application runs as expected on other
platforms: MacOSX-PPC (XLF), MacOSX-x86 (Gfortran, and IVF), and
Windows (IVF). However for MaOSX-x86 Gfortran, I had to cut back
from -O3 to -O1 and not use -ftree-vectorize to get the application to
run properly. Could there be a conflict between the GCC vectorizer
and OpenMP?
Al
Al
.