SST  7.1.0
StructuralSimulationToolkit
threadSyncSimpleSkip.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_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 Initialization Data to occur */
46  void processLinkInitData() override;
47  /** Finish link configuration */
48  void finalizeLinkConfigurations() override;
49 
50  /** Register a Link which this Sync Object is responsible for */
51  void registerLink(LinkId_t link_id, Link* link) override;
52  ActivityQueue* getQueueForThread(int tid) override;
53 
54  uint64_t getDataSize() const;
55 
56  // static void disable() { disabled = true; barrier.disable(); }
57 
58 private:
59  std::vector<ThreadSyncQueue*> queues;
60  std::unordered_map<LinkId_t, Link*> link_map;
61  SimTime_t my_max_period;
62  int num_threads;
63  int thread;
64  static SimTime_t localMinimumNextActivityTime;
65  Simulation* sim;
66  // static bool disabled;
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:68
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: action.cc:17
Definition: threadSyncSimpleSkip.h:33
void processLinkInitData() override
Cause an exchange of Initialization Data to occur.
Definition: threadSyncSimpleSkip.cc:140
ThreadSyncSimpleSkip(int num_threads, int thread, Simulation *sim)
Create a new ThreadSync object.
Definition: threadSyncSimpleSkip.cc:27
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: threadSyncSimpleSkip.cc:164
void registerLink(LinkId_t link_id, Link *link) override
Register a Link which this Sync Object is responsible for.
Definition: threadSyncSimpleSkip.cc:73
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Definition: threadsafe.h:42