[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DAVec and MPI Gather



On 7/23/07, Olivier Saut <saut.olivier@xxxxxxxxxx> 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