mptensor v0.4.0
Parallel Library for Tensor Network Methods
Loading...
Searching...
No Matches
mpi.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
31#ifndef _MPTENSOR_MPI_HPP_
32#define _MPTENSOR_MPI_HPP_
33
34#ifndef _NO_MPI
35#include <mpi.h>
36#endif
37
38namespace mptensor {
39namespace mpi {
40
41#ifdef _NO_MPI
42using comm_type = int;
43#else
45#endif
46
47extern int rank;
48extern int size;
49extern bool is_root;
50
51void initialize(int argc, char **argv);
52void finalize();
53void barrier(const comm_type &comm);
54void get_info(const comm_type &comm, int &rank, int &size, bool &is_root);
55
56} // namespace mpi
57} // namespace mptensor
58
59#ifdef _NO_MPI
61#endif
62
63#endif // _MPTENSOR_MPI_HPP_
std::complex< double > complex
Definition complex.hpp:38
mptensor::complex complex
Definition matrix_lapack.cc:36
void initialize(int argc, char **argv)
Definition mpi.cc:64
void finalize()
Definition mpi.cc:74
MPI_Comm comm_type
Definition mpi.hpp:44
int size
Definition mpi.cc:61
void get_info(const comm_type &comm, int &rank, int &size, bool &is_root)
Definition mpi.cc:86
int rank
Definition mpi.cc:60
void barrier(const comm_type &comm)
Definition mpi.cc:82
bool is_root
Definition mpi.cc:62
Definition complex.hpp:34