SST  9.0.0
StructuralSimulationToolkit
rankSyncSerialSkip.h
1 // Copyright 2009-2019 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-2019, 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_RANKSYNCSERIALSKIP_H
13 #define SST_CORE_RANKSYNCSERIALSKIP_H
14 
15 #include "sst/core/sst_types.h"
16 #include <sst/core/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 public:
28  /** Create a new Sync object which fires with a specified period */
30  virtual ~RankSyncSerialSkip();
31 
32  /** Register a Link which this Sync Object is responsible for */
33  ActivityQueue* registerLink(const RankInfo& to_rank, const RankInfo& from_rank, LinkId_t link_id, Link* link) override;
34  void execute(int thread) override;
35 
36  /** Cause an exchange of Untimed Data to occur */
37  void exchangeLinkUntimedData(int thread, std::atomic<int>& msg_count) override;
38  /** Finish link configuration */
39  void finalizeLinkConfigurations() override;
40  /** Prepare for the complete() stage */
41  void prepareForComplete() override;
42 
43  SimTime_t getNextSyncTime() override { return myNextSyncTime; }
44 
45  uint64_t getDataSize() const override;
46 
47 private:
48 
49  static SimTime_t myNextSyncTime;
50 
51  // Function that actually does the exchange during run
52  void exchange();
53 
54  struct comm_pair {
55  SyncQueue* squeue; // SyncQueue
56  char* rbuf; // receive buffer
57  uint32_t local_size;
58  uint32_t remote_size;
59  };
60 
61  typedef std::map<int, comm_pair > comm_map_t;
62  typedef std::map<LinkId_t, Link*> link_map_t;
63 
64  // TimeConverter* period;
65  comm_map_t comm_map;
66  link_map_t link_map;
67 
68  double mpiWaitTime;
69  double deserializeTime;
70 
71 };
72 
73 } // namespace SST
74 
75 #endif // SST_CORE_SYNCMANAGER_H
A class to convert between a component&#39;s view of time and the core&#39;s view of time.
Definition: timeConverter.h:25
Definition: syncManager.h:33
void exchangeLinkUntimedData(int thread, std::atomic< int > &msg_count) override
Cause an exchange of Untimed Data to occur.
Definition: rankSyncSerialSkip.cc:242
void prepareForComplete() override
Prepare for the complete() stage.
Definition: rankSyncSerialSkip.cc:94
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: rankSyncSerialSkip.cc:87
Definition: rankInfo.h:21
Internal API.
Definition: syncQueue.h:31
ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, LinkId_t link_id, Link *link) override
Register a Link which this Sync Object is responsible for.
Definition: rankSyncSerialSkip.cc:67
Base Class for a queue of Activities.
Definition: activityQueue.h:22
RankSyncSerialSkip(TimeConverter *minPartTC)
Create a new Sync object which fires with a specified period.
Definition: rankSyncSerialSkip.cc:42
Definition: rankSyncSerialSkip.h:26