SST  7.0.0
StructuralSimulationToolkit
syncBase.h
1 // Copyright 2009-2017 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-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_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  // void execute(void);
44 
45  /** Cause an exchange of Initialization Data to occur */
46  virtual int exchangeLinkInitData(int msg_count) = 0;
47  /** Finish link configuration */
48  virtual void finalizeLinkConfigurations() = 0;
49 
50  virtual void setExit(Exit* ex) { exit = ex; }
51  virtual void setMaxPeriod(TimeConverter* period);
52 
53  // void print(const std::string& header, Output &out) const;
54 
55  virtual uint64_t getDataSize() const = 0;
56 
57  virtual Action* getSlaveAction() = 0;
58  virtual Action* getMasterAction() = 0;
59 
60 protected:
61  Exit* exit;
62  TimeConverter* max_period;
63 
64  void sendInitData_sync(Link* link, Event* init_data);
65  void finalizeConfiguration(Link* link);
66 
67 
68 };
69 
70 
71 } // namespace SST
72 
73 #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.
Definition: action.cc:17
SyncBase defines the API for Sync objects, which are used to synchronize between MPI ranks in a simul...
Definition: syncBase.h:34
virtual int exchangeLinkInitData(int msg_count)=0
Cause an exchange of Initialization Data to occur.
SyncBase()
Create a new Sync object which fires with a specified period.
Definition: syncBase.h:37
virtual void finalizeLinkConfigurations()=0
Finish link configuration.