xref: /petsc/src/sys/tests/ex78.c (revision 6dd63270497ad23dcf16ae500a87ff2b2a0b7474)
1 static char help[] = "Tests MPIU_Allreduce() for overflow.\n";
2 #include <petscsys.h>
3 
4 int main(int argc, char **args)
5 {
6   PetscInt same = PETSC_INT_MAX;
7 
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 }
14 
15 /*TEST
16 
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\(\))"
23 
24 TEST*/
25