SST  9.0.0
StructuralSimulationToolkit
threadSyncSimpleSkip.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_THREADSYNCSIMPLESKIP_H
13 #define SST_CORE_THREADSYNCSIMPLESKIP_H
14 
15 #include "sst/core/sst_types.h"
16 
17 #include <unordered_map>
18 
19 #include "sst/core/action.h"
20 #include "sst/core/syncManager.h"
21 #include "sst/core/threadSyncQueue.h"
22 
23 namespace SST {
24 
25 class ActivityQueue;
26 class Link;
27 class TimeConverter;
28 class Exit;
29 class Event;
30 class Simulation;
31 class ThreadSyncQueue;
32 
34 public:
35  /** Create a new ThreadSync object */
36  ThreadSyncSimpleSkip(int num_threads, int thread, Simulation* sim);
38 
39  void setMaxPeriod(TimeConverter* period);
40 
41  void before() override;
42  void after() override;
43  void execute(void) override;
44 
45  /** Cause an exchange of Untimed Data to occur */
46  void processLinkUntimedData() override;
47  /** Finish link configuration */
48  void finalizeLinkConfigurations() override;
49  void prepareForComplete() override;
50 
51  /** Register a Link which this Sync Object is responsible for */
52  void registerLink(LinkId_t link_id, Link* link) override;
53  ActivityQueue* getQueueForThread(int tid) override;
54 
55  uint64_t getDataSize() const;
56 
57  // static void disable() { disabled = true; barrier.disable(); }
58 
59 private:
60  std::vector<ThreadSyncQueue*> queues;
61  std::unordered_map<LinkId_t, Link*> link_map;
62  SimTime_t my_max_period;
63  int num_threads;
64  int thread;
65  static SimTime_t localMinimumNextActivityTime;
66  Simulation* sim;
67  static Core::ThreadSafe::Barrier barrier[3];
68  double totalWaitTime;
69  bool single_rank;
70 };
71 
72 
73 } // namespace SST
74 
75 #endif // SST_CORE_THREADSYNCSIMPLESKIP_H
Definition: syncManager.h:73
Main control class for a SST Simulation.
Definition: simulation.h:72
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: threadSyncSimpleSkip.h:33
ThreadSyncSimpleSkip(int num_threads, int thread, Simulation *sim)
Create a new ThreadSync object.
Definition: threadSyncSimpleSkip.cc:27
void processLinkUntimedData() override
Cause an exchange of Untimed Data to occur.
Definition: threadSyncSimpleSkip.cc:119
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: threadSyncSimpleSkip.cc:140
void registerLink(LinkId_t link_id, Link *link) override
Register a Link which this Sync Object is responsible for.
Definition: threadSyncSimpleSkip.cc:63
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Definition: threadsafe.h:45