Motiv
Marvelous OTF2 Traces Interactive Visualizer
Loading...
Searching...
No Matches
Slot.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_SLOT_HPP
19#define MOTIV_SLOT_HPP
20
21#include <otf2xx/otf2.hpp>
22#include "Builder.hpp"
23#include "src/types.hpp"
24#include "TimedElement.hpp"
25
26enum SlotKind {
27 None = 0b0000,
28 MPI = 0b0001,
29 OpenMP = 0b0010,
30 Plain = 0b0100
31};
32
37class Slot : public TimedElement {
38public:
49 Slot(const otf2::chrono::duration &start, const otf2::chrono::duration &end,
50 otf2::definition::location *location, otf2::definition::region *region);
51
55 otf2::chrono::duration startTime;
56
60 types::TraceTime endTime;
61
65 otf2::definition::location *location;
66
70 otf2::definition::region *region;
71
79 [[nodiscard]] SlotKind getKind() const;
80
84 [[nodiscard]] types::TraceTime getStartTime() const override;
85
89 [[nodiscard]] types::TraceTime getEndTime() const override;
90
91
92 BUILDER(Slot,
93 BUILDER_FIELD(otf2::chrono::duration, start)
94 BUILDER_FIELD(otf2::chrono::duration, end)
95 BUILDER_FIELD(otf2::definition::location * , location)
96 BUILDER_FIELD(otf2::definition::region * , region),
97 start, end, location, region)
98};
99
100#endif //MOTIV_SLOT_HPP
A Slot represents a visual slot to be rendered in the UI. It contains the information of a location.
Definition: Slot.hpp:37
types::TraceTime endTime
End time of the slot relative to the trace start time.
Definition: Slot.hpp:60
types::TraceTime getStartTime() const override
Returns the start time of the current object.
Definition: Slot.cpp:41
types::TraceTime getEndTime() const override
Returns the start time of the current object.
Definition: Slot.cpp:45
SlotKind getKind() const
Returns the kind of the current Slot object.
Definition: Slot.cpp:30
otf2::chrono::duration startTime
Start time of the slot relative to the trace start time.
Definition: Slot.hpp:55
otf2::definition::region * region
Region the slot occurred in. For example, the source file and line.
Definition: Slot.hpp:70
otf2::definition::location * location
Location of the slot (thread) containing the location group (MPI rank)
Definition: Slot.hpp:65
A base class for all elements with a start and end time.