CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Some help for Red black SOR with OpenMP

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2006, 10:26
Default Some help for Red black SOR with OpenMP
  #1
Davoche
Guest
 
Posts: n/a
Hi everybody, I'm trying to parallelize ( with OpenMP ) a Numerical recipes routine. In fact, this is a Red black SOR algorithm.

But I don't know how to begin...

If somone could help me for this first experience...

Davoche

PS: You can find the algorithm below

**************************************************

ph():represent the 3D quantity to solve

res(): is the source term

omeg : is the relaxation parameter

************************************************** *

kjsw=1 do ipass=1,2 isw=kjsw

do 14 k=2,n3x

do 14 j=2,n2y

do 13 i=isw+1,n1z,2

fj=(-(ph(i+1,j,k)+ph(i-1,j,k)

+ph(i,j-1,k)+ph(i,j+1,k)

+ph(i,j,k+1)+ph(i,j,k-1))+res(i,j,k))

ph(i,j,k)=omeg*(fj/6)+(1.d0-omeg)*ph(i,j,k)

13 continue

isw=3-isw

14 continue

kjsw=3-kjsw

15 continue
  Reply With Quote

Old   February 5, 2006, 18:19
Default Re: Some help for Red black SOR with OpenMP
  #2
AnotherCFDUser
Guest
 
Posts: n/a
Parallelize the inner loop (there are no data dependencies as far as I can tell). The speed-up you will get will depend upon the size of the maximum index in the loop.

I forget the exact syntax but something like:

!$OMP PARALLEL DO (PRIVATE i,fj) . . . !$OMP END PARALLEL DO

should be about right.
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what does the black mean? poiu FLUENT 5 September 6, 2009 10:24
About the OpenMP jinwon park Main CFD Forum 5 August 28, 2007 06:47
OpenMP and fortran John Deas Main CFD Forum 0 May 17, 2007 17:53
color contours with black line edges Anish FLUENT 2 March 28, 2007 02:02
CFX-Post: black and white legend/plots? Sjoerd Romkes CFX 0 March 8, 2002 12:20


All times are GMT -4. The time now is 14:12.