xref: /petsc/src/sys/tests/ex77.c (revision 462c564db5c15796f1f07c2b71ff29812cdd1aad)
1*462c564dSBarry Smith static char help[] = "Tests MPIU_Allreduce() for mis-use.\n";
2*462c564dSBarry Smith #include <petscsys.h>
3*462c564dSBarry Smith 
4*462c564dSBarry Smith int main(int argc, char **args)
5*462c564dSBarry Smith {
6*462c564dSBarry Smith   PetscMPIInt rank;
7*462c564dSBarry Smith   PetscBool   same = PETSC_FALSE;
8*462c564dSBarry Smith 
9*462c564dSBarry Smith   PetscFunctionBeginUser;
10*462c564dSBarry Smith   PetscCall(PetscInitialize(&argc, &args, (char *)0, help));
11*462c564dSBarry Smith   PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD, &rank));
12*462c564dSBarry Smith   if (!rank) PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &same, 1, MPIU_BOOL, MPI_LAND, PETSC_COMM_WORLD));
13*462c564dSBarry Smith   else PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &same, 1, MPIU_BOOL, MPI_LAND, PETSC_COMM_WORLD));
14*462c564dSBarry Smith   PetscCall(PetscFinalize());
15*462c564dSBarry Smith   return 0;
16*462c564dSBarry Smith }
17*462c564dSBarry Smith 
18*462c564dSBarry Smith /*TEST
19*462c564dSBarry Smith 
20*462c564dSBarry Smith    test:
21*462c564dSBarry Smith      requires: defined(PETSC_USE_DEBUG) !defined(PETSCTEST_VALGRIND)
22*462c564dSBarry Smith      args: -petsc_ci_portable_error_output -error_output_stdout
23*462c564dSBarry Smith      nsize: 2
24*462c564dSBarry Smith      filter: grep -E "(PETSC ERROR)" | egrep "(Error Created|CreateError\(\)|main\(\))"
25*462c564dSBarry Smith 
26*462c564dSBarry Smith TEST*/
27