SST 12.1.0
Structural Simulation Toolkit
rankSyncSerialSkip.h
1// Copyright 2009-2022 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-2022, 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_SYNC_RANKSYNCSERIALSKIP_H
13#define SST_CORE_SYNC_RANKSYNCSERIALSKIP_H
14
15#include "sst/core/sst_types.h"
16#include "sst/core/sync/syncManager.h"
17#include "sst/core/threadsafe.h"
18
19#include <map>
20
21namespace SST {
22
23class SyncQueue;
24class TimeConverter;
25
27{
28public:
29 /** Create a new Sync object which fires with a specified period */
30 RankSyncSerialSkip(RankInfo num_ranks, TimeConverter* minPartTC);
31 virtual ~RankSyncSerialSkip();
32
33 /** Register a Link which this Sync Object is responsible for */
35 registerLink(const RankInfo& to_rank, const RankInfo& from_rank, const std::string& name, Link* link) override;
36 void execute(int thread) override;
37
38 /** Cause an exchange of Untimed Data to occur */
39 void exchangeLinkUntimedData(int thread, std::atomic<int>& msg_count) override;
40 /** Finish link configuration */
41 void finalizeLinkConfigurations() override;
42 /** Prepare for the complete() stage */
43 void prepareForComplete() override;
44
45 SimTime_t getNextSyncTime() override { return myNextSyncTime; }
46
47 uint64_t getDataSize() const override;
48
49private:
50 static SimTime_t myNextSyncTime;
51
52 // Function that actually does the exchange during run
53 void exchange();
54
55 struct comm_pair
56 {
57 SyncQueue* squeue; // SyncQueue
58 char* rbuf; // receive buffer
59 uint32_t local_size;
60 uint32_t remote_size;
61 };
62
63 typedef std::map<int, comm_pair> comm_map_t;
64 typedef std::map<std::string, uintptr_t> link_map_t;
65
66 // TimeConverter* period;
67 comm_map_t comm_map;
68 link_map_t link_map;
69
70 double mpiWaitTime;
71 double deserializeTime;
72};
73
74} // namespace SST
75
76#endif // SST_CORE_SYNC_RANKSYNCSERIALSKIP_H
Base Class for a queue of Activities.
Definition: activityQueue.h:22
Definition: rankInfo.h:22
Definition: rankSyncSerialSkip.h:27
ActivityQueue * registerLink(const RankInfo &to_rank, const RankInfo &from_rank, const std::string &name, Link *link) override
Register a Link which this Sync Object is responsible for.
Definition: rankSyncSerialSkip.cc:77
void prepareForComplete() override
Prepare for the complete() stage.
Definition: rankSyncSerialSkip.cc:103
void finalizeLinkConfigurations() override
Finish link configuration.
Definition: rankSyncSerialSkip.cc:99
void exchangeLinkUntimedData(int thread, std::atomic< int > &msg_count) override
Cause an exchange of Untimed Data to occur.
Definition: rankSyncSerialSkip.cc:244
Definition: syncManager.h:38
Internal API.
Definition: syncQueue.h:30
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:27