|
[Sponsors] |
February 4, 2006, 10:26 |
Some help for Red black SOR with OpenMP
|
#1 |
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 |
|
February 5, 2006, 18:19 |
Re: Some help for Red black SOR with OpenMP
|
#2 |
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. |
|
|
|
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 |