How to code for parallel computing using PETSC in CFD
Aron Ahmadia
aja2111 at columbia.edu
Mon Jan 1 19:19:24 CST 2007
Dear Ben,
If I was doing this for an optimized code on a stationary grid, I
would run the if tests once at the beginning to generate lists of
points for each boundary, and then run the for loops over those lists.
~Aron
On 12/30/06, Ben Tay <zonexo at gmail.com> wrote:
> Hi,
>
> I'm now trying to modify my source code to enable parallel computing. I
> tried to use the tutorial example and I managed to get it working. However,
> in the example, there are a lot of "if"s statement which is not efficient.
>
> In my CFD code, I've subroutine meant for corner cells, north, south, east ,
> west and finally internal cells. How should I modify my code then?
>
> My current idea is to insert a check statement into each subroutine ie " if
> II>=Istart and II<=Iend-1 then ...."
>
> That's the simplest and least modification required. But does anyone know a
> better way?
>
>
> Thanks and happy new year to all!
More information about the petsc-users
mailing list