OGS
MPI.h
Go to the documentation of this file.
1
11#pragma once
12
13namespace BaseLib::MPI
14{
15
16#ifdef USE_PETSC
17// Reduce operations for interprocess communications while using Petsc
18static inline int reduceMin(int val)
19{
20 int result;
21 MPI_Allreduce(&val, &result, 1, MPI_INTEGER, MPI_MIN, PETSC_COMM_WORLD);
22 return result;
23}
24#else
25// Reduce operations for interprocess communications without using Petsc
26static inline int reduceMin(int val)
27{
28 return val;
29}
30#endif
31
32} // namespace BaseLib::MPI
static int reduceMin(int val)
Definition MPI.h:18