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

Paula Sanematsu paulasan at gmail.com
Wed Feb 7 13:08:46 CST 2018


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?

Thank you!

Paula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180207/47471d46/attachment.html>


More information about the petsc-users mailing list