[petsc-users] Meaning of the order of PETSC_VIEWER_ASCII_INDEX format in PETSc

Matthew Knepley knepley at gmail.com
Wed Feb 7 13:16:46 CST 2018


On Wed, Feb 7, 2018 at 2:08 PM, Paula Sanematsu <paulasan at gmail.com> wrote:

> I am using PETSc 3.7.6 and Fortran.
>
> I am trying to output a PETSc vector that contains the solution of a
> linear system. I am using VecView with the PETSC_VIEWER_ASCII_INDEX format
> as follows:
>
> call PetscViewerASCIIOpen(PETSC_COMM_WORLD,"output.dat",viewer,ierr)
> call PetscViewerPushFormat(viewer,PETSC_VIEWER_ASCII_INDEX,ierr)
> call VecView(myVec,viewer,ierr)
>
>
> When I run with 4 processors, my output file looks like:
>
> Vec Object: 4 MPI processes
>   type: mpi
> Process [0]
> 0: 30.7501
> 1: 164.001
> 2: 41.0001
> 3: 164.001
> .
> .
> .
> Process [1]
> 4988: 60.1443
> 4989: 157.257
> 4990: 271.518
> 4991: 366.669
> .
> .
> .
> Process [2]
> 9977: 114.948
> 9978: -77.2896
> 9979: 823.142
> 9980: -1096.19
> .
> .
> .
> Process [3]
> 14916: 0.
> 14917: 4.4056
> 14918: 2.08151
> 14919: -0.110862
> .
> .
> .
> 19843: 0.
>
>
> My question is: each processor outputs the part of the vector that it
> owns? Or does PETSc collects each processor's parts and then processor 0
> sequentially outputs the 1st quarter of the global vector, processor 1
> outputs the 2nd quarter of the global vector, processor 2 outputs the 3rd
> quarter of the global vector, and so on? Or, does PETSc do something else?
>

There is no difference between those two. The process portions are
contiguous.

Where are you going to read this in? It seems like there must be a more
appropriate format for you.

  Thanks,

    Matt


> Thank you!
>
> Paula
>
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180207/3cfa37fd/attachment.html>


More information about the petsc-users mailing list