forked from LLNL/Caliper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cali-mpi.h
90 lines (75 loc) · 2.46 KB
/
cali-mpi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* Copyright (c) 2019, Lawrence Livermore National Security, LLC.
* See top-level LICENSE file for details.
*/
/**
* \file cali-mpi.h
* \brief Miscellaneous MPI-dependent functionality
*/
#pragma once
#include <mpi.h>
#ifdef __cplusplus
namespace cali
{
class Aggregator;
class Caliper;
class Channel;
class CaliperMetadataDB;
class OutputStream;
class QuerySpec;
class SnapshotRecord;
/**
* \brief Perform cross-process aggregation over MPI
*
* Aggregates snapshot records across MPI communicator \a comm. Each
* rank provides a local aggregation database and configuration
* (aggregation operators and aggregation key) in Aggregator \a a. The
* aggregation configuration should be identical on each process.
* When the operation completes, the result will be in Aggregator \a a
* on rank 0 of \a comm.
*
* This function is effectively a blocking collective operation over
* \a comm with the usual MPI collective semantics.
*
* \param db Metadata information for \a a. The metadata database
* may be modified during the operation.
* \param a Provides the aggregation configuration and local input
* records, and receives the result on rank 0. Other ranks may
* receive partial results.
* \param comm MPI communicator.
*
* \ingroup ReaderAPI
*/
void
aggregate_over_mpi(CaliperMetadataDB& db, Aggregator& a, MPI_Comm comm);
void
collective_flush(OutputStream& stream,
Caliper& c,
Channel& channel,
const SnapshotRecord* flush_info,
const QuerySpec& local_query,
const QuerySpec& cross_query,
MPI_Comm comm);
} /* namespace cali */
extern "C" {
#endif
/*
* C definitions
*/
/**
* \brief Initialize caliper-mpi library.
* Must run before Caliper initialization.
*
* Normally, the Caliper mpi library is initialized through a dynamic
* library constructor in libcaliper-mpi.so, and it is not necessary to call
* cali_mpi_init(). However, certain linker optimizations or static linking
* can prevent a library from being linked if a library constructor is
* the only entry point. In this case, call cali_mpi_init() from the target
* application before initializing Caliper. It ensures that the Caliper mpi
* runtime library (libcaliper-mpi) is correctly linked to the application,
* and makes the mpi-specific services visible to the Caliper initializer.
*/
void
cali_mpi_init();
#ifdef __cplusplus
} /* extern "C" */
#endif