SST  7.1.0
StructuralSimulationToolkit
rankSyncSerialSkip.h
1 // Copyright 2009-2017 Sandia Corporation. Under the terms
2 // of Contract DE-NA0003525 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2017, Sandia Corporation
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 */
29  // Sync(TimeConverter* period);
31  virtual ~RankSyncSerialSkip();
32 
33  /** Register a Link which this Sync Object is responsible for */
34  ActivityQueue* registerLink(const RankInfo& to_rank, const RankInfo& from_rank, LinkId_t link_id, Link* link) override;
35  void execute(int thread) override;
36 
37  /** Cause an exchange of Initialization Data to occur */
38  void exchangeLinkInitData(int thread, std::atomic<int>& msg_count) override;
39  /** Finish link configuration */
40  void finalizeLinkConfigurations() override;
41 
42  SimTime_t getNextSyncTime() override { return myNextSyncTime; }
43 
44  uint64_t getDataSize() const override;
45 
46 private:
47 
48  static SimTime_t myNextSyncTime;
49 
50  // Function that actually does the exchange during run
51  void exchange();
52 
53  struct comm_pair {
54  SyncQueue* squeue; // SyncQueue
55  char* rbuf; // receive buffer
56  uint32_t local_size;
57  uint32_t remote_size;
58  };
59 
60  // typedef std::map<int, std::pair<SyncQueueC*, std::vector<char>* > > comm_map_t;
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: action.cc:17
Definition: syncManager.h:33
void exchangeLinkInitData(int thread, std::atomic< int > &msg_count) override
Cause an exchange of Initialization Data to occur.
Definition: rankSyncSerialSkip.cc:268
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: rankSyncSerialSkip.cc:89
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