Actual source code: ex78.c

  1: static char help[] = "Tests MPIU_Allreduce() for overflow.\n";
  2: #include <petscsys.h>

  4: int main(int argc, char **args)
  5: {
  6:   PetscInt same = PETSC_INT_MAX;

  8:   PetscFunctionBeginUser;
  9:   PetscCall(PetscInitialize(&argc, &args, NULL, help));
 10:   PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &same, 1, MPIU_INT, MPI_SUM, PETSC_COMM_WORLD));
 11:   PetscCall(PetscFinalize());
 12:   return 0;
 13: }

 15: /*TEST

 17:    test:
 18:      TODO: Cannot run CI test in parallel to produce clean output
 19:      requires: !defined(PETSC_USE_64_BIT_INDICES)
 20:      nsize: 2
 21:      args: -petsc_ci_portable_error_output -error_output_stdout
 22:      filter: grep -E "(PETSC ERROR)" | egrep "(Error Created|CreateError\(\)|main\(\))"

 24: TEST*/