A service managing communications within a cluster using MPI.
More...
#include <MPIClusterSvc.h>
A service managing communications within a cluster using MPI.
Definition at line 23 of file MPIClusterSvc.h.
◆ MPIClusterSvc()
MPIClusterSvc::MPIClusterSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svcLoc |
|
) |
| |
|
inline |
◆ abort()
void MPIClusterSvc::abort |
( |
| ) |
|
|
finaloverridevirtual |
◆ barrier()
void MPIClusterSvc::barrier |
( |
| ) |
|
|
finaloverridevirtual |
Insert a barrier No rank will continue until all ranks reach this point.
Definition at line 69 of file MPIClusterSvc.cxx.
◆ data_communicator()
virtual mpi3::communicator& MPIClusterSvc::data_communicator |
( |
| ) |
|
|
inlinefinaloverridevirtual |
◆ finalize()
StatusCode MPIClusterSvc::finalize |
( |
| ) |
|
|
finaloverridevirtual |
Finalize.
Definition at line 52 of file MPIClusterSvc.cxx.
55 "UPDATE ranks SET end_time = julianday('now') WHERE rank = ?1")
58 return StatusCode::SUCCESS;
◆ initialize()
StatusCode MPIClusterSvc::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Initialize.
Definition at line 8 of file MPIClusterSvc.cxx.
10 m_env = std::make_unique<mpi3::environment>(mpi3::thread_level::single);
20 m_mpiLog->createStatement(
"PRAGMA foreign_keys = ON").run();
24 "CREATE TABLE ranks (rank INTEGER PRIMARY KEY, "
25 "node TEXT, start_time FLOAT, end_time FLOAT)")
29 "INSERT INTO ranks (rank, node, start_time) "
30 "VALUES(?1, ?2, julianday('now'))")
34 "CREATE TABLE event_log (rank INTEGER, id INTEGER UNIQUE,"
35 "runNumber INTEGER, eventNumber INTEGER, complete INTEGER,"
36 "status INTEGER, request_time_ns INTEGER, start_time FLOAT,"
37 "end_time FLOAT, PRIMARY KEY (runNumber, eventNumber), "
38 "FOREIGN KEY (rank) REFERENCES ranks(rank))")
41 "INSERT INTO event_log(id, rank, runNumber, eventNumber, complete, "
42 "start_time, request_time_ns) "
43 "VALUES(?1, ?4, ?2, ?3, 0, julianday('now'), ?5)");
45 "UPDATE event_log SET complete = 1, status = ?3, end_time = "
46 "julianday('now') WHERE runNumber = ?1 "
49 return StatusCode::SUCCESS;
◆ log_addEvent()
void MPIClusterSvc::log_addEvent |
( |
int |
eventIdx, |
|
|
std::int64_t |
run_number, |
|
|
std::int64_t |
event_number, |
|
|
std::int64_t |
request_time_ns |
|
) |
| |
|
finaloverridevirtual |
◆ log_completeEvent()
void MPIClusterSvc::log_completeEvent |
( |
std::int64_t |
run_number, |
|
|
std::int64_t |
event_number, |
|
|
std::int64_t |
status |
|
) |
| |
|
finaloverridevirtual |
◆ numRanks()
int MPIClusterSvc::numRanks |
( |
| ) |
const |
|
finaloverridevirtual |
◆ rank()
int MPIClusterSvc::rank |
( |
| ) |
const |
|
finaloverridevirtual |
◆ sendMessage()
Send an MPI message.
Definition at line 78 of file MPIClusterSvc.cxx.
90 mpi3::communicator&
comm =
95 "Event data should be sent with EventData communicator. "
103 if (body.has_value()) {
104 comm.send_n(body->begin(), body->size(), destRank,
header[2]);
114 constexpr
int tag_offset = 16384;
◆ waitReceiveMessage()
Block until we receive an MPI message.
Definition at line 120 of file MPIClusterSvc.cxx.
122 constexpr
int tag_offset = 16384;
126 mpi3::communicator&
comm =
136 comm.receive_n(body->begin(), body->size(),
head[1],
head[2]);
143 char*
ptr =
static_cast<char*
>(std::aligned_alloc(align, len));
◆ m_datacom
mpi3::communicator MPIClusterSvc::m_datacom |
|
private |
◆ m_env
std::unique_ptr<mpi3::environment> MPIClusterSvc::m_env |
|
private |
◆ m_mpiLog
Initial value:{this, "LogDatabaseSvc", "",
"SQLiteDBSvc for the MPI event log"}
Definition at line 79 of file MPIClusterSvc.h.
◆ m_mpiLog_addEvent
◆ m_mpiLog_completeEvent
◆ m_rank
int MPIClusterSvc::m_rank = -1 |
|
private |
◆ m_world
mpi3::communicator MPIClusterSvc::m_world |
|
private |
The documentation for this class was generated from the following files: