On Tue, Dec 13, 2011 at 11:24 AM, Matthew Knepley <knepley at gmail.com> wrote: > On Tue, Dec 13, 2011 at 10:19 AM, Xiangdong Liang <xdliang at gmail.com> > wrote: >> >> On Tue, Dec 13, 2011 at 11:14 AM, Matthew Knepley <knepley at gmail.com> >> wrote: >> > On Tue, Dec 13, 2011 at 10:13 AM, Xiangdong Liang <xdliang at gmail.com> >> > wrote: >> >> >> >> Hello everyone, >> >> >> >> I am using PetscPrintf(PETSC_COMM_WORLD,.....) to print out some >> >> information. When I run the program on multiple processors, some of >> >> these calls are printed out multiple times, while other calls are >> >> printed out once. Should it be printed only once if I use >> >> PETSC_COMM_WORLD? Thanks. >> > >> > >> > The print is executed only on rank 0 of the communicator provided. >> >> I agree. This implies that the message can be printed out at most >> once. Do you have any hints why I saw the message printed out multiple >> times? Thanks. > > > Maybe > > 1) You have a bug in your code > > 2) You ran with the wrong mpiexec, so it just ran 2 copies
You're right. I use the wrong mpiexec. When I compile petsc-dev, I use download-mpich while the default mpiexec in our system is openmpi. If I use $PETSC_DIR/bin/petscmpiexec, the problem is fixed. Thanks, Matt and Satish. Xiangdong > > ? Matt > >> >> Xiangdong >> >> >> > >> > ? ?Matt >> > >> >> >> >> >> >> Xiangdong >> >> >> >> PS. I am using petsc-dev. My code works fine on real petsc-3.1-p8. I >> >> just switched to complex petsc-dev and see this problem. >> > >> > >> > >> > >> > -- >> > What most experimenters take for granted before they begin their >> > experiments >> > is infinitely more interesting than any results to which their >> > experiments >> > lead. >> > -- Norbert Wiener > > > > > -- > What most experimenters take for granted before they begin their experiments > is infinitely more interesting than any results to which their experiments > lead. > -- Norbert Wiener