| helics 3.6.1

MpiBroker.h
1 /*
2 Copyright (c) 2017-2019,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-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
15 namespace helics {
16 namespace 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
helics::CommsBroker
Definition: CommsBroker.hpp:21
helics::mpi::MpiBroker
Definition: MpiBroker.h:19
helics::mpi::MpiBroker::generateLocalAddressString
virtual std::string generateLocalAddressString() const override
Definition: MpiBroker.cpp:73
helics::mpi::MpiBroker::~MpiBroker
virtual ~MpiBroker()
Definition: MpiBroker.cpp:24
helics::mpi::MpiBroker::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: MpiBroker.cpp:29
helics::mpi::MpiBroker::MpiBroker
MpiBroker(bool rootBroker=false) noexcept
Definition: MpiBroker.cpp:19
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14