mptensor  v0.3.0
Parallel Library for Tensor Network Methods
mpi_tool.hpp
Go to the documentation of this file.
1 /*
2  mptensor - Parallel Library for Tensor Network Methods
3 
4  Copyright 2016 Satoshi Morita
5 
6  mptensor is free software: you can redistribute it and/or modify it
7  under the terms of the GNU Lesser General Public License as
8  published by the Free Software Foundation, either version 3 of the
9  License, or (at your option) any later version.
10 
11  mptensor is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with mptensor. If not, see
18  <https://www.gnu.org/licenses/>.
19 */
20 
28 #ifndef _MPI_TOOL_HPP_
29 #define _MPI_TOOL_HPP_
30 
31 #ifdef _NO_MPI
32 typedef int mpi_comm;
33 extern const mpi_comm MPI_COMM_WORLD;
34 
35 #else
36 #include <mpi.h>
37 typedef MPI_Comm mpi_comm;
38 
39 #endif
40 
41 void mpi_finalize();
42 void mpi_init(int argc, char **argv);
43 void mpi_info(const mpi_comm &comm, int &rank, int &size, bool &is_root);
44 void mpi_barrier(const mpi_comm &comm);
45 double mpi_reduce_max(double send, const mpi_comm &comm);
46 
47 #endif // _MPI_TOOL_HPP_
void mpi_barrier(const mpi_comm &comm)
Definition: mpi_tool.cc:67
void mpi_info(const mpi_comm &comm, int &rank, int &size, bool &is_root)
Definition: mpi_tool.cc:61
void mpi_init(int argc, char **argv)
Definition: mpi_tool.cc:56
MPI_Comm mpi_comm
Definition: mpi_tool.hpp:37
double mpi_reduce_max(double send, const mpi_comm &comm)
Definition: mpi_tool.cc:69
void mpi_finalize()
Definition: mpi_tool.cc:48