xref: /petsc/src/sys/tests/ex77.c (revision 8112c1cbf372cb53bf7c5aca994a84a6a303db4d)
1462c564dSBarry Smith static char help[] = "Tests MPIU_Allreduce() for mis-use.\n";
2462c564dSBarry Smith #include <petscsys.h>
3462c564dSBarry Smith 
main(int argc,char ** args)4462c564dSBarry Smith int main(int argc, char **args)
5462c564dSBarry Smith {
6462c564dSBarry Smith   PetscMPIInt rank;
7462c564dSBarry Smith   PetscBool   same = PETSC_FALSE;
8462c564dSBarry Smith 
9462c564dSBarry Smith   PetscFunctionBeginUser;
10c8025a54SPierre Jolivet   PetscCall(PetscInitialize(&argc, &args, NULL, help));
11462c564dSBarry Smith   PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD, &rank));
12*5440e5dcSBarry Smith   if (!rank) PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &same, 1, MPI_C_BOOL, MPI_LAND, PETSC_COMM_WORLD));
13*5440e5dcSBarry Smith   else PetscCallMPI(MPIU_Allreduce(MPI_IN_PLACE, &same, 1, MPI_C_BOOL, MPI_LAND, PETSC_COMM_WORLD));
14462c564dSBarry Smith   PetscCall(PetscFinalize());
15462c564dSBarry Smith   return 0;
16462c564dSBarry Smith }
17462c564dSBarry Smith 
18462c564dSBarry Smith /*TEST
19462c564dSBarry Smith 
20462c564dSBarry Smith    test:
210ef292d3SStefano Zampini      requires: defined(PETSC_USE_DEBUG) !defined(PETSCTEST_VALGRIND) !defined(PETSC_HAVE_SANITIZER)
22462c564dSBarry Smith      args: -petsc_ci_portable_error_output -error_output_stdout
23462c564dSBarry Smith      nsize: 2
24444bb3e7SJed Brown      filter: grep -E "(PETSC ERROR)" | grep -E "(Error Created|CreateError\(\)|main\(\))"
25462c564dSBarry Smith 
26462c564dSBarry Smith TEST*/
27