Date: 2013-07-02T14:39:24+00:00

Actual source code: ex11.c
petsc-3.4.2 2013-07-02

      2: static char help[] = "Tests PetscSynchronizedPrintf() and PetscSynchronizedFPrintf().\n\n";

      4: #include <petscsys.h>

      8: int main(int argc,char **argv)
      9: {
     10:   PetscMPIInt    rank;

     13:   PetscInitialize(&argc,&argv,(char*)0,help);
     14:   MPI_Comm_rank(PETSC_COMM_WORLD,&rank);

     16:   PetscSynchronizedPrintf(PETSC_COMM_WORLD,"Greetings from %d\n",rank);
     17:   PetscSynchronizedFlush(PETSC_COMM_WORLD);

     19:   PetscSynchronizedFPrintf(PETSC_COMM_WORLD,stderr,"Greetings again from %d\n",rank);
     20:   PetscSynchronizedFlush(PETSC_COMM_WORLD);

     22:   PetscFinalize();
     23:   return 0;
     24: }