PetscMPIInt rank;
MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
if (!rank) {
do something
}
If both cores do something there there is a mismatch with the mpiexec that
you are are running, it may not be the right mpiexec for the MPI includes and
library you are using.
Barry
On Apr 23, 2011, at 6:33 PM, Bart?omiej W wrote:
> Hello,
>
> I was wondering if anyone could help me to identify processes in parallel
> execution. I run my app with mpiexec -n 2 and would like to be able to pick a
> single core to perform a task and be the only one to print instead of having
> n cores repeat the same thing.
>
> PETSC_COMM_WORLD and PETSC_COMM_SELF both cause all processes to print for
> me, like there is no difference.
>
> Thank you
> Bartholomew