Well, to make sure about the results, I again just copy the example and add two lines before the Destroy code, then ,compile. Example: http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex11.c.html Run it with mpirun -np 2 ./Release/spin-scenarios-petsc -n 2 This is the results: 1+1i 1+1i 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 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)
I am not sure about it, but the results is the same as I tried before with c++ class. By the way, I install PETSc using --with-mpi-dir=/usr/local --with-scalar-type=complex --with-clanguage=cxx --with-fortran-kernels=1 --with-blas-lapack-dir=/opt/intel/composer_xe_2013_sp1.0.080/mkl --with-debugging=no Isn’t it strange? Or can you run it again to make sure about it? On Sun, Jan 19, 2014 at 9:11 PM, Karl Rupp <[email protected]> wrote: > 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 >
