SST  6.0.0
StructuralSimulationToolkit
rankSyncSerialSkip.h
1 // Copyright 2009-2016 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2016, 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);
35  void execute(int thread);
36 
37  /** Cause an exchange of Initialization Data to occur */
38  void exchangeLinkInitData(int thread, std::atomic<int>& msg_count);
39  /** Finish link configuration */
41 
42  SimTime_t getNextSyncTime() { return myNextSyncTime; }
43 
44  uint64_t getDataSize() const;
45 
46 private:
47 
48  static SimTime_t myNextSyncTime;
49  TimeConverter* minPartTC;
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, std::pair<SyncQueueC*, std::vector<char>* > > comm_map_t;
62  typedef std::map<int, comm_pair > comm_map_t;
63  typedef std::map<LinkId_t, Link*> link_map_t;
64 
65  // TimeConverter* period;
66  comm_map_t comm_map;
67  link_map_t link_map;
68 
69  double mpiWaitTime;
70  double deserializeTime;
71 
73 
74 };
75 
76 } // namespace SST
77 
78 #endif // SST_CORE_SYNCMANAGER_H
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
RankSyncSerialSkip(Core::ThreadSafe::Barrier &barrier, TimeConverter *minPartTC)
Create a new Sync object which fires with a specified period.
Definition: rankSyncSerialSkip.cc:155
Definition: action.cc:17
Definition: syncManager.h:33
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)
Register a Link which this Sync Object is responsible for.
Definition: rankSyncSerialSkip.cc:182
void finalizeLinkConfigurations()
Finish link configuration.
Definition: rankSyncSerialSkip.cc:204
Base Class for a queue of Activities.
Definition: activityQueue.h:22
void exchangeLinkInitData(int thread, std::atomic< int > &msg_count)
Cause an exchange of Initialization Data to occur.
Definition: rankSyncSerialSkip.cc:391
Definition: rankSyncSerialSkip.h:26
Definition: threadsafe.h:42