Skip to content
Snippets Groups Projects
Commit 63f86177 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Dmitri Naumov
Browse files

[BL/MPI] Reduce ifdef range.

parent b2817c6b
No related branches found
No related tags found
No related merge requests found
......@@ -5,28 +5,28 @@
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#ifdef USE_PETSC
#include <mpi.h>
#endif
namespace BaseLib::MPI
{
#ifdef USE_PETSC
// Reduce operations for interprocess communications while using Petsc
static inline int reduceMin(int val)
static inline int reduceMin(int const val)
{
#ifdef USE_PETSC
// Reduce operations for interprocess communications while using Petsc
int result;
MPI_Allreduce(&val, &result, 1, MPI_INTEGER, MPI_MIN, PETSC_COMM_WORLD);
return result;
}
#else
// Reduce operations for interprocess communications without using Petsc
static inline int reduceMin(int val)
{
// Reduce operations for interprocess communications without using Petsc
return val;
}
#endif
}
} // namespace BaseLib::MPI
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment