SST  6.1.0
StructuralSimulationToolkit
threadSyncSimpleSkip.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_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();
42  void after();
43  void execute(void);
44 
45  /** Cause an exchange of Initialization Data to occur */
46  void processLinkInitData();
47  /** Finish link configuration */
49 
50  /** Register a Link which this Sync Object is responsible for */
51  void registerLink(LinkId_t link_id, Link* link);
52  ActivityQueue* getQueueForThread(int tid);
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 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;
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:75
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
Definition: action.cc:17
Definition: threadSyncSimpleSkip.h:33
void processLinkInitData()
Cause an exchange of Initialization Data to occur.
Definition: threadSyncSimpleSkip.cc:192
ThreadSyncSimpleSkip(int num_threads, int thread, Simulation *sim)
Create a new ThreadSync object.
Definition: threadSyncSimpleSkip.cc:27
void registerLink(LinkId_t link_id, Link *link)
Register a Link which this Sync Object is responsible for.
Definition: threadSyncSimpleSkip.cc:70
Base Class for a queue of Activities.
Definition: activityQueue.h:22
void finalizeLinkConfigurations()
Finish link configuration.
Definition: threadSyncSimpleSkip.cc:216
Definition: threadsafe.h:42