Google Groups Home
Help | Sign in
Message from discussion GFortran - OpenMP problem with Windows XP memory
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Cirilo S. Bresolin  
View profile
 More options May 13, 4:56 pm
Newsgroups: comp.lang.fortran
From: "Cirilo S. Bresolin" <cirilo.breso...@gmail.com>
Date: Tue, 13 May 2008 13:56:51 -0700 (PDT)
Local: Tues, May 13 2008 4:56 pm
Subject: GFortran - OpenMP problem with Windows XP memory
Hi!

I am experiencing a problem with a simple multithread program and
WindowsXP.

The program is as follows. It doesn't do nothing, because I'm just
testing and learning the OpenMP directives.

program test
use omp_lib
implicit none
integer :: i,j
integer, parameter :: n=361
double precision :: a(n,n), b(n,n)

call omp_set_num_threads(2)

!$omp parallel shared(a,b) private(i,j)
!$omp do
do i=1,n
   do j=1,n
       a(j,i) = dble(i)**2.d0 + dble(j)**2.d0                 !This
operations is just to spend some cpu time
       b(j,i) = dble(i)**4.d0 + dble(j)**4.d0
       a(j,i) = b(j,i)/(b(j,i)*b(j,i)) + a(j,i)/(a(j,i)*a(j,i))
   end do
end do
!$omp end do
!$omp end parallel

end program

I compile using: gfortran file.f95 - fopenmp
System: Windows XP Professional SP2
Machine: Intel Core 2 Duo E6550 2.33 GHz 2Gb RAM

The problem: If I set n = 361 the windows crashs the program, if it is
set to 360 it runs ok. Without the -fopenmp flag, I can set n up to
11169, but with 11170 it crashs. In the last case I understand that is
a memory limit problem, but in the first I don't. Why this happen? n
is to small to be memory problem.

An interesting behavior. The same program with single precision has
the limits: n=510 with -fopemmp flag and n=15795 without the flag. The
ratio 510/360 = 15795/11169 = sqrt(2).

Some light over this problem?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google