[petsc-users] general problem with application based on PETSc

Karl Rupp rupp at mcs.anl.gov
Sun Jan 19 07:11:12 CST 2014


Hi Yan,

 > Right now I test  'src/ksp/ksp/examples/tutorials/ex11.c'  with n=2
> I rewrite the sample into a c++ class, and run it as mpirun -np 2  .....
> I notice that the vector x is stored in 2 processors.
> But the matrix A seems not as you told me 'MatView should report your
> matrix R as being equally split over the MPI ranks.'
>
> Norm of error 1.19381e-16 iterations 4
> Vector Object: 2 MPI processes
>    type: mpi
> Process [0]
> 4.16334e-17
> 0 + 1.38778e-17 i
> Process [1]
> 0
> 1.11022e-16

This looks good.

> Matrix Object: 1 MPI processes
>    type: mpiaij
> row 0: (0, -7.11111 + 0.0800036 i) (1, -1)  (2, -1)
> row 1: (0, -1)  (1, -7.11111 + 0.00111359 i) (3, -1)
> row 2: (0, -1)  (2, -7.11111 + 0.0601271 i) (3, -1)
> row 3: (1, -1)  (2, -1)  (3, -7.11111 + 0.0943018 i)

This doesn't. How to do you create the matrix and set its sizes?

Best regards,
Karli


More information about the petsc-users mailing list