Fenix @develop
 
Loading...
Searching...
No Matches
message_logging.h
1#ifndef MESSAGE_LOGGING_H
2#define MESSAGE_LOGGING_H
3#include <istream>
4#include <ostream>
5#include <cassert>
6
7#include <mpi.h>
8#include "fenix_ext.hpp"
9#include "fenix/logging/comm_log.h"
10
11#define CONSISTENCY_TAG 22234652
12#define COLLECTIVE_CONSISTENCY_TAG 22234653
13
14namespace fenix::mlog {
15using namespace fenix::logging;
16}
17namespace fenix::logging {
18using namespace fenix::mlog;
19}
20
21namespace fenix::mlog::impl {
22
23// Search for the specified log, returning an empty ptr if not found
24std::shared_ptr<CommLog> search_mlog(int id);
25// As search_log, but throws if log not found
26std::shared_ptr<CommLog> find_mlog(
27 int id, std::source_location loc = std::source_location::current()
28);
29
30// Small helper
31inline bool is_logging(MPI_Comm c) {
32 return fenix_rt.active_mlog && fenix_rt.active_mlog->comm == c;
33}
34
35} //namespace fenix::mlog::impl
36
37#endif