Hi.<br><br>I had two questions<br><br>(1) <br><br>I was curious to know why the following happens with the PETSc standard output. Having created the executable &#39;test&#39; when I try to run it with mpiexec -n 2 ./test <br>
the same output is printed to the terminal twice. If I use 3 processors, then the same output is printed thrice.<br><br>In short the number of processors = number of times the output from PETSc is printed. Could this be a mistake with my PETSc installation???<br>
<br>For example, consider the code in src/ksp/ksp/examples/tutorials/ex23.c After creating ex23 the executable and running it with two processors gives the following terminal output:<br><br>gaurish108@gaurish108-laptop:~/Desktop/ResearchMeetings/SUPERPETS/petsc-3.1-p5/src/ksp/ksp/examples/tutorials$ mpiexec -n 1 ./ex23<br>
KSP Object:<br>  type: gmres<br>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br>    GMRES: happy breakdown tolerance 1e-30<br>  maximum iterations=10000, initial guess is zero<br>
  tolerances:  relative=1e-07, absolute=1e-50, divergence=10000<br>  left preconditioning<br>  using PRECONDITIONED norm type for convergence test<br>PC Object:<br>  type: jacobi<br>  linear system matrix = precond matrix:<br>
  Matrix Object:<br>    type=seqaij, rows=10, cols=10<br>    total: nonzeros=28, allocated nonzeros=50<br>      not using I-node routines<br>Norm of error &lt; 1.e-12, Iterations 5<br>gaurish108@gaurish108-laptop:~/Desktop/ResearchMeetings/SUPERPETS/petsc-3.1-p5/src/ksp/ksp/examples/tutorials$ mpiexec -n 2 ./ex23<br>
KSP Object:<br>  type: gmres<br>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br>    GMRES: happy breakdown tolerance 1e-30<br>  maximum iterations=10000, initial guess is zero<br>
  tolerances:  relative=1e-07, absolute=1e-50, divergence=10000<br>  left preconditioning<br>  using PRECONDITIONED norm type for convergence test<br>PC Object:<br>  type: jacobi<br>  linear system matrix = precond matrix:<br>
  Matrix Object:<br>    type=seqaij, rows=10, cols=10<br>    total: nonzeros=28, allocated nonzeros=50<br>      not using I-node routines<br>Norm of error &lt; 1.e-12, Iterations 5<br>KSP Object:<br>  type: gmres<br>    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br>
    GMRES: happy breakdown tolerance 1e-30<br>  maximum iterations=10000, initial guess is zero<br>  tolerances:  relative=1e-07, absolute=1e-50, divergence=10000<br>  left preconditioning<br>  using PRECONDITIONED norm type for convergence test<br>
PC Object:<br>  type: jacobi<br>  linear system matrix = precond matrix:<br>  Matrix Object:<br>    type=seqaij, rows=10, cols=10<br>    total: nonzeros=28, allocated nonzeros=50<br>      not using I-node routines<br>Norm of error &lt; 1.e-12, Iterations 5<br>
gaurish108@gaurish108-laptop:~/Desktop/ResearchMeetings/SUPERPETS/petsc-3.1-p5/src/ksp/ksp/examples/tutorials$ <br><br><br><br>(2) <br><br>Also I was told yesterday on the PETSC users mailing list that the MATLAB m file PetscBinaryWrite.m converts a sparse matrix in MATLAB into Petsc Binary format. <br>
    The following are the comments in the code near the heading saying that it works only for square sparse matrices . But it seems to be working quite well for rectangular sparse MATLAB matrices also. <br>I have tested this in conjunction with PetscBinaryRead.m also, which reads in a Petsc binary file into MATLAB as a sparse matrix.   <br>
<br>Is there something I might have missed or some error that I might be making???   <br><br>Comments in PetscBinaryWrite.m<br>&quot;-================================================<br>%  Writes in PETSc binary file sparse matrices and vectors<br>
%  if the array is multidimensional and dense it is saved<br>%  as a one dimensional array<br>%<br>%  Only works for square sparse matrices <br>%:<br>..<br>..<br>..<br>..<br>..<br>..<br>.<br>.<br>.<br><br><br><br> <br>