| helics 3.6.1

MpiCore.h
1 /*
2 Copyright (c) 2017-2025,
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
8 #pragma once
9
10 #include "../../core/CommonCore.hpp"
11 #include "../CommsBroker.hpp"
12
13 #include <memory>
14 #include <string>
15
16 namespace helics {
17 namespace mpi {
18 class MpiComms;
20 class MpiCore final: public CommsBroker<MpiComms, CommonCore> {
21 public:
23 MpiCore() noexcept;
24 explicit MpiCore(std::string_view core_name);
25 ~MpiCore();
26
27 protected:
28 virtual std::shared_ptr<helicsCLI11App> generateCLI() override;
29
30 public:
31 virtual std::string generateLocalAddressString() const override;
32
33 private:
34 mutable std::mutex dataMutex;
35 std::string brokerAddress;
36 int brokerRank{0};
37 int brokerTag{0};
38 virtual bool brokerConnect() override;
39 };
40
41 } // namespace mpi
42 } // namespace helics
helics::CommsBroker
Definition: CommsBroker.hpp:21
helics::mpi::MpiCore
Definition: MpiCore.h:20
helics::mpi::MpiCore::generateLocalAddressString
virtual std::string generateLocalAddressString() const override
Definition: MpiCore.cpp:69
helics::mpi::MpiCore::MpiCore
MpiCore() noexcept
Definition: MpiCore.cpp:18
helics::mpi::MpiCore::generateCLI
virtual std::shared_ptr< helicsCLI11App > generateCLI() override
Definition: MpiCore.cpp:26
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14