Actual source code: ex7.c

  1: /*$Id: ex7.c,v 1.15 2001/04/10 19:34:46 bsmith Exp $*/

  3: /*
  4:      Formatted test for PetscSetCommWorld()
  5: */

  7: static char help[] = "Tests PetscSetCommWorld().\n\n";

 9:  #include petsc.h

 13: int main(int argc,char **argv)
 14: {
 15:   int size,ierr;

 17:   MPI_Init(&argc,&argv);

 19:   /*
 20:     Create a seperate PETSc universe for each processor
 21:   */
 22:   PetscSetCommWorld(MPI_COMM_SELF);
 23:   PetscInitialize(&argc,&argv,PETSC_NULL,help);
 24: 
 25:   MPI_Comm_size(PETSC_COMM_WORLD,&size);
 26:   if (size != 1) SETERRQ(1,"main:Error from PetscSetCommWorld()");

 28:   PetscFinalize();
 29:   MPI_Finalize();
 30:   return 0;
 31: }