Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
Trace.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_TRACE_HPP
19#define MOTIV_TRACE_HPP
20
21#include <memory>
22#include <vector>
23#include <ranges>
24#include "Slot.hpp"
25#include "src/models/communication/Communication.hpp"
26#include "src/models/communication/CollectiveCommunicationEvent.hpp"
27#include "Range.hpp"
28#include "TimedElement.hpp"
29
30
42 bool operator()(const otf2::definition::location_group *l, const otf2::definition::location_group *r) const {
43 return l->ref() < r->ref();
44 }
45};
46
52class Trace : public TimedElement {
53public:
61 [[nodiscard]] virtual std::map<otf2::definition::location_group*, Range<Slot*>, LocationGroupCmp> getSlots() const = 0;
62
70 [[nodiscard]] virtual Range<Communication*> getCommunications() = 0;
71
80
88 [[nodiscard]] virtual otf2::chrono::duration getRuntime() const = 0;
89
99 [[nodiscard]] virtual Trace* subtrace(otf2::chrono::duration from, otf2::chrono::duration to) = 0;
100};
101
102
103#endif //MOTIV_TRACE_HPP
A custom range implementation around std::vector<T>s.
Definition: Range.hpp:37
A base class for all elements with a start and end time.
Abstract base class for a trace.
Definition: Trace.hpp:52
virtual Trace * subtrace(otf2::chrono::duration from, otf2::chrono::duration to)=0
Creates a subtrace of the current trace.
virtual otf2::chrono::duration getRuntime() const =0
Returns the runtime of the current trace.
virtual std::map< otf2::definition::location_group *, Range< Slot * >, LocationGroupCmp > getSlots() const =0
Returns a map of slots of the current trace.
virtual Range< CollectiveCommunicationEvent * > getCollectiveCommunications()=0
Returns collective communication events of the current trace.
virtual Range< Communication * > getCommunications()=0
Returns communication objects of the current trace.
A comparator for otf2::definition::location_group objects.
Definition: Trace.hpp:34
bool operator()(const otf2::definition::location_group *l, const otf2::definition::location_group *r) const
Compares two otf2::definition::location_group objects.
Definition: Trace.hpp:42