Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
SubTrace.hpp
1/*
2 * Marvelous OTF2 Traces Interactive Visualizer (MOTIV)
3 * Copyright (C) 2023 Florian Gallrein, Björn Gehrke
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef MOTIV_SUBTRACE_HPP
19#define MOTIV_SUBTRACE_HPP
20
21#include "Trace.hpp"
22#include "Range.hpp"
23
24
28class SubTrace : public Trace {
29public:
33 [[nodiscard]] std::map<otf2::definition::location_group*, Range<Slot*>, LocationGroupCmp> getSlots() const override;
34
38 [[nodiscard]] otf2::chrono::duration getRuntime() const override;
39
43 [[nodiscard]] Trace* subtrace(otf2::chrono::duration from, otf2::chrono::duration to) override;
44
48 [[nodiscard]] Range<Communication*> getCommunications() override;
49
50
55
56
60 [[nodiscard]] otf2::chrono::duration getStartTime() const override;
61
65 [[nodiscard]] types::TraceTime getEndTime() const override;
66
70 [[nodiscard]] types::TraceTime getDuration() const override;
71
72protected:
76 std::map<otf2::definition::location_group*, Range<Slot*>, LocationGroupCmp> slots_;
77
82
87
91 otf2::chrono::duration runtime_{};
92
96 otf2::chrono::duration startTime_{};
97public:
101 SubTrace();
102
111 SubTrace(std::map<otf2::definition::location_group*, Range<Slot*>, LocationGroupCmp> &slots,
112 const Range<Communication*> &communications,
113 const Range<CollectiveCommunicationEvent*> &collectiveCommunications,
114 const otf2::chrono::duration &runtime,
115 const otf2::chrono::duration &startTime);
116};
117
118#endif //MOTIV_SUBTRACE_HPP
A custom range implementation around std::vector<T>s.
Definition: Range.hpp:37
Trace representing a section of a larger trace.
Definition: SubTrace.hpp:28
std::map< otf2::definition::location_group *, Range< Slot * >, LocationGroupCmp > slots_
Definition: SubTrace.hpp:76
Trace * subtrace(otf2::chrono::duration from, otf2::chrono::duration to) override
Creates a subtrace of the current trace.
Definition: SubTrace.cpp:93
Range< CollectiveCommunicationEvent * > collectiveCommunications_
Definition: SubTrace.hpp:86
types::TraceTime getEndTime() const override
Returns the end time of the current object.
Definition: SubTrace.cpp:113
otf2::chrono::duration startTime_
Definition: SubTrace.hpp:96
otf2::chrono::duration getStartTime() const override
Returns the start time of the current object.
Definition: SubTrace.cpp:58
Range< Communication * > getCommunications() override
Returns communication objects of the current trace.
Definition: SubTrace.cpp:50
std::map< otf2::definition::location_group *, Range< Slot * >, LocationGroupCmp > getSlots() const override
Returns a map of slots of the current trace.
Definition: SubTrace.cpp:42
otf2::chrono::duration runtime_
Definition: SubTrace.hpp:91
Range< CollectiveCommunicationEvent * > getCollectiveCommunications() override
Returns communication objects of the current trace.
Definition: SubTrace.cpp:54
SubTrace()
Definition: SubTrace.cpp:35
types::TraceTime getDuration() const override
Returns the duration of the current object.
Definition: SubTrace.cpp:117
Range< Communication * > communications_
Definition: SubTrace.hpp:81
otf2::chrono::duration getRuntime() const override
Returns the runtime of the current trace.
Definition: SubTrace.cpp:46
Abstract base class for a trace.
Definition: Trace.hpp:52
A comparator for otf2::definition::location_group objects.
Definition: Trace.hpp:34