distributed array

Berend van Wachem berend at chalmers.se
Thu Jul 20 15:19:50 CDT 2006


Dear Mat,

> However, after going through your code i rethought what i am trying to do. And 
> i am not sure if the idea of using DA's is the best way or not. 
> The reason i initially thought of using DA's was due to its description in the 
> user manual " ... are intended for use with logically regular rectangular 
> grids when communication of nonlocal data is needed before certain local 
> computations can occur."
> 
> Well, my problem is such that i already have my right hand side. What i need 
> to do is transfer this to a PETSc vector and build the matrix. 
> So i guess i don't know what the advantage is to me in using DA's because my 
> right hand side is ready to be used once i get to PETSc. 

I would advise you to be careful to keep your own program and start 
inserting vectors and copying your existing arrays into these vectors. 
It really pays off redeveloping (parts of) the code.

I agree, if you have each DA on one processor, then there is no need to 
use a DA. A DA would give you the flexibility of easily running the 
problem on more processors.

> So the most basic question (and maybe somebody else has an answer to that as 
> well) i have is what the advantage of the DA is as opposed to using a regular 
> vector when my right hand side is already given? Because when i solve the 
> linear system i believe PETSc will take care of the nonlocal communication 
> that has to be done during the solve for me, right? 

I don't think you have any use of a DA in your case. The communications 
for solving the matrix is taken care of. What you need to think about is 
how the blocks are connected and set-up IS and scatter for that 
communication; you will probably need the same addressing when you fill 
your matrix.

Good luck,

Berend.




More information about the petsc-users mailing list