OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
mpi.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 VTT Technical Research Centre of Finland Ltd
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
41#ifndef PFC_MPI_HPP
42#define PFC_MPI_HPP
43
44#include "mpi/communicator.hpp"
45#include "mpi/environment.hpp"
46#include "mpi/timer.hpp"
47#include "mpi/worker.hpp"
48#include <mpi.h>
49
50namespace pfc {
51namespace mpi {
52
53inline int get_rank() {
54 int rank;
55 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
56 return rank;
57}
58
59inline int get_size() {
60 int size;
61 MPI_Comm_size(MPI_COMM_WORLD, &size);
62 return size;
63}
64
65} // namespace mpi
66} // namespace pfc
67
68#endif // PFC_MPI_HPP
MPI communicator wrapper class.
RAII wrapper for MPI initialization and finalization.
MPI-based wall-clock timer.
MPI worker process management.