SST  14.0.0
StructuralSimulationToolkit
rankSyncSerialSkip.h
1 // Copyright 2009-2024 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2024, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_SYNC_RANKSYNCSERIALSKIP_H
13 #define SST_CORE_SYNC_RANKSYNCSERIALSKIP_H
14 
15 #include "sst/core/sst_types.h"
16 #include "sst/core/sync/syncManager.h"
17 #include "sst/core/threadsafe.h"
18 
19 #include <map>
20 
21 namespace SST {
22 
23 class SyncQueue;
24 class TimeConverter;
25 
27 {
28 public:
29  /** Create a new Sync object which fires with a specified period */
30  RankSyncSerialSkip(RankInfo num_ranks, TimeConverter* minPartTC);
31  RankSyncSerialSkip() {} // For serialization
32  virtual ~RankSyncSerialSkip();
33 
34  /** Register a Link which this Sync Object is responsible for */
36  registerLink(const RankInfo& to_rank, const RankInfo& from_rank, const std::string& name, Link* link) override;
37  void execute(int thread) override;
38 
39  /** Cause an exchange of Untimed Data to occur */
40  void exchangeLinkUntimedData(int thread, std::atomic<int>& msg_count) override;
41  /** Finish link configuration */
42  void finalizeLinkConfigurations() override;
43  /** Prepare for the complete() stage */
44  void prepareForComplete() override;
45 
46  SimTime_t getNextSyncTime() override { return myNextSyncTime; }
47 
48  uint64_t getDataSize() const override;
49 
50  void serialize_order(SST::Core::Serialization::serializer& ser) override;
51  ImplementSerializable(SST::RankSyncSerialSkip)
52 
53 private:
54  static SimTime_t myNextSyncTime;
55 
56  // Function that actually does the exchange during run
57  void exchange();
58 
60  {
61  SyncQueue* squeue; // SyncQueue
62  char* rbuf; // receive buffer
63  uint32_t local_size;
64  uint32_t remote_size;
65 
66  void serialize_order(SST::Core::Serialization::serializer& UNUSED(ser)) override {}
67  ImplementSerializable(comm_pair)
68  };
69 
70  typedef std::map<int, comm_pair> comm_map_t;
71  typedef std::map<std::string, uintptr_t> link_map_t;
72 
73  // TimeConverter* period;
74  comm_map_t comm_map;
75  link_map_t link_map;
76 
77  double mpiWaitTime;
78  double deserializeTime;
79 
81 };
82 
83 } // namespace SST
84 
85 #endif // SST_CORE_SYNC_RANKSYNCSERIALSKIP_H
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
A class to convert between a component&#39;s view of time and the core&#39;s view of time.
Definition: timeConverter.h:27
Definition: syncManager.h:37
Definition: action.cc:18
void exchangeLinkUntimedData(int thread, std::atomic< int > &msg_count) override
Cause an exchange of Untimed Data to occur.
Definition: rankSyncSerialSkip.cc:246
Definition: serializable.h:118
void prepareForComplete() override
Prepare for the complete() stage.
Definition: rankSyncSerialSkip.cc:105
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: rankSyncSerialSkip.cc:101
ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, const std::string &name, Link *link) override
Register a Link which this Sync Object is responsible for.
Definition: rankSyncSerialSkip.cc:77
Definition: rankInfo.h:21
Definition: threadsafe.h:121
Internal API.
Definition: syncQueue.h:29
Definition: rankSyncSerialSkip.h:59
Base Class for a queue of Activities.
Definition: activityQueue.h:21
Definition: rankSyncSerialSkip.h:26