← Documentation
ADS-IDAC Engine 5.0.0
ParallelUtilities.h
Go to the documentation of this file.
1
4
5#ifndef PARALLELUTILITIES_H
6#define PARALLELUTILITIES_H
7
8#ifdef ENABLE_MPI
9#include <cstdint>
10#include <termcolor/termcolor.hpp>
11#include <vector>
12#include "ParallelGlobal.h"
13#include <mpi.h>
14#include <boost/archive/binary_iarchive.hpp>
15#include <boost/archive/binary_oarchive.hpp>
16
19class ParallelUtilities {
20public:
22 static std::ostream& get_random_color(std::ostream& stream, int rank);
23
28 static void print_message(int rank, const std::string& message, bool log);
29
30 static void execute_relap();
31 static void parallel_restartforanewsequence_();
32
39 template <typename T>
40 static void send_object(const T& obj, int dest_rank, int tag, MPI_Comm comm);
41
48 template <typename T>
49 static void receive_object(T& obj, int src_rank, int tag, MPI_Comm comm);
50
57 template <typename T>
58 static std::string serialize_object(const T& obj);
59
63 static void send_bytes(const std::string& bytes, int dest_rank, int tag, MPI_Comm comm);
64};
65
66#endif // ENABLE_MPI
67#endif //PARALLELUTILITIES_H
Shared declarations for MPI parallel execution: message tags, utilities, Fortran callbacks.
bool log
Enable/disable rank-specific logging.
int rank
MPI rank of this process.