helics 3.7.0
Loading...
Searching...
No Matches
MpiBroker.h
1/*
2Copyright (c) 2017-2019,
3Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Energy
4Innovation LLC. See the top-level NOTICE for additional details. All rights reserved.
5SPDX-License-Identifier: BSD-3-Clause
6*/
7#pragma once
8
9#include "../../core/CoreBroker.hpp"
10#include "../CommsBroker.hpp"
11
12#include <memory>
13#include <string>
14
15namespace helics {
16namespace mpi {
17 class MpiComms;
19 class MpiBroker final: public CommsBroker<MpiComms, CoreBroker> {
20 public:
22 explicit MpiBroker(bool rootBroker = false) noexcept;
23 explicit MpiBroker(std::string_view broker_name);
24
25 protected:
26 virtual std::shared_ptr<helicsCLI11App> generateCLI() override;
27
28 public:
30 virtual ~MpiBroker();
31
32 virtual std::string generateLocalAddressString() const override;
33 static void displayHelp(bool local_only = false);
34
35 private:
36 virtual bool brokerConnect() override;
37 mutable std::mutex dataMutex;
38 std::string brokerAddress;
39 int brokerRank{0};
40 int brokerTag{0};
41 };
42} // namespace mpi
43} // namespace helics
Definition CommsBroker.hpp:21
Definition MpiBroker.h:19
virtual std::string generateLocalAddressString() const override
Definition MpiBroker.cpp:73
virtual ~MpiBroker()
Definition MpiBroker.cpp:24
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition MpiBroker.cpp:29
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition AsyncFedCallInfo.hpp:14