mptensor v0.6.0
Parallel Library for Tensor Network Methods
Loading...
Searching...
No Matches
mpi_helpers.hpp
Go to the documentation of this file.
1#ifndef MPTENSOR_TEST_MPI_HELPERS_HPP_
2#define MPTENSOR_TEST_MPI_HELPERS_HPP_
3
5
6#ifndef _NO_MPI
7#include <mpi.h>
8#endif
9
10namespace mptensor_test {
11
12#ifdef _NO_MPI
14inline double max_over_ranks(double local, int /* comm */) { return local; }
16inline int world_size() { return 1; }
17#else
19inline double max_over_ranks(double local, MPI_Comm comm) {
20 double global = 0.0;
22 return global;
23}
25inline int world_size() {
26 int size = 1;
28 return size;
29}
30#endif
31
32} // namespace mptensor_test
33
34#endif // MPTENSOR_TEST_MPI_HELPERS_HPP_
std::complex< double > complex
Definition complex.hpp:38
Top header file of mptensor.
Definition mpi_helpers.hpp:10
int world_size()
Number of processes in MPI_COMM_WORLD.
Definition mpi_helpers.hpp:25
double max_over_ranks(double local, MPI_Comm comm)
Maximum of local over all ranks of comm. Collective.
Definition mpi_helpers.hpp:19