SST  9.1.0
StructuralSimulationToolkit
syncBase.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_SYNCBASE_H
13 #define SST_CORE_SYNCBASE_H
14 
15 #include "sst/core/sst_types.h"
16 
17 #include <sst/core/rankInfo.h>
18 
19 namespace SST {
20 
21 class Action;
22 class ActivityQueue;
23 class Link;
24 class TimeConverter;
25 class Exit;
26 class Event;
27 
28 /**
29  * \class SyncBase
30  * SyncBase defines the API for Sync objects, which
31  * are used to synchronize between MPI ranks in a simulation. This is
32  * an internal class, and not a public-facing API.
33  */
34 class SyncBase {
35 public:
36  /** Create a new Sync object which fires with a specified period */
37  SyncBase() {}
38  virtual ~SyncBase() {}
39 
40  /** Register a Link which this Sync Object is responsible for */
41  virtual ActivityQueue* registerLink(const RankInfo& to_rank, const RankInfo& from_rank, LinkId_t link_id, Link* link) = 0;
42 
43  /** Cause an exchange of Untimed Data to occur */
44  virtual int exchangeLinkUntimedData(int msg_count) = 0;
45  /** Finish link configuration */
46  virtual void finalizeLinkConfigurations() = 0;
47 
48  virtual void setExit(Exit* ex) { exit = ex; }
49  virtual void setMaxPeriod(TimeConverter* period);
50 
51  virtual uint64_t getDataSize() const = 0;
52 
53  virtual Action* getSlaveAction() = 0;
54  virtual Action* getMasterAction() = 0;
55 
56 protected:
57  Exit* exit;
58  TimeConverter* max_period;
59 
60  void sendUntimedData_sync(Link* link, Event* data);
61  void finalizeConfiguration(Link* link);
62 
63 
64 };
65 
66 
67 } // namespace SST
68 
69 #endif // SST_CORE_SYNCBASE_H
virtual ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, LinkId_t link_id, Link *link)=0
Register a Link which this Sync Object is responsible for.
virtual int exchangeLinkUntimedData(int msg_count)=0
Cause an exchange of Untimed Data to occur.
SyncBase defines the API for Sync objects, which are used to synchronize between MPI ranks in a simul...
Definition: syncBase.h:34
SyncBase()
Create a new Sync object which fires with a specified period.
Definition: syncBase.h:37
virtual void finalizeLinkConfigurations()=0
Finish link configuration.