This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
OpenMP segfault with 4.3
- From: Salvatore Filippone <salvatore dot filippone at uniroma2 dot it>
- To: Fortran at gcc dot gnu dot org
- Date: Fri, 09 Nov 2007 17:07:12 +0100
- Subject: OpenMP segfault with 4.3
- Reply-to: salvatore dot filippone at uniroma2 dot it
Hi,
This comes from
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/9a7daa8d75084b6b/40c552bac0aa58c3#40c552bac0aa58c3
Sure looks like a bug to me
--------------------------------
[sfilippo@localhost TEST]$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.2/configure --prefix=/usr/local/gcc42
--with-mpfr=/h
ome/travel/GCC/BUILDS/mpfr
--with-gmp-lib=/home/travel/GCC/BUILDS/gmp/lib/ --wit
h-gmp=/home/travel/GCC/BUILDS/gmp
Thread model: posix
gcc version 4.2.2
[sfilippo@localhost TEST]$ gfortran -O3 -fopenmp -otomp tomp.f90
[sfilippo@localhost TEST]$ export OMP_NUM_THREADS=2
[sfilippo@localhost TEST]$ ./tomp
y(end) = 3.33333327338450
Reached result in 4.511314 seconds processor time.
[sfilippo@localhost TEST]$ /usr/local/gcc43/bin/gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.3-20071102/configure --prefix=/usr/local/gcc43
--with-mpfr=/home/travel/GCC/BUILDS/mpfr
--with-gmp-lib=/home/travel/GCC/BUILDS/gmp/lib/
--with-gmp=/home/travel/GCC/BUILDS/gmp
Thread model: posix
gcc version 4.3.0 20071102 (experimental) (GCC)
[sfilippo@localhost TEST]$ /usr/local/gcc43/bin/gfortran -O3 -fopenmp
-otomp tomp.f90
[sfilippo@localhost TEST]$ ./tomp
Segmentation fault
---------------------- tomp.f90 --------------------------------------
program sums
integer, parameter :: sp = kind(1.0)
integer, parameter :: dp = selected_real_kind(2*precision(1.0_sp))
integer, parameter :: num_steps = 2000000
real :: t1, t2
integer :: i, j
real(kind=dp), dimension(0:num_steps-1) :: y
call cpu_time(t1)
y=0
!$omp parallel do private(i,j)
do j=0,num_steps-1
do i=0,49
y(j) = y(j) + 0.7_dp**i
end do
end do
!$omp end parallel do
call cpu_time(t2)
print *, "y(end) = ", y(num_steps-1)
print *, "Reached result in ", t2-t1, " seconds processor time."
end program sums