pomerol  2.1
misc.hpp
Go to the documentation of this file.
1 //
2 // This file is part of pomerol, an exact diagonalization library aimed at
3 // solving condensed matter models of interacting fermions.
4 //
5 // Copyright (C) 2016-2024 A. Antipov, I. Krivenko and contributors
6 //
7 // This Source Code Form is subject to the terms of the Mozilla Public
8 // License, v. 2.0. If a copy of the MPL was not distributed with this
9 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
14 
15 #ifndef POMEROL_INCLUDE_MPI_DISPATCHER_MISC_HPP
16 #define POMEROL_INCLUDE_MPI_DISPATCHER_MISC_HPP
17 
18 #include <mpi.h>
19 
21 namespace pMPI {
22 
25 
28 inline int size(MPI_Comm const& Comm) {
29  int s;
30  MPI_Comm_size(Comm, &s);
31  return s;
32 }
33 
36 inline int rank(MPI_Comm const& Comm) {
37  int r;
38  MPI_Comm_rank(Comm, &r);
39  return r;
40 }
41 
43 
44 } // namespace pMPI
45 
46 #endif // #ifndef POMEROL_INCLUDE_MPI_DISPATCHER_MISC_HPP
pMPI::rank
int rank(MPI_Comm const &Comm)
Definition: misc.hpp:36
pMPI::size
int size(MPI_Comm const &Comm)
Definition: misc.hpp:28
pMPI
A bunch of tools used for MPI-parallelization of computations.
Definition: misc.hpp:21