This is what I get on running mpiexec -n 2 ./ex23 -info<br><br>Also, using mpirun in place of mpiexec and using the -info option I get the exact same output you see below. <br>
<br>As far as the MPI implmentation I am using, I have OpenMPI and MPICH installed on my laptop. <br><br>While installing PETSc there were some external packages required. In the external packages folder I can see the following softwares:<br>
<br>fblaslapack-3.1.1 mpich2-1.0.8 ParMetis-dev-p3 SuperLU_DIST_2.4-hg-v2<br><br>Possibly it is this mpich2 that should be used?? <br>Please let me know what I should do. I am quite new to PETSc. <br><br>gaurish108@gaurish108-laptop:~/Desktop/ResearchMeetings/SUPERPETS/petsc-3.1-p5/src/ksp/ksp/examples/tutorials$ mpiexec -n 2 ./ex23 -info<br>
[0] PetscInitialize(): PETSc successfully started: number of processors = 1<br>[0] PetscGetHostName(): Rejecting domainname, likely is NIS gaurish108-laptop.(none)<br>[0] PetscInitialize(): Running on machine: gaurish108-laptop<br>
[0] PetscCommDuplicate(): Duplicating a communicator 1140850688 -2080374784 max tags = 2147483647<br>[0] PetscCommDuplicate(): returning tag 2147483647<br>[0] PetscCommDuplicate(): returning tag 2147483646<br>[0] PetscCommDuplicate(): returning tag 2147483645<br>
[0] PetscInitialize(): PETSc successfully started: number of processors = 1<br>[0] PetscGetHostName(): Rejecting domainname, likely is NIS gaurish108-laptop.(none)<br>[0] PetscInitialize(): Running on machine: gaurish108-laptop<br>
[0] PetscCommDuplicate(): Duplicating a communicator 1140850688 -2080374784 max tags = 2147483647<br>[0] PetscCommDuplicate(): returning tag 2147483647<br>[0] PetscCommDuplicate(): returning tag 2147483646<br>[0] PetscCommDuplicate(): returning tag 2147483645<br>
[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483644<br>[0] MatSetUpPreallocation(): Warning not preallocating matrix storage<br>[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 10 X 10; storage space: 22 unneeded,28 used<br>
[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 0<br>[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 3<br>[0] Mat_CheckInode(): Found 10 nodes out of 10 rows. Not using Inode routines<br>
[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483643<br>[0] PetscCommDuplicate(): returning tag 2147483642<br>[0] PetscCommDuplicate(): returning tag 2147483641<br>
[0] PetscCommDuplicate(): returning tag 2147483640<br>[0] PetscCommDuplicate(): returning tag 2147483639<br>[0] PetscCommDuplicate(): returning tag 2147483638<br>[0] PetscCommDuplicate(): returning tag 2147483637<br>
[0] PCSetUp(): Setting up new PC<br>[0] PetscCommDuplicate(): returning tag 2147483636<br>[0] PetscCommDuplicate(): returning tag 2147483635<br>[0] PetscCommDuplicate(): returning tag 2147483634<br>[0] PetscCommDuplicate(): returning tag 2147483633<br>
[0] PetscCommDuplicate(): returning tag 2147483632<br>[0] PetscCommDuplicate(): returning tag 2147483631<br>[0] PetscCommDuplicate(): returning tag 2147483630<br>[0] PetscCommDuplicate(): returning tag 2147483629<br>
[0] PetscCommDuplicate(): returning tag 2147483628<br>[0] PetscCommDuplicate(): returning tag 2147483627<br>[0] PetscCommDuplicate(): returning tag 2147483626<br>[0] KSPDefaultConverged(): Linear solver has converged. Residual norm 4.50879e-16 is less than relative tolerance 1e-07 times initial right hand side norm 0.707107 at iteration 5<br>
[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483625<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 < 1.e-12, Iterations 5<br>
[0] PetscFinalize(): PetscFinalize() called<br>[0] PetscCommDuplicate(): returning tag 2147483624<br>[0] Petsc_DelViewer(): Deleting viewer data in an MPI_Comm -2080374784<br>[0] Petsc_DelComm(): Deleting PETSc communicator imbedded in a user MPI_Comm 1140850688<br>
[0] PetscCommDestroy(): Deleting PETSc MPI_Comm -2080374784<br>[0] Petsc_DelCounter(): Deleting counter data in an MPI_Comm -2080374784<br>[0] Petsc_DelComm(): Deleting PETSc communicator imbedded in a user MPI_Comm -2080374784<br>
[0] Petsc_DelViewer(): Deleting viewer data in an MPI_Comm -2080374784<br>[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483644<br>[0] MatSetUpPreallocation(): Warning not preallocating matrix storage<br>
[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 10 X 10; storage space: 22 unneeded,28 used<br>[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 0<br>[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 3<br>
[0] Mat_CheckInode(): Found 10 nodes out of 10 rows. Not using Inode routines<br>[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483643<br>
[0] PetscCommDuplicate(): returning tag 2147483642<br>[0] PetscCommDuplicate(): returning tag 2147483641<br>[0] PetscCommDuplicate(): returning tag 2147483640<br>[0] PetscCommDuplicate(): returning tag 2147483639<br>
[0] PetscCommDuplicate(): returning tag 2147483638<br>[0] PetscCommDuplicate(): returning tag 2147483637<br>[0] PCSetUp(): Setting up new PC<br>[0] PetscCommDuplicate(): returning tag 2147483636<br>[0] PetscCommDuplicate(): returning tag 2147483635<br>
[0] PetscCommDuplicate(): returning tag 2147483634<br>[0] PetscCommDuplicate(): returning tag 2147483633<br>[0] PetscCommDuplicate(): returning tag 2147483632<br>[0] PetscCommDuplicate(): returning tag 2147483631<br>
[0] PetscCommDuplicate(): returning tag 2147483630<br>[0] PetscCommDuplicate(): returning tag 2147483629<br>[0] PetscCommDuplicate(): returning tag 2147483628<br>[0] PetscCommDuplicate(): returning tag 2147483627<br>
[0] PetscCommDuplicate(): returning tag 2147483626<br>[0] KSPDefaultConverged(): Linear solver has converged. Residual norm 4.50879e-16 is less than relative tolerance 1e-07 times initial right hand side norm 0.707107 at iteration 5<br>
[0] PetscCommDuplicate(): Using internal PETSc communicator 1140850688 -2080374784<br>[0] PetscCommDuplicate(): returning tag 2147483625<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 < 1.e-12, Iterations 5<br>
[0] PetscFinalize(): PetscFinalize() called<br>[0] PetscCommDuplicate(): returning tag 2147483624<br>[0] Petsc_DelViewer(): Deleting viewer data in an MPI_Comm -2080374784<br>[0] Petsc_DelComm(): Deleting PETSc communicator imbedded in a user MPI_Comm 1140850688<br>
[0] PetscCommDestroy(): Deleting PETSc MPI_Comm -2080374784<br>[0] Petsc_DelCounter(): Deleting counter data in an MPI_Comm -2080374784<br>[0] Petsc_DelComm(): Deleting PETSc communicator imbedded in a user MPI_Comm -2080374784<br>
[0] Petsc_DelViewer(): Deleting viewer data in an MPI_Comm -2080374784<br>gaurish108@gaurish108-laptop:~/Desktop/ResearchMeetings/SUPERPETS/petsc-3.1-p5/src/ksp/ksp/examples/tutorials$ <br><br><div class="gmail_quote">On Mon, Jan 17, 2011 at 5:46 PM, Gaurish Telang <span dir="ltr"><<a href="mailto:gaurish108@gmail.com">gaurish108@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">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 'test' 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 < 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 < 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 < 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>"-================================================<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>
</blockquote></div><br>