DAVec and MPI Gather

Matthew Knepley knepley at gmail.com
Mon Jul 23 09:42:52 CDT 2007


On 7/23/07, Olivier Saut <saut.olivier at wanadoo.fr> wrote:
> Hi all,
>
> something is not very clear for me.
> I use a DA to solve a diffusion equation on several processors.
>
> The global vector containing the solution is created with
> DACreateGlobalVector(da,&Sol);
> VecDuplicate(Sol, sMemb); // RHS vector
>
> // Local part of the matrix and RHS vector are computed
>
> KSPSolve(ksp, sMemb, Sol);
>
>
> At this stage, Sol is supposed to contained the solution.
>
> Now for vizualisation, I need to get acces all the values of Sol.
> As far as I understand, DAVecGetArray only gives acces to the local
> values of Sol.
> Should I use MPI Gather to obtain the values from the other processors?

Collecting the values on a single process is fundamentally unscalable and seems
to defeat the purpose of computing in parallel. However, there is a method to
do it:

http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecScatterCreateToZero.html

   Matt

> Thanks a lot,
>
>                   - Olivier
-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list