├── CMake-Modules ├── FindMuster.cmake ├── FindOTF.cmake └── FindOTF2.cmake ├── CMakeLists.txt ├── LICENSE ├── README.md ├── images └── pf3d32_sf_700.png └── src ├── CMakeLists.txt ├── Ravel.pro ├── charmimporter.cpp ├── charmimporter.h ├── clusterentity.cpp ├── clusterentity.h ├── clusterevent.cpp ├── clusterevent.h ├── clustertreevis.cpp ├── clustertreevis.h ├── clustervis.cpp ├── clustervis.h ├── collectiveevent.cpp ├── collectiveevent.h ├── collectiverecord.cpp ├── collectiverecord.h ├── colormap.cpp ├── colormap.h ├── commbundle.h ├── commdrawinterface.cpp ├── commdrawinterface.h ├── commevent.cpp ├── commevent.h ├── commrecord.cpp ├── commrecord.h ├── counter.cpp ├── counter.h ├── counterrecord.cpp ├── counterrecord.h ├── entity.cpp ├── entity.h ├── entitygroup.cpp ├── entitygroup.h ├── event.cpp ├── event.h ├── eventrecord.cpp ├── eventrecord.h ├── exchangegnome.cpp ├── exchangegnome.h ├── function.cpp ├── function.h ├── gnome.cpp ├── gnome.h ├── gnome2.cpp ├── gnome2.h ├── importfunctor.cpp ├── importfunctor.h ├── importoptions.cpp ├── importoptions.h ├── importoptionsdialog.cpp ├── importoptionsdialog.h ├── importoptionsdialog.ui ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── message.cpp ├── message.h ├── metricrangedialog.cpp ├── metricrangedialog.h ├── metricrangedialog.ui ├── metrics.cpp ├── metrics.h ├── otf2exporter.cpp ├── otf2exporter.h ├── otf2exportfunctor.cpp ├── otf2exportfunctor.h ├── otf2importer.cpp ├── otf2importer.h ├── otfcollective.cpp ├── otfcollective.h ├── otfconverter.cpp ├── otfconverter.h ├── otfimporter.cpp ├── otfimporter.h ├── overviewvis.cpp ├── overviewvis.h ├── p2pevent.cpp ├── p2pevent.h ├── partitioncluster.cpp ├── partitioncluster.h ├── primaryentitygroup.cpp ├── primaryentitygroup.h ├── ravelutils.h ├── rawtrace.cpp ├── rawtrace.h ├── rpartition.cpp ├── rpartition.h ├── stepvis.cpp ├── stepvis.h ├── timelinevis.cpp ├── timelinevis.h ├── trace.cpp ├── trace.h ├── traditionalvis.cpp ├── traditionalvis.h ├── verticallabel.cpp ├── verticallabel.h ├── visoptions.cpp ├── visoptions.h ├── visoptionsdialog.cpp ├── visoptionsdialog.h ├── visoptionsdialog.ui ├── viswidget.cpp └── viswidget.h /CMake-Modules/FindMuster.cmake: -------------------------------------------------------------------------------- 1 | find_path(Muster_INCLUDE_DIRS kmedoids.h 2 | PATHS $ENV{HOME}/opt/include $ENV{HOME}/opt/muster/include 3 | PATH_SUFFIXES muster 4 | ) 5 | 6 | find_library(Muster_LIBRARIES muster 7 | PATHS $ENV{HOME}/opt/lib $ENV{HOME}/opt/muster/lib 8 | PATH_SUFFIXES muster 9 | ) 10 | 11 | 12 | find_package_handle_standard_args(Muster 13 | FAIL_MESSAGE "Couldn't find Muster." 14 | REQUIRED_VARS Muster_INCLUDE_DIRS Muster_LIBRARIES) 15 | 16 | -------------------------------------------------------------------------------- /CMake-Modules/FindOTF.cmake: -------------------------------------------------------------------------------- 1 | find_path(OTF_INCLUDE_DIRS otf.h 2 | PATHS $ENV{HOME}/opt/include $ENV{HOME}/opt/include/otf 3 | PATH_SUFFIXES otf open-trace-format) 4 | 5 | find_library( 6 | OTF_LIBRARIES 7 | NAMES otf open-trace-format 8 | PATHS $ENV{HOME}/opt/lib) 9 | 10 | find_package_handle_standard_args( 11 | OTF 12 | FAIL_MESSAGE "Couldn't find OTF library." 13 | REQUIRED_VARS OTF_INCLUDE_DIRS OTF_LIBRARIES) 14 | 15 | -------------------------------------------------------------------------------- /CMake-Modules/FindOTF2.cmake: -------------------------------------------------------------------------------- 1 | find_path(OTF2_INCLUDE_DIRS otf2/otf2.h 2 | $ENV{HOME}/opt/include 3 | /usr/opt/otf2/include 4 | ) 5 | 6 | find_library(OTF2_LIBRARIES otf2 7 | $ENV{HOME}/opt/lib 8 | /usr/opt/otf2/lib 9 | ) 10 | 11 | 12 | find_package_handle_standard_args(OTF2 13 | FAIL_MESSAGE "Couldn't find OTF2 library." 14 | REQUIRED_VARS OTF2_INCLUDE_DIRS OTF2_LIBRARIES 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(Ravel C CXX) 2 | 3 | cmake_minimum_required(VERSION 2.8.9) # for Qt5 4 | 5 | set(Ravel_MAJOR_VERSION 1) 6 | set(Ravel_MINOR_VERSION 0) 7 | set(Ravel_PATCH_VERSION 0) 8 | set(Ravel_VERSION 9 | "${Ravel_MAJOR_VERSION}.${Ravel_MINOR_VERSION}.${Ravel_PATCH_VERSION}") 10 | 11 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake-Modules 12 | ${CMAKE_MODULE_PATH}) 13 | 14 | add_subdirectory(src) 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ravel 2 | ===== 3 | Ravel is a trace visualization tool for MPI with recent experimental support 4 | for Charm++. Ravel is unique in that it shows not only physical timelines, but 5 | also logical ones structured to better capture the intended organization of 6 | communication operations. Ravel calculates logical structure from Open Trace 7 | Format or Charm++ Projections logs and presents the results using multiple 8 | coordinated views. 9 | 10 | In logical time, all operations are colored via some metric. The default 11 | metric for MPI is *lateness* which measures the difference in exit time of an 12 | operation compared to its peers at the same logical timestep. 13 | 14 | ![Ravel Logical and Physical Timelines](/images/pf3d32_sf_700.png) 15 | 16 | Installation 17 | ------------ 18 | Ravel depends on: 19 | - [Open Trace Format version 2 1.4+](http://www.vi-hps.org/projects/score-p/) 20 | - [Qt5+](http://www.qt.io/download/) 21 | - [Muster 1.0.1+](https://github.com/scalability-llnl/muster) 22 | - (Install only) [cmake 2.8.9+](http://www.cmake.org/download/) 23 | - (Optional) [Open Trace Format 1.12+](http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/projekte/otf/index_html/document_view?set_language=en) 24 | 25 | To install: 26 | 27 | $ git clone https://github.com/scalability-llnl/ravel.git 28 | $ mkdir ravel/build 29 | $ cd ravel/build 30 | $ cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/directory .. 31 | $ make 32 | $ make install 33 | 34 | If a dependency is not found, add its install directory to the 35 | `CMAKE_PREFIX_PATH` environment variable. 36 | 37 | Usage 38 | ----- 39 | 40 | ### Opening a Trace 41 | 42 | Before opening the trace, check your settings under `Options->OTF Importing`. 43 | These options will affect the logical organization even determined by Ravel. 44 | Once you are happy with your options, use `File->Open Trace` and navigate to 45 | your `.otf`, `.otf2`, or `.sts` file. 46 | 47 | #### Partitions 48 | 49 | Ravel partitions the trace into fine-grained communication phases -- sets of 50 | communication operations that must belong together. It imposes a 51 | happened-before ordering between traces to better represent how developers 52 | think of them separately. 53 | 54 | * Automatically determine partitions: use happened-before relationships and 55 | the following options: 56 | * use Waitall heuristic: OTF version 1 only, will group all uninterrupted 57 | send operations before each Waitall in the same phase 58 | * merge Partitions by call tree: Will merge communication operations up the 59 | call stack until reaching a call containing multiple such operations. MPI 60 | only. 61 | * merge Partitions to complete Leaps: Avoids sparse partitions by forcing 62 | each rank to be active at each distance in the phase DAG. Useful for bulk 63 | synchronous codes. MPI only. 64 | * skip Leaps that cannot be merged: Relaxes the leap merge when it cannot 65 | find a next merge. 66 | * merge across global steps: This merge happens after stepping, so it does 67 | not affect the logical structure, but groups MPI ranks that cover the same 68 | logical step. MPI only. 69 | * Charm++ break functions: Force the breaking of partitions at the given 70 | common-separated list of Charm++ entry methods. 71 | * Partition at function breaks: Use if you know your phases are contained in 72 | a given function. List the function. 73 | 74 | #### Other Options 75 | * Matching send/recv must have the same message size: Enforces send and receive 76 | reporting the same message size. Uncheck this for Scalasca-generated OTF2. 77 | * Idealized order of receives: Change the order of receives from their true 78 | physical time order to an idealized one in each phase. We recommend this for 79 | Charm++. It is not compatible with clustering. 80 | * Advanced stepping within a partition: Align sends based on happened-before 81 | structure rather than as early as possible. MPI only. 82 | * Coalesce Isends: Groups neighboring `MPI_Isend`s into a single operation 83 | which may send to multiple receive operations. We recommend this option as a 84 | default for all MPI traces. 85 | * Cluster processes: Shows a cluster view that clusters the processes by the 86 | active metric. This is useful for large process counts. MPI only. 87 | * Seed: Set seed for repeatable clustering. 88 | 89 | ### Navigating Traces 90 | 91 | The three timeline views support linked panning, zooming and selection. The 92 | overview shows the total metric value over time steps for the whole trace. 93 | Clicking and dragging in this view will select a span of timesteps in the 94 | other views. 95 | 96 | Navigation | Control 97 | -----------|--------- 98 | Pan | Left-click drag 99 | Zoom in time | Mouse wheel 100 | Zoom in processes | Shift + Mouse wheel 101 | Zoom to rectangle | Right-click drag rectangle 102 | Select operation | Right-click operation 103 | Tool tips | Hover 104 | 105 | The cluster view has a slider which changes the size of the neighborhood shown 106 | in the upper part of the view. The lower part of the view shows the clusters. 107 | Left-click to divide clusters into its children. Click on dendrogram nodes to 108 | collapse clusters. Dendrogram pertains to left-most visible partition. 109 | Clustering currently shows the first partition rather than all. 110 | 111 | ### Saving Traces 112 | All traces are saved in OTF2 and include only the information from the 113 | original trace that is used by Ravel. In addition, communication-related 114 | operations used for logical structure have an `OTF2_AttributeList` associated 115 | with their Leave events. These lists include a `phase` and `step` value 116 | defining the logical structure used by Ravel, as well as any metric values 117 | computed for that operation. Any metric values ending in `_agg` represent the 118 | calculated value of the aggregated non-communication operation directly 119 | preceding. 120 | 121 | 122 | Authors 123 | ------- 124 | Ravel was written by Kate Isaacs. 125 | 126 | License 127 | ------- 128 | Ravel is released under the LGPL license. For more details see the LICENSE 129 | file. 130 | 131 | LLNL-CODE-663885 132 | 133 | Related Publications 134 | -------------------- 135 | Katherine E. Isaacs, Peer-Timo Bremer, Ilir Jusufi, Todd Gamblin, Abhinav 136 | Bhatele, Martin Schulz, and Bernd Hamann. Combing the Communication Hairball: 137 | Visualizing Parallel Execution Traces using Logical Time. *IEEE Transactions on 138 | Visualization and Computer Graphics, Proceedings of InfoVis '14*, 20(12):2349-2358, December 2014. 139 | [DOI: 10.1109/TVCG.2014.2346456](http://dx.doi.org/10.1109/TVCG.2014.2346456) 140 | 141 | Katherine E. Isaacs, Abhinav Bhatele, Jonathan Lifflander, David Boehme, Todd 142 | Gamblin, Bernd Hamann, Peer-Timo Bremer. Recovering Logical Structure from 143 | Charm++ Event Traces. In *Proceedings fo the ACM/IEEE Conference on 144 | Supercomputing (SC15)*, November 2015. [DOI: 145 | 10.1145/2807591.2807634](http://dx.doi.org/10.1145/2807591.2807634) 146 | 147 | Katherine E. Isaacs, Todd Gamblin, Abhinav Bhatele, Martin Schulz, Bernd 148 | Hamann, and Peer-Timo Bremer. Ordering Traces Logically to Identify Lateness 149 | in Message Passing Programs. *IEEE Transactions on Parallel and Distributed 150 | Systems*, 27(3):829-840, March 2016. [DOI: 151 | 10.1109/TPDS.2015.2417531](http://dx.doi.org/10.1109/TPDS.2015.2417531) 152 | -------------------------------------------------------------------------------- /images/pf3d32_sf_700.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LLNL/ravel/9f81378712280a5734ce38d12636fdc4a1117c88/images/pf3d32_sf_700.png -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 2 | 3 | # Qt5 + Modules 4 | find_package(Qt5 REQUIRED Core Widgets OpenGL Concurrent) 5 | 6 | # Dependencies over Qt5 7 | find_package(OpenGL) 8 | find_package(Muster REQUIRED) 9 | find_package(OTF) 10 | find_package(OTF2 REQUIRED) 11 | find_package(ZLIB REQUIRED) 12 | 13 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") 14 | 15 | set(CMAKE_AUTOMOC ON) 16 | 17 | # Includes, Definitions, Flags 18 | include_directories(${Qt5Widgets_INCLUDE_DIRS} 19 | ${Muster_INCLUDE_DIRS} 20 | ${OTF2_INCLUDE_DIRS} 21 | ${ZLIB_INCLUDE_DIRS} 22 | ) 23 | 24 | SET(ADDED_SOURCES "") 25 | SET(ADDED_HEADERS "") 26 | 27 | if (OTF_FOUND) 28 | include_directories(${OTF_INCLUDE_DIRS}) 29 | add_definitions(-DOTF1LIB) 30 | list(APPEND ADDED_HEADERS otfimporter.h) 31 | list(APPEND ADDED_SOURCES otfimporter.cpp) 32 | endif() 33 | 34 | add_definitions(${Qt5Widgets_DEFINITIONS}) 35 | 36 | # ui files 37 | qt5_wrap_ui(ui_mainwindow.h mainwindow.ui) 38 | qt5_wrap_ui(ui_importoptionsdialog.h importoptionsdialog.ui) 39 | qt5_wrap_ui(ui_metricrangedialog.h metricrangedialog.ui) 40 | qt5_wrap_ui(ui_visoptionsdialog.h visoptionsdialog.ui) 41 | 42 | # Sources and UI Files 43 | set(Ravel_SOURCES 44 | main.cpp 45 | trace.cpp 46 | event.cpp 47 | message.cpp 48 | mainwindow.cpp 49 | viswidget.cpp 50 | overviewvis.cpp 51 | stepvis.cpp 52 | colormap.cpp 53 | commrecord.cpp 54 | eventrecord.cpp 55 | rawtrace.cpp 56 | otfconverter.cpp 57 | function.cpp 58 | importoptionsdialog.cpp 59 | importoptions.cpp 60 | timelinevis.cpp 61 | traditionalvis.cpp 62 | visoptionsdialog.cpp 63 | visoptions.cpp 64 | importfunctor.cpp 65 | gnome.cpp 66 | exchangegnome.cpp 67 | collectiverecord.cpp 68 | partitioncluster.cpp 69 | clusterevent.cpp 70 | clustervis.cpp 71 | clustertreevis.cpp 72 | verticallabel.cpp 73 | rpartition.cpp 74 | metricrangedialog.cpp 75 | otfcollective.cpp 76 | commevent.cpp 77 | p2pevent.cpp 78 | collectiveevent.cpp 79 | commdrawinterface.cpp 80 | counter.cpp 81 | counterrecord.cpp 82 | otf2importer.cpp 83 | entity.cpp 84 | clusterentity.cpp 85 | entitygroup.cpp 86 | otf2exporter.cpp 87 | otf2exportfunctor.cpp 88 | charmimporter.cpp 89 | primaryentitygroup.cpp 90 | metrics.cpp 91 | ${ADDED_SOURCES} 92 | ) 93 | 94 | set(Ravel_HEADERS 95 | trace.h 96 | event.h 97 | message.h 98 | mainwindow.h 99 | viswidget.h 100 | overviewvis.h 101 | stepvis.h 102 | colormap.h 103 | commrecord.h 104 | eventrecord.h 105 | rawtrace.h 106 | otfconverter.h 107 | function.h 108 | ravelutils.h 109 | importoptionsdialog.h 110 | importoptions.h 111 | timelinevis.h 112 | traditionalvis.h 113 | visoptionsdialog.h 114 | visoptions.h 115 | importfunctor.h 116 | gnome.h 117 | exchangegnome.h 118 | collectiverecord.h 119 | partitioncluster.h 120 | clusterevent.h 121 | clustervis.h 122 | clustertreevis.h 123 | verticallabel.h 124 | rpartition.h 125 | metricrangedialog.h 126 | otfcollective.h 127 | commevent.h 128 | p2pevent.h 129 | collectiveevent.h 130 | commbundle.h 131 | commdrawinterface.h 132 | counter.h 133 | counterrecord.h 134 | otf2importer.h 135 | entity.h 136 | clusterentity.h 137 | entitygroup.h 138 | otf2exporter.h 139 | otf2exportfunctor.h 140 | charmimporter.h 141 | primaryentitygroup.h 142 | metrics.h 143 | ${ADDED_HEADERS} 144 | ) 145 | 146 | set(Ravel_UIC 147 | ui_mainwindow.h 148 | ui_importoptionsdialog.h 149 | ui_visoptionsdialog.h 150 | ui_metricrangedialog.h 151 | ) 152 | 153 | # Build Target 154 | add_executable(Ravel MACOSX_BUNDLE ${Ravel_SOURCES} ${Ravel_UIC}) 155 | 156 | qt5_use_modules(Ravel Widgets OpenGL Concurrent) 157 | 158 | target_link_libraries(Ravel 159 | Qt5::Widgets 160 | Qt5::OpenGL 161 | Qt5::Concurrent 162 | ${OPENGL_LIBRARIES} 163 | ${Muster_LIBRARIES} 164 | ${OTF2_LIBRARIES} 165 | ${ZLIB_LIBRARIES} 166 | ) 167 | 168 | if (OTF_FOUND) 169 | target_link_libraries(Ravel 170 | ${OTF_LIBRARIES} 171 | ) 172 | endif() 173 | 174 | install(TARGETS Ravel DESTINATION bin) 175 | -------------------------------------------------------------------------------- /src/Ravel.pro: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | # Produced at the Lawrence Livermore National Laboratory. 4 | # 5 | # This file is part of Ravel. 6 | # Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | # LLNL-CODE-663885 8 | # 9 | # For details, see https://github.com/scalability-llnl/ravel 10 | # Please also see the LICENSE file for our notice and the LGPL. 11 | # 12 | # This program is free software; you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License (as published by 14 | # the Free Software Foundation) version 2.1 dated February 1999. 15 | # 16 | # This program is distributed in the hope that it will be useful, but 17 | # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | # conditions of the GNU General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU Lesser General Public License 22 | # along with this program; if not, write to the Free Software Foundation, 23 | # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ########################################################################## 25 | QT += opengl core gui concurrent 26 | 27 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 28 | 29 | TARGET = Ravel 30 | TEMPLATE = app 31 | 32 | SOURCES += main.cpp \ 33 | trace.cpp \ 34 | event.cpp \ 35 | message.cpp \ 36 | mainwindow.cpp \ 37 | viswidget.cpp \ 38 | overviewvis.cpp \ 39 | stepvis.cpp \ 40 | colormap.cpp \ 41 | commrecord.cpp \ 42 | eventrecord.cpp \ 43 | rawtrace.cpp \ 44 | otfconverter.cpp \ 45 | function.cpp \ 46 | importoptionsdialog.cpp \ 47 | timelinevis.cpp \ 48 | traditionalvis.cpp \ 49 | visoptionsdialog.cpp \ 50 | visoptions.cpp \ 51 | gnome.cpp \ 52 | exchangegnome.cpp \ 53 | collectiverecord.cpp \ 54 | partitioncluster.cpp \ 55 | clusterevent.cpp \ 56 | clustervis.cpp \ 57 | clustertreevis.cpp \ 58 | verticallabel.cpp \ 59 | rpartition.cpp \ 60 | metricrangedialog.cpp \ 61 | otfcollective.cpp \ 62 | commevent.cpp \ 63 | p2pevent.cpp \ 64 | collectiveevent.cpp \ 65 | commdrawinterface.cpp \ 66 | counter.cpp \ 67 | counterrecord.cpp \ 68 | charmimporter.cpp \ 69 | otf2importer.cpp \ 70 | otf2exporter.cpp \ 71 | otf2exportfunctor.cpp \ 72 | metrics.cpp \ 73 | entity.cpp \ 74 | primaryentitygroup.cpp \ 75 | entitygroup.cpp \ 76 | clusterentity.cpp \ 77 | importoptions.cpp \ 78 | importfunctor.cpp 79 | 80 | HEADERS += \ 81 | trace.h \ 82 | event.h \ 83 | message.h \ 84 | mainwindow.h \ 85 | viswidget.h \ 86 | overviewvis.h \ 87 | stepvis.h \ 88 | colormap.h \ 89 | commrecord.h \ 90 | eventrecord.h \ 91 | rawtrace.h \ 92 | otfconverter.h \ 93 | function.h \ 94 | importoptionsdialog.h \ 95 | timelinevis.h \ 96 | traditionalvis.h \ 97 | visoptionsdialog.h \ 98 | visoptions.h \ 99 | gnome.h \ 100 | exchangegnome.h \ 101 | collectiverecord.h \ 102 | partitioncluster.h \ 103 | clusterevent.h \ 104 | clustervis.h \ 105 | clustertreevis.h \ 106 | verticallabel.h \ 107 | rpartition.h \ 108 | metricrangedialog.h \ 109 | otfcollective.h \ 110 | commevent.h \ 111 | p2pevent.h \ 112 | collectiveevent.h \ 113 | commbundle.h \ 114 | commdrawinterface.h \ 115 | counter.h \ 116 | counterrecord.h \ 117 | charmimporter.h \ 118 | otf2importer.h \ 119 | otf2exporter.h \ 120 | otf2exportfunctor.h \ 121 | metrics.h \ 122 | entity.h \ 123 | primaryentitygroup.h \ 124 | entitygroup.h \ 125 | clusterentity.h \ 126 | ravelutils.h \ 127 | importoptions.h \ 128 | importfunctor.h 129 | 130 | FORMS += \ 131 | mainwindow.ui \ 132 | importoptionsdialog.ui \ 133 | visoptionsdialog.ui \ 134 | metricrangedialog.ui 135 | 136 | HOME = $$system(echo $HOME) 137 | 138 | contains(DEFINES, OTF1LIB) { 139 | SOURCES += otfimporter.cpp 140 | HEADERS += otfimporter.h 141 | 142 | unix:!macx: LIBS += -lotf 143 | 144 | macx: INCLUDEPATH += $${HOME}/opt/include/open-trace-format/ 145 | macx: DEPENDPATH += $${HOME}/opt/include/open-trace-format/ 146 | macx: LIBS += -L$${HOME}/opt/lib -lopen-trace-format 147 | } 148 | 149 | LIBS += -lz 150 | 151 | unix: INCLUDEPATH += $${HOME}/opt/include 152 | unix: DEPENDPATH += $${HOME}/opt/include 153 | 154 | unix:!macx: INCLUDEPATH += /opt/otf2/include 155 | unix:!macx: DEPENDPATH += /opt/otf2/include 156 | 157 | unix:!macx: LIBS += -L/opt/otf2/lib -lotf2 158 | 159 | macx: LIBS += -L$${HOME}/opt/lib -lotf2 160 | 161 | macx: INCLUDEPATH += $${HOME}/opt/include/otf2/ 162 | macx: DEPENDPATH += $${HOME}/opt/include/otf2/ 163 | 164 | unix:!macx: LIBS += -L$${HOME}/opt/lib -lmuster 165 | 166 | macx: LIBS += -L$${HOME}/opt/muster/lib -lmuster 167 | macx: INCLUDEPATH += $${HOME}/opt/muster/include 168 | macx: DEPENDPATH += $${HOME}/opt/muster/include 169 | 170 | OTHER_FILES += \ 171 | CMakeLists.txt 172 | 173 | -------------------------------------------------------------------------------- /src/clusterentity.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "clusterentity.h" 26 | #include 27 | 28 | ClusterEntity::ClusterEntity(unsigned long _e, int _step) 29 | : entity(_e), 30 | startStep(_step), 31 | metric_events(new QVector()) 32 | { 33 | } 34 | 35 | ClusterEntity::ClusterEntity() 36 | : entity(0), 37 | startStep(0), 38 | metric_events(new QVector()) 39 | { 40 | 41 | } 42 | 43 | ClusterEntity::ClusterEntity(const ClusterEntity & other) 44 | : entity(other.entity), 45 | startStep(other.startStep), 46 | metric_events(new QVector()) 47 | { 48 | for (int i = 0; i < other.metric_events->size(); i++) 49 | metric_events->append(other.metric_events->at(i)); 50 | } 51 | 52 | ClusterEntity::~ClusterEntity() 53 | { 54 | delete metric_events; 55 | } 56 | 57 | // Distance between this ClusterEntity and another. Since metric_events fills 58 | // in the missing steps with the previous value, we can just go straight 59 | // through from the startStep of the shorter one. 60 | double ClusterEntity::calculateMetricDistance(const ClusterEntity& other) const 61 | { 62 | int num_matches = metric_events->size(); 63 | double total_difference = 0; 64 | int offset = 0; 65 | if (metric_events->size() && other.metric_events->size()) 66 | { 67 | if (startStep < other.startStep) 68 | { 69 | num_matches = other.metric_events->size(); 70 | offset = metric_events->size() - other.metric_events->size(); 71 | for (int i = 0; i < other.metric_events->size(); i++) 72 | total_difference += (metric_events->at(offset + i) 73 | - other.metric_events->at(i)) 74 | * (metric_events->at(offset + i) 75 | - other.metric_events->at(i)); 76 | } 77 | else 78 | { 79 | offset = other.metric_events->size() - metric_events->size(); 80 | for (int i = 0; i < metric_events->size(); i++) 81 | total_difference += (other.metric_events->at(offset + i) 82 | - metric_events->at(i)) 83 | * (other.metric_events->at(offset + i) 84 | - metric_events->at(i)); 85 | } 86 | } 87 | if (num_matches <= 0) 88 | return DBL_MAX; 89 | return total_difference / num_matches; 90 | } 91 | 92 | // Adds the metric_events of the second ClusterEntity, ignores 93 | // any possible entity this is represented (entity field in classs) 94 | ClusterEntity& ClusterEntity::operator+(const ClusterEntity & other) 95 | { 96 | int offset = 0; 97 | if (metric_events->size() && other.metric_events->size()) 98 | { 99 | if (startStep < other.startStep) 100 | { 101 | offset = metric_events->size() - other.metric_events->size(); 102 | for (int i = 0; i < other.metric_events->size(); i++) 103 | (*metric_events)[offset + i] += other.metric_events->at(i); 104 | } 105 | else 106 | { 107 | offset = other.metric_events->size() - metric_events->size(); 108 | for (int i = 0; i < metric_events->size(); i++) 109 | (*metric_events)[i] += other.metric_events->at(offset + i); 110 | for (int i = offset - 1; i >= 0; i--) 111 | metric_events->prepend(other.metric_events->at(i)); 112 | startStep = other.startStep; 113 | } 114 | } 115 | else if (other.metric_events->size()) 116 | { 117 | startStep = other.startStep; 118 | for (int i = 0; i < other.metric_events->size(); i++) 119 | metric_events->append(other.metric_events->at(i)); 120 | } 121 | 122 | 123 | return *this; 124 | } 125 | 126 | ClusterEntity& ClusterEntity::operator/(const int divisor) 127 | { 128 | for (int i = 0; i < metric_events->size(); i++) 129 | { 130 | (*metric_events)[i] /= divisor; 131 | } 132 | return *this; 133 | } 134 | 135 | ClusterEntity& ClusterEntity::operator=(const ClusterEntity & other) 136 | { 137 | entity = other.entity; 138 | startStep = other.startStep; 139 | metric_events->clear(); 140 | for (int i = 0; i < other.metric_events->size(); i++) 141 | metric_events->append(other.metric_events->at(i)); 142 | return *this; 143 | } 144 | -------------------------------------------------------------------------------- /src/clusterentity.h: -------------------------------------------------------------------------------- 1 | #ifndef CLUSTERENTITY_H 2 | #define CLUSTERENTITY_H 3 | 4 | #include 5 | 6 | class ClusterEntity 7 | { 8 | public: 9 | ClusterEntity(); 10 | ClusterEntity(unsigned long _e, int _step); 11 | ClusterEntity(const ClusterEntity& other); 12 | ~ClusterEntity(); 13 | 14 | unsigned long entity; 15 | int startStep; // What step our metric_events starts at 16 | 17 | // Representative vector of events for clustering. This is contiguous 18 | // so all missing steps should be filled in with their previous lateness 19 | // value by whoever builds this ClusterEntity 20 | QVector * metric_events; 21 | 22 | ClusterEntity& operator+(const ClusterEntity &); 23 | ClusterEntity& operator/(const int); 24 | ClusterEntity& operator=(const ClusterEntity &); 25 | 26 | double calculateMetricDistance(const ClusterEntity& other) const; 27 | 28 | }; 29 | 30 | #endif // CLUSTERENTITY_H 31 | -------------------------------------------------------------------------------- /src/clusterevent.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "clusterevent.h" 26 | 27 | ClusterEvent::ClusterEvent(int _step) 28 | : step(_step), waitallrecvs(0), isends(0) 29 | { 30 | for (int i = CE_EVENT_COMM; i <= CE_EVENT_AGG; i++) 31 | { 32 | for (int j = CE_COMM_SEND; j < CE_COMM_ALL; j++) 33 | { 34 | for (int k = CE_THRESH_LOW; k < CE_THRESH_BOTH; k++) 35 | { 36 | metric[i][j][k] = 0; 37 | counts[i][j][k] = 0; 38 | } 39 | } 40 | } 41 | } 42 | 43 | ClusterEvent::ClusterEvent(const ClusterEvent& copy) 44 | { 45 | step = copy.step; 46 | waitallrecvs = copy.waitallrecvs; 47 | isends = copy.isends; 48 | for (int i = CE_EVENT_COMM; i <= CE_EVENT_AGG; i++) 49 | { 50 | for (int j = CE_COMM_SEND; j < CE_COMM_ALL; j++) 51 | { 52 | for (int k = CE_THRESH_LOW; k < CE_THRESH_BOTH; k++) 53 | { 54 | metric[i][j][k] = copy.metric[i][j][k]; 55 | counts[i][j][k] = copy.counts[i][j][k]; 56 | } 57 | } 58 | } 59 | } 60 | 61 | ClusterEvent::ClusterEvent(int _step, const ClusterEvent *copy1, 62 | const ClusterEvent *copy2) 63 | : step(_step) 64 | { 65 | waitallrecvs = copy1->waitallrecvs + copy2->waitallrecvs; 66 | isends = copy1->isends + copy2->isends; 67 | for (int i = CE_EVENT_COMM; i <= CE_EVENT_AGG; i++) 68 | { 69 | for (int j = CE_COMM_SEND; j < CE_COMM_ALL; j++) 70 | { 71 | for (int k = CE_THRESH_LOW; k < CE_THRESH_BOTH; k++) 72 | { 73 | metric[i][j][k] = copy1->metric[i][j][k] + copy2->metric[i][j][k]; 74 | counts[i][j][k] = copy1->counts[i][j][k] + copy2->counts[i][j][k]; 75 | } 76 | } 77 | } 78 | } 79 | 80 | void ClusterEvent::setMetric(int count, long long value, 81 | EventType etype, 82 | CommType ctype, 83 | Threshhold thresh) 84 | { 85 | metric[etype][ctype][thresh] = value; 86 | counts[etype][ctype][thresh] = count; 87 | } 88 | 89 | void ClusterEvent::addMetric(int count, long long value, 90 | EventType etype, 91 | CommType ctype, 92 | Threshhold thresh) 93 | { 94 | metric[etype][ctype][thresh] += value; 95 | counts[etype][ctype][thresh] += count; 96 | } 97 | 98 | long long int ClusterEvent::getMetric(EventType etype, 99 | CommType ctype, 100 | Threshhold thresh) 101 | { 102 | if (ctype == CE_COMM_ALL && thresh == CE_THRESH_BOTH) 103 | { 104 | long long int value = 0; 105 | for (int i = CE_COMM_SEND; i < CE_COMM_ALL; i++) 106 | for (int j = CE_THRESH_LOW; j < CE_THRESH_BOTH; j++) 107 | value += metric[etype][i][j]; 108 | return value; 109 | } 110 | else if (ctype == CE_COMM_ALL) 111 | { 112 | long long int value = 0; 113 | for (int i = CE_COMM_SEND; i < CE_COMM_ALL; i++) 114 | value += metric[etype][i][thresh]; 115 | return value; 116 | } 117 | else if (thresh == CE_THRESH_BOTH) 118 | { 119 | long long int value = 0; 120 | for (int i = CE_THRESH_LOW; i < CE_THRESH_BOTH; i++) 121 | value += metric[etype][ctype][i]; 122 | return value; 123 | } 124 | else 125 | return metric[etype][ctype][thresh]; 126 | } 127 | 128 | int ClusterEvent::getCount(EventType etype, 129 | CommType ctype, 130 | Threshhold thresh) 131 | { 132 | if (ctype == CE_COMM_ALL && thresh == CE_THRESH_BOTH) 133 | { 134 | int count = 0; 135 | for (int i = CE_COMM_SEND; i < CE_COMM_ALL; i++) 136 | for (int j = CE_THRESH_LOW; j < CE_THRESH_BOTH; j++) 137 | count += counts[etype][i][j]; 138 | return count; 139 | } 140 | else if (ctype == CE_COMM_ALL) 141 | { 142 | int count = 0; 143 | for (int i = CE_COMM_SEND; i < CE_COMM_ALL; i++) 144 | count += counts[etype][i][thresh]; 145 | return count; 146 | } 147 | else if (thresh == CE_THRESH_BOTH) 148 | { 149 | int count = 0; 150 | for (int i = CE_THRESH_LOW; i < CE_THRESH_BOTH; i++) 151 | count += counts[etype][ctype][i]; 152 | return count; 153 | } 154 | else 155 | return counts[etype][ctype][thresh]; 156 | } 157 | -------------------------------------------------------------------------------- /src/clusterevent.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef CLUSTEREVENT_H 26 | #define CLUSTEREVENT_H 27 | 28 | class ClusterEvent 29 | { 30 | public: 31 | ClusterEvent(int _step); 32 | 33 | ClusterEvent(const ClusterEvent& copy); 34 | ClusterEvent(int _step, const ClusterEvent * copy1, 35 | const ClusterEvent * copy2); 36 | 37 | enum EventType { CE_EVENT_COMM, CE_EVENT_AGG }; 38 | enum CommType { CE_COMM_SEND, CE_COMM_ISEND, CE_COMM_RECV, 39 | CE_COMM_WAITALL, CE_COMM_COLL, CE_COMM_ALL }; 40 | enum Threshhold { CE_THRESH_LOW, CE_THRESH_HIGH, CE_THRESH_BOTH }; 41 | 42 | void setMetric(int count, long long int value, 43 | EventType etype = CE_EVENT_COMM, 44 | CommType ctype = CE_COMM_SEND, 45 | Threshhold thresh = CE_THRESH_LOW); 46 | void addMetric(int count, long long int value, 47 | EventType etype = CE_EVENT_COMM, 48 | CommType ctype = CE_COMM_SEND, 49 | Threshhold thresh = CE_THRESH_LOW); 50 | long long int getMetric(EventType etype = CE_EVENT_COMM, 51 | CommType ctype = CE_COMM_ALL, 52 | Threshhold thresh = CE_THRESH_BOTH); 53 | int getCount(EventType etype = CE_EVENT_COMM, 54 | CommType ctype = CE_COMM_ALL, 55 | Threshhold thresh = CE_THRESH_BOTH); 56 | 57 | int step; 58 | int waitallrecvs; // How many individual receives there are 59 | int isends; 60 | long long int metric[2][5][2]; // [COMM/AGG] [SEND/RECV/WAITALL/COLL] [LOW/HIGH] 61 | 62 | // This counts a waitall as a single event rather than all the receives 63 | int counts[2][5][2]; 64 | }; 65 | 66 | #endif // CLUSTEREVENT_H 67 | -------------------------------------------------------------------------------- /src/clustertreevis.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "clustertreevis.h" 26 | #include "gnome.h" 27 | 28 | ClusterTreeVis::ClusterTreeVis(QWidget *parent, VisOptions * _options) 29 | : VisWidget(parent, _options), 30 | gnome(NULL) 31 | { 32 | backgroundColor = palette().color(QPalette::Background); 33 | setAutoFillBackground(true); 34 | } 35 | 36 | // We do everything based on the active gnome which is set here. 37 | // This vis does not keep track of anything else like the others do 38 | void ClusterTreeVis::setGnome(Gnome * _gnome) 39 | { 40 | gnome = _gnome; 41 | //repaint(); 42 | } 43 | 44 | // We'll let the active gnome handle this 45 | void ClusterTreeVis::qtPaint(QPainter *painter) 46 | { 47 | if (!visProcessed) 48 | return; 49 | 50 | if (gnome) 51 | { 52 | gnome->drawTopLabels(painter, rect()); 53 | gnome->drawQtTree(painter, rect()); 54 | } 55 | 56 | } 57 | 58 | // Pass to active gnome 59 | void ClusterTreeVis::mouseDoubleClickEvent(QMouseEvent * event) 60 | { 61 | if (gnome) 62 | { 63 | gnome->handleTreeDoubleClick(event); 64 | changeSource = true; 65 | emit(clusterChange()); 66 | repaint(); 67 | } 68 | } 69 | 70 | // Sometimes this is the same on systems, sometimes not 71 | void ClusterTreeVis::mousePressEvent(QMouseEvent * event) 72 | { 73 | mouseDoubleClickEvent(event); 74 | } 75 | 76 | // Active cluster/gnome to paint 77 | void ClusterTreeVis::clusterChanged() 78 | { 79 | if (changeSource) 80 | { 81 | changeSource = false; 82 | return; 83 | } 84 | 85 | repaint(); 86 | } 87 | -------------------------------------------------------------------------------- /src/clustertreevis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef CLUSTERTREEVIS_H 26 | #define CLUSTERTREEVIS_H 27 | 28 | #include "viswidget.h" 29 | 30 | class ClusterTreeVis : public VisWidget 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit ClusterTreeVis(QWidget *parent = 0, 35 | VisOptions * _options = new VisOptions()); 36 | Gnome * getGnome() { return gnome; } 37 | 38 | signals: 39 | void clusterChange(); 40 | 41 | public slots: 42 | void setGnome(Gnome * _gnome); 43 | void clusterChanged(); 44 | 45 | protected: 46 | void qtPaint(QPainter *painter); 47 | void mouseDoubleClickEvent(QMouseEvent * event); 48 | void mousePressEvent(QMouseEvent * event); 49 | 50 | private: 51 | Gnome * gnome; 52 | }; 53 | 54 | #endif // CLUSTERTREEVIS_H 55 | -------------------------------------------------------------------------------- /src/clustervis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef CLUSTERVIS_H 26 | #define CLUSTERVIS_H 27 | 28 | #include "timelinevis.h" 29 | 30 | class ClusterTreeVis; 31 | class PartitionCluster; 32 | 33 | class ClusterVis : public TimelineVis 34 | { 35 | Q_OBJECT 36 | public: 37 | ClusterVis(ClusterTreeVis * ctv, QWidget* parent = 0, 38 | VisOptions *_options = new VisOptions()); 39 | ~ClusterVis() {} 40 | void setTrace(Trace * t); 41 | 42 | void mouseMoveEvent(QMouseEvent * event); 43 | void wheelEvent(QWheelEvent * event); 44 | 45 | signals: 46 | void focusGnome(); // used by clustertreevis 47 | void clusterChange(); // for cluster selection 48 | void neighborChange(int); // change neighborhood radius for top processes 49 | 50 | public slots: 51 | void setSteps(float start, float stop, bool jump = false); 52 | void clusterChanged(); // for cluster selection 53 | void changeNeighborRadius(int neighbors); // neighborhood radius of top processes 54 | void selectEvent(Event * event, bool aggregate, bool overdraw); 55 | 56 | protected: 57 | void qtPaint(QPainter *painter); 58 | void drawNativeGL(); 59 | void paintEvents(QPainter *painter); 60 | void prepaint(); 61 | void mouseDoubleClickEvent(QMouseEvent * event); 62 | 63 | QMap drawnGnomes; 64 | PartitionCluster * selected; 65 | ClusterTreeVis * treevis; 66 | Gnome * hover_gnome; 67 | 68 | }; 69 | 70 | #endif // CLUSTERVIS_H 71 | -------------------------------------------------------------------------------- /src/collectiveevent.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COLLECTIVEEVENT_H 26 | #define COLLECTIVEEVENT_H 27 | 28 | #include "commevent.h" 29 | #include "collectiverecord.h" 30 | 31 | class CollectiveEvent : public CommEvent 32 | { 33 | public: 34 | CollectiveEvent(unsigned long long _enter, unsigned long long _exit, 35 | int _function, int _entity, int _pe, int _phase, 36 | CollectiveRecord * _collective); 37 | ~CollectiveEvent(); 38 | 39 | // We count the collective as two since it serves as both the beginning 40 | // and ending of some sort of communication while P2P communication 41 | // events are either the begin (send) or the end (recv) 42 | int comm_count(QMap *memo = NULL) { Q_UNUSED(memo); return 2; } 43 | 44 | bool isP2P() { return false; } 45 | bool isReceive() { return false; } 46 | virtual bool isCollective() { return true; } 47 | void fixPhases(); 48 | void initialize_strides(QList * stride_events, 49 | QList * recv_events); 50 | void initialize_basic_strides(QSet *collectives); 51 | void update_basic_strides(); 52 | bool calculate_local_step(); 53 | void writeToOTF2(OTF2_EvtWriter * writer, QMap * attributeMap); 54 | 55 | void addComms(QSet * bundleset) { bundleset->insert(collective); } 56 | QList neighborEntities(); 57 | CollectiveRecord * getCollective() { return collective; } 58 | QSet * mergeForMessagesHelper(); 59 | 60 | ClusterEvent * createClusterEvent(QString metric, long long divider); 61 | void addToClusterEvent(ClusterEvent * ce, QString metric, 62 | long long divider); 63 | 64 | CollectiveRecord * collective; 65 | 66 | private: 67 | void set_stride_relationships(); 68 | }; 69 | 70 | #endif // COLLECTIVEEVENT_H 71 | -------------------------------------------------------------------------------- /src/collectiverecord.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "collectiverecord.h" 26 | #include "commevent.h" 27 | #include "collectiveevent.h" 28 | #include "viswidget.h" 29 | 30 | CollectiveRecord::CollectiveRecord(unsigned long long _matching, 31 | unsigned int _root, 32 | unsigned int _collective, 33 | unsigned int _entitygroup) 34 | : CommBundle(), 35 | matchingId(_matching), 36 | root(_root), 37 | collective(_collective), 38 | entitygroup(_entitygroup), 39 | mark(false), 40 | events(new QList()) 41 | 42 | { 43 | } 44 | 45 | 46 | CommEvent * CollectiveRecord::getDesignee() 47 | { 48 | return events->first(); 49 | } 50 | 51 | 52 | void CollectiveRecord::draw(QPainter * painter, CommDrawInterface *vis) 53 | { 54 | vis->drawCollective(painter, this); 55 | } 56 | 57 | // Return stride set to this collective. Will return zero if cannot set. 58 | int CollectiveRecord::set_basic_strides() 59 | { 60 | int max_stride; 61 | for (QList::Iterator evt = events->begin(); 62 | evt != events->end(); ++evt) 63 | { 64 | for (QSet::Iterator parent = (*evt)->stride_parents->begin(); 65 | parent != (*evt)->stride_parents->end(); ++parent) 66 | { 67 | if (!((*parent)->stride)) // Equals zero meaning its unset 68 | return 0; 69 | else if ((*parent)->stride > max_stride) 70 | max_stride = (*parent)->stride; 71 | } 72 | } 73 | 74 | max_stride++; 75 | for (QList::Iterator evt = events->begin(); 76 | evt != events->end(); ++evt) 77 | { 78 | (*evt)->stride = max_stride; 79 | } 80 | return max_stride; 81 | } 82 | -------------------------------------------------------------------------------- /src/collectiverecord.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COLLECTIVERECORD_H 26 | #define COLLECTIVERECORD_H 27 | 28 | #include 29 | #include "commbundle.h" 30 | 31 | class CollectiveEvent; 32 | 33 | // Information we get from OTF about collectives 34 | class CollectiveRecord : public CommBundle 35 | { 36 | public: 37 | CollectiveRecord(unsigned long long int _matching, unsigned int _root, 38 | unsigned int _collective, unsigned int _entitygroup); 39 | 40 | unsigned long long int matchingId; 41 | unsigned int root; 42 | unsigned int collective; 43 | unsigned int entitygroup; 44 | bool mark; 45 | 46 | QList * events; 47 | 48 | CommEvent * getDesignee(); 49 | void draw(QPainter * painter, CommDrawInterface * vis); 50 | 51 | int set_basic_strides(); 52 | }; 53 | 54 | #endif // COLLECTIVERECORD_H 55 | -------------------------------------------------------------------------------- /src/colormap.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "colormap.h" 26 | #include 27 | 28 | // Initial color/value pair in constructor 29 | ColorMap::ColorMap(QColor color, float value, bool _categorical) 30 | : minValue(0), 31 | maxValue(1), 32 | maxClamp(1), 33 | categorical(_categorical), 34 | colors(new QVector()) 35 | { 36 | colors->push_back(new ColorValue(color, value)); 37 | } 38 | 39 | ColorMap::~ColorMap() 40 | { 41 | for (QVector::Iterator itr = colors->begin(); 42 | itr != colors->end(); ++itr) 43 | { 44 | delete *itr; 45 | *itr = NULL; 46 | } 47 | delete colors; 48 | } 49 | 50 | ColorMap::ColorMap(const ColorMap & copy) 51 | { 52 | minValue = copy.minValue; 53 | maxValue = copy.maxValue; 54 | maxClamp = copy.maxClamp; 55 | categorical = copy.categorical; 56 | colors = new QVector(); 57 | for (QVector::Iterator itr = copy.colors->begin(); 58 | itr != copy.colors->end(); ++itr) 59 | { 60 | colors->push_back(new ColorValue((*itr)->color, (*itr)->value)); 61 | } 62 | } 63 | 64 | void ColorMap::setRange(double low, double high) 65 | { 66 | minValue = low; 67 | maxValue = high; 68 | maxClamp = high; 69 | } 70 | 71 | void ColorMap::setClamp(double clamp) 72 | { 73 | maxClamp = clamp; 74 | } 75 | 76 | void ColorMap::addColor(QColor color, float stop) 77 | { 78 | bool added = false; 79 | colors->begin(); 80 | // Keep colors in order by value 81 | for (QVector::Iterator itr = colors->begin(); 82 | itr != colors->end(); ++itr) 83 | { 84 | if (stop < (*itr)->value) 85 | { 86 | colors->insert(itr, new ColorValue(color, stop)); 87 | added = true; 88 | } 89 | } 90 | if (!added) { 91 | colors->push_back(new ColorValue(color, stop)); 92 | } 93 | } 94 | 95 | QColor ColorMap::color(double value, double opacity) 96 | { 97 | // Do something else if we're categorical 98 | if (categorical) 99 | return categorical_color(value); 100 | 101 | // Find the colors at either end of the given value and blend them them 102 | ColorValue base1 = ColorValue(QColor(0,0,0,opacity*255), 0); 103 | ColorValue base2 = ColorValue(QColor(0,0,0,opacity*255), 1); 104 | ColorValue* low = &base1; 105 | ColorValue* high = &base2; 106 | double norm_value = (value - minValue) / (maxClamp - minValue); 107 | for (QVector::Iterator itr = colors->begin(); 108 | itr != colors->end(); itr++) 109 | { 110 | if ((*itr)->value > norm_value) 111 | { 112 | high = (*itr); 113 | return average(low, high, norm_value, opacity); 114 | } else { 115 | low = (*itr); 116 | } 117 | } 118 | return QColor(low->color.red(), low->color.green(), low->color.blue(), 119 | opacity*255); 120 | } 121 | 122 | // In categorical, we only take the minValue into account and the number of 123 | // input colors. This is somewhat magical and should probably be turned into 124 | // something that is more elegant and makes sense. 125 | QColor ColorMap::categorical_color(double value) 126 | { 127 | int cat_value = int(value - minValue) % colors->size(); 128 | return colors->at(cat_value)->color; 129 | } 130 | 131 | // Weighted average of two color values based on where norm falls 132 | QColor ColorMap::average(ColorValue * low, ColorValue * high, double norm, 133 | double opacity) 134 | { 135 | int r, g, b, a; 136 | float alpha = (norm - low->value) / (high->value - low->value); 137 | r = (1 - alpha) * low->color.red() + alpha * high->color.red(); 138 | g = (1 - alpha) * low->color.green() + alpha * high->color.green(); 139 | b = (1 - alpha) * low->color.blue() + alpha * high->color.blue(); 140 | a = opacity * 255; 141 | return QColor(r, g, b, a); 142 | } 143 | -------------------------------------------------------------------------------- /src/colormap.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COLORMAP_H 26 | #define COLORMAP_H 27 | 28 | #include 29 | #include 30 | 31 | class ColorMap 32 | { 33 | public: 34 | ColorMap(QColor color, float value, bool _categorical = false); 35 | ~ColorMap(); 36 | ColorMap(const ColorMap& copy); 37 | void addColor(QColor color, float stop); 38 | QColor color(double value, double opacity = 1.0); 39 | void setRange(double low, double high); 40 | void setClamp(double clamp); 41 | double getMax() { return maxValue; } 42 | bool isCategorical() { return categorical; } 43 | 44 | private: 45 | class ColorValue { 46 | public: 47 | ColorValue(QColor c, float v) { 48 | color = c; 49 | value = v; 50 | } 51 | 52 | QColor color; 53 | float value; 54 | }; 55 | 56 | QColor average(ColorValue * low, ColorValue * high, 57 | double norm, double opacity = 1.0); 58 | QColor categorical_color(double value); 59 | 60 | // metric value range 61 | double minValue; 62 | double maxValue; 63 | 64 | // temporary maximum for colormap 65 | double maxClamp; 66 | 67 | bool categorical; 68 | QVector * colors; 69 | }; 70 | 71 | #endif // COLORMAP_H 72 | -------------------------------------------------------------------------------- /src/commbundle.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COMMBUNDLE_H 26 | #define COMMBUNDLE_H 27 | 28 | class QPainter; 29 | class CommEvent; 30 | class CommDrawInterface; 31 | 32 | class CommBundle 33 | { 34 | public: 35 | virtual CommEvent * getDesignee()=0; // Event responsible 36 | virtual void draw(QPainter * painter, CommDrawInterface * vis)=0; 37 | }; 38 | 39 | #endif // COMMBUNDLE_H 40 | -------------------------------------------------------------------------------- /src/commdrawinterface.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "commdrawinterface.h" 26 | 27 | -------------------------------------------------------------------------------- /src/commdrawinterface.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COMMDRAWINTERFACE_H 26 | #define COMMDRAWINTERFACE_H 27 | 28 | class QPainter; 29 | class Message; 30 | class CollectiveRecord; 31 | class CommEvent; 32 | 33 | class CommDrawInterface 34 | { 35 | public: 36 | virtual void drawMessage(QPainter * painter, Message * message)=0; 37 | virtual void drawCollective(QPainter * painter, CollectiveRecord * cr)=0; 38 | virtual void drawDelayTracking(QPainter * painter, CommEvent * p2p)=0; 39 | }; 40 | 41 | #endif // COMMDRAWINTERFACE_H 42 | -------------------------------------------------------------------------------- /src/commrecord.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "commrecord.h" 26 | #include "message.h" 27 | #include 28 | 29 | CommRecord::CommRecord(unsigned long _s, unsigned long long int _st, 30 | unsigned long _r, unsigned long long int _rt, 31 | unsigned long long _size, unsigned int _tag, unsigned int _group, 32 | unsigned long long _request) : 33 | sender(_s), send_time(_st), receiver(_r), recv_time(_rt), 34 | size(_size), tag(_tag), group(_group), send_request(_request), 35 | send_complete(0), matched(false), message(NULL) 36 | { 37 | } 38 | 39 | 40 | bool CommRecord::operator<(const CommRecord & cr) 41 | { 42 | return send_time < cr.send_time; 43 | } 44 | 45 | bool CommRecord::operator>(const CommRecord & cr) 46 | { 47 | return send_time > cr.send_time; 48 | } 49 | 50 | bool CommRecord::operator<=(const CommRecord & cr) 51 | { 52 | return send_time <= cr.send_time; 53 | } 54 | 55 | bool CommRecord::operator>=(const CommRecord & cr) 56 | { 57 | return send_time >= cr.send_time; 58 | } 59 | 60 | bool CommRecord::operator==(const CommRecord & cr) 61 | { 62 | return send_time == cr.send_time; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/commrecord.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COMMRECORD_H 26 | #define COMMRECORD_H 27 | 28 | class Message; 29 | 30 | // Holder of OTF Comm Info 31 | class CommRecord 32 | { 33 | public: 34 | CommRecord(unsigned long _s, unsigned long long int _st, 35 | unsigned long _r, unsigned long long int _rt, 36 | unsigned long long _size, unsigned int _tag, 37 | unsigned int _group, 38 | unsigned long long int _request = 0); 39 | 40 | unsigned long sender; 41 | unsigned long long int send_time; 42 | unsigned long receiver; 43 | unsigned long long int recv_time; 44 | 45 | unsigned long long size; 46 | unsigned int tag; 47 | unsigned int type; 48 | unsigned int group; 49 | unsigned long long int send_request; 50 | unsigned long long int send_complete; 51 | bool matched; 52 | 53 | Message * message; 54 | 55 | bool operator<(const CommRecord &); 56 | bool operator>(const CommRecord &); 57 | bool operator<=(const CommRecord &); 58 | bool operator>=(const CommRecord &); 59 | bool operator==(const CommRecord &); 60 | }; 61 | 62 | #endif // COMMRECORD_H 63 | -------------------------------------------------------------------------------- /src/counter.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "counter.h" 26 | 27 | Counter::Counter(int _id, QString _name, QString _unit) 28 | : id(_id), 29 | name(_name), 30 | unit(_unit) 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/counter.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COUNTER_H 26 | #define COUNTER_H 27 | 28 | #include 29 | 30 | class Counter 31 | { 32 | public: 33 | Counter(int _id, QString _name, QString _unit); 34 | 35 | unsigned int id; 36 | QString name; 37 | QString unit; 38 | }; 39 | 40 | #endif // COUNTER_H 41 | -------------------------------------------------------------------------------- /src/counterrecord.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "counterrecord.h" 26 | 27 | CounterRecord::CounterRecord(unsigned int _counter, unsigned long long _time, unsigned long long _value) 28 | : counter(_counter), 29 | time(_time), 30 | value(_value) 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/counterrecord.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef COUNTERRECORD_H 26 | #define COUNTERRECORD_H 27 | 28 | class CounterRecord 29 | { 30 | public: 31 | CounterRecord(unsigned int _counter, unsigned long long _time, 32 | unsigned long long _value); 33 | 34 | unsigned int counter; 35 | unsigned long long time; 36 | unsigned long long value; 37 | }; 38 | 39 | #endif // COUNTERRECORD_H 40 | -------------------------------------------------------------------------------- /src/entity.cpp: -------------------------------------------------------------------------------- 1 | #include "entity.h" 2 | 3 | Entity::Entity(unsigned long _id, QString _name, PrimaryEntityGroup *_primary) 4 | : id(_id), 5 | name(_name), 6 | primary(_primary) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/entity.h: -------------------------------------------------------------------------------- 1 | #ifndef ENTITY_H 2 | #define ENTITY_H 3 | 4 | #include 5 | 6 | class PrimaryEntityGroup; 7 | 8 | class Entity 9 | { 10 | public: 11 | Entity(unsigned long _id, QString _name, PrimaryEntityGroup * _primary); 12 | 13 | unsigned long id; 14 | QString name; 15 | 16 | PrimaryEntityGroup * primary; 17 | }; 18 | 19 | #endif // ENTITY_H 20 | -------------------------------------------------------------------------------- /src/entitygroup.cpp: -------------------------------------------------------------------------------- 1 | #include "entitygroup.h" 2 | 3 | EntityGroup::EntityGroup(int _id, QString _name) 4 | : id(_id), 5 | name(_name), 6 | entities(new QList()), 7 | entityorder(new QMap()) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /src/entitygroup.h: -------------------------------------------------------------------------------- 1 | #ifndef ENTITYGROUP_H 2 | #define ENTITYGROUP_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | // This class is for sub-groupings and reorderings of existing PrimaryEntityGroups. 9 | class EntityGroup 10 | { 11 | public: 12 | EntityGroup(int _id, QString _name); 13 | ~EntityGroup() { delete entities; delete entityorder; } 14 | 15 | int id; 16 | QString name; 17 | // May need to keep additional names if we have several that are the same 18 | 19 | // This order is important for communicator rank ID 20 | QList * entities; 21 | QMap * entityorder; 22 | }; 23 | 24 | #endif // ENTITYGROUP_H 25 | -------------------------------------------------------------------------------- /src/event.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "event.h" 26 | #include "function.h" 27 | #include "metrics.h" 28 | #include "rpartition.h" 29 | #include 30 | 31 | Event::Event(unsigned long long _enter, unsigned long long _exit, 32 | int _function, unsigned long _entity, unsigned long _pe) 33 | : caller(NULL), 34 | callees(new QVector()), 35 | enter(_enter), 36 | exit(_exit), 37 | function(_function), 38 | entity(_entity), 39 | pe(_pe), 40 | depth(-1), 41 | metrics(new Metrics()) 42 | { 43 | 44 | } 45 | 46 | Event::~Event() 47 | { 48 | delete metrics; 49 | if (callees) 50 | delete callees; 51 | } 52 | 53 | bool Event::operator<(const Event &event) 54 | { 55 | if (enter == event.enter) 56 | { 57 | if (this->isReceive()) 58 | return true; 59 | else 60 | return false; 61 | } 62 | return enter < event.enter; 63 | } 64 | 65 | bool Event::operator>(const Event &event) 66 | { 67 | if (enter == event.enter) 68 | { 69 | if (this->isReceive()) 70 | return false; 71 | else 72 | return true; 73 | } 74 | return enter > event.enter; 75 | } 76 | 77 | bool Event::operator<=(const Event &event) 78 | { 79 | return enter <= event.enter; 80 | } 81 | 82 | bool Event::operator>=(const Event &event) 83 | { 84 | return enter >= event.enter; 85 | } 86 | 87 | bool Event::operator==(const Event &event) 88 | { 89 | return enter == event.enter; 90 | } 91 | 92 | Event * Event::findChild(unsigned long long time) 93 | { 94 | Event * result = NULL; 95 | Event * child_match = NULL; 96 | if (enter <= time && exit >= time) 97 | { 98 | result = this; 99 | for (QVector::Iterator child = callees->begin(); 100 | child != callees->end(); ++child) 101 | { 102 | child_match = (*child)->findChild(time); 103 | if (child_match) 104 | { 105 | result = child_match; 106 | break; 107 | } 108 | } 109 | } 110 | return result; 111 | } 112 | 113 | unsigned long long Event::getVisibleEnd(unsigned long long start) 114 | { 115 | unsigned long long end = exit; 116 | for (QVector::Iterator child = callees->begin(); 117 | child != callees->end(); ++child) 118 | { 119 | if ((*child)->enter > start) 120 | { 121 | end = (*child)->enter; 122 | break; 123 | } 124 | } 125 | return end; 126 | } 127 | 128 | // Check if this Event and the argument Event share the same subtree: 129 | // If they're not the same event, then either this event is in the 130 | // subtree of the second or vice versa. 131 | bool Event::same_subtree(Event * second) 132 | { 133 | if (second == this) 134 | return true; 135 | 136 | Event * first = this; 137 | if (first->depth < second->depth) 138 | { 139 | while (first->depth < second->depth && second->caller) 140 | { 141 | second = second->caller; 142 | if (first == second) 143 | return true; 144 | } 145 | } 146 | else 147 | { 148 | while (first->depth > second->depth && first->caller) 149 | { 150 | first = first->caller; 151 | if (first == second) 152 | return true; 153 | } 154 | } 155 | 156 | return false; 157 | } 158 | 159 | // Find the ancestor that has at least two communications inside of it. 160 | Event * Event::least_multiple_caller(QMap * memo) 161 | { 162 | Event * caller = this; 163 | while (caller && caller->comm_count(memo) <= 1) 164 | { 165 | caller = caller->caller; 166 | } 167 | return caller; 168 | } 169 | 170 | Event * Event::least_multiple_function_caller(QMap * functions) 171 | { 172 | if (functions->value(function)->comms > 1) 173 | return this; 174 | 175 | if (!caller) 176 | return NULL; 177 | 178 | return caller->least_multiple_function_caller(functions); 179 | } 180 | 181 | 182 | // Calculate the number of communications that fall under this node 183 | // in the call tree. 184 | int Event::comm_count(QMap * memo) 185 | { 186 | if (memo && memo->contains(this)) 187 | return memo->value(this); 188 | 189 | int count = 0; 190 | for (QVector::Iterator child = callees->begin(); 191 | child != callees->end(); ++child) 192 | { 193 | count += (*child)->comm_count(memo); 194 | } 195 | memo->insert(this, count); 196 | return count; 197 | } 198 | 199 | void Event::writeToOTF2(OTF2_EvtWriter * writer, QMap * attributeMap) 200 | { 201 | writeOTF2Enter(writer); 202 | 203 | for (QVector::Iterator child = callees->begin(); 204 | child != callees->end(); ++child) 205 | { 206 | (*child)->writeToOTF2(writer, attributeMap); 207 | } 208 | 209 | writeOTF2Leave(writer, attributeMap); 210 | } 211 | 212 | void Event::writeOTF2Leave(OTF2_EvtWriter * writer, QMap * attributeMap) 213 | { 214 | Q_UNUSED(attributeMap); 215 | OTF2_EvtWriter_Leave(writer, 216 | NULL, 217 | exit, 218 | function); 219 | } 220 | 221 | void Event::writeOTF2Enter(OTF2_EvtWriter * writer) 222 | { 223 | OTF2_EvtWriter_Enter(writer, 224 | NULL, 225 | enter, 226 | function); 227 | } 228 | -------------------------------------------------------------------------------- /src/event.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef EVENT_H 26 | #define EVENT_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class Function; 34 | class QPainter; 35 | class CommDrawInterface; 36 | class Metrics; 37 | 38 | class Event 39 | { 40 | public: 41 | Event(unsigned long long _enter, unsigned long long _exit, int _function, 42 | unsigned long _entity, unsigned long _pe); 43 | ~Event(); 44 | 45 | // Based on enter time 46 | bool operator<(const Event &); 47 | bool operator>(const Event &); 48 | bool operator<=(const Event &); 49 | bool operator>=(const Event &); 50 | bool operator==(const Event &); 51 | static bool eventEntityLessThan(const Event * evt1, const Event * evt2) 52 | { 53 | return evt1->entity < evt2->entity; 54 | } 55 | 56 | Event * findChild(unsigned long long time); 57 | unsigned long long getVisibleEnd(unsigned long long start); 58 | bool same_subtree(Event * other); 59 | Event * least_multiple_caller(QMap * memo = NULL); 60 | Event * least_multiple_function_caller(QMap * functions); 61 | virtual int comm_count(QMap * memo = NULL); 62 | virtual void track_delay(QPainter *painter, CommDrawInterface * vis) 63 | { Q_UNUSED(painter); Q_UNUSED(vis); } 64 | virtual bool isCommEvent() { return false; } 65 | virtual bool isReceive() const { return false; } 66 | virtual bool isCollective() { return false; } 67 | virtual void writeToOTF2(OTF2_EvtWriter * writer, QMap * attributeMap); 68 | virtual void writeOTF2Leave(OTF2_EvtWriter * writer, QMap * attributeMap); 69 | virtual void writeOTF2Enter(OTF2_EvtWriter * writer); 70 | 71 | // Call tree info 72 | Event * caller; 73 | QVector * callees; 74 | 75 | unsigned long long enter; 76 | unsigned long long exit; 77 | int function; 78 | unsigned long entity; 79 | unsigned long pe; 80 | int depth; 81 | 82 | Metrics * metrics; // Lateness or Counters etc 83 | }; 84 | 85 | #endif // EVENT_H 86 | -------------------------------------------------------------------------------- /src/eventrecord.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "eventrecord.h" 26 | #include "event.h" 27 | 28 | EventRecord::EventRecord(unsigned long _entity, unsigned long long int _t, 29 | unsigned int _v, bool _e) 30 | : entity(_entity), 31 | time(_t), 32 | value(_v), 33 | enter(_e), 34 | children(QList()), 35 | metrics(NULL), 36 | ravel_info(NULL) 37 | { 38 | } 39 | 40 | EventRecord::~EventRecord() 41 | { 42 | if (metrics) 43 | delete metrics; 44 | if (ravel_info) 45 | delete ravel_info; 46 | } 47 | 48 | bool EventRecord::operator<(const EventRecord &event) 49 | { 50 | return enter < event.enter; 51 | } 52 | 53 | bool EventRecord::operator>(const EventRecord &event) 54 | { 55 | return enter > event.enter; 56 | } 57 | 58 | bool EventRecord::operator<=(const EventRecord &event) 59 | { 60 | return enter <= event.enter; 61 | } 62 | 63 | bool EventRecord::operator>=(const EventRecord &event) 64 | { 65 | return enter >= event.enter; 66 | } 67 | 68 | bool EventRecord::operator==(const EventRecord &event) 69 | { 70 | return enter == event.enter; 71 | } 72 | -------------------------------------------------------------------------------- /src/eventrecord.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef EVENTRECORD_H 26 | #define EVENTRECORD_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class Event; 33 | 34 | // Holder for OTF Event info 35 | class EventRecord 36 | { 37 | public: 38 | EventRecord(unsigned long _entity, unsigned long long int _t, unsigned int _v, bool _e = true); 39 | ~EventRecord(); 40 | 41 | unsigned long entity; 42 | unsigned long long int time; 43 | unsigned int value; 44 | bool enter; 45 | QList children; 46 | QMap * metrics; 47 | QMap * ravel_info; 48 | 49 | // Based on time 50 | bool operator<(const EventRecord &); 51 | bool operator>(const EventRecord &); 52 | bool operator<=(const EventRecord &); 53 | bool operator>=(const EventRecord &); 54 | bool operator==(const EventRecord &); 55 | }; 56 | 57 | #endif // EVENTRECORD_H 58 | -------------------------------------------------------------------------------- /src/exchangegnome.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef EXCHANGEGNOME_H 26 | #define EXCHANGEGNOME_H 27 | 28 | #include "gnome.h" 29 | #include 30 | #include 31 | #include 32 | 33 | class QPainter; 34 | class PartitionCluster; 35 | 36 | // Gnome with detector & special drawing functions for exchange patterns 37 | class ExchangeGnome : public Gnome 38 | { 39 | public: 40 | ExchangeGnome(); 41 | 42 | bool detectGnome(Partition * part); 43 | Gnome * create(); 44 | void preprocess(); 45 | 46 | protected: 47 | void drawGnomeQtClusterEnd(QPainter * painter, QRect clusterRect, 48 | PartitionCluster * pc, 49 | int barwidth, int barheight, int blockwidth, 50 | int blockheight, int startStep); 51 | void generateTopEntities(); 52 | 53 | private: 54 | // send-receive, sends-receives, sends-waitall 55 | enum ExchangeType { EXCH_SRSR, EXCH_SSRR, EXCH_SSWA, EXCH_UNKNOWN }; 56 | ExchangeType type; 57 | ExchangeType findType(); 58 | 59 | // Trying to grow SRSR patterns to capture large number of them 60 | // can be used for automatically determining neighborhood size 61 | QMap SRSRmap; 62 | QSet SRSRpatterns; 63 | 64 | int maxWAsize; // for drawing Waitall pies 65 | 66 | void drawGnomeQtClusterSRSR(QPainter * painter, QRect startxy, 67 | PartitionCluster * pc, int barwidth, 68 | int barheight, int blockwidth, int blockheight, 69 | int startStep); 70 | void drawGnomeQtClusterSSWA(QPainter * painter, QRect startxy, 71 | PartitionCluster * pc, int barwidth, 72 | int barheight, int blockwidth, int blockheight, 73 | int startStep); 74 | 75 | 76 | }; 77 | 78 | #endif // EXCHANGEGNOME_H 79 | -------------------------------------------------------------------------------- /src/function.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "function.h" 26 | 27 | Function::Function(QString _n, int _g, QString _s, int _c) 28 | : name(_n), 29 | shortname(_s), 30 | group(_g), 31 | comms(_c), 32 | isMain(false) 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /src/function.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef FUNCTION_H 26 | #define FUNCTION_H 27 | 28 | #include 29 | 30 | // Information about function calls from OTF 31 | class Function 32 | { 33 | public: 34 | Function(QString _n, int _g, QString _s = "", int _c = 0); 35 | 36 | QString name; 37 | QString shortname; 38 | int group; 39 | int comms; // max comms in a function 40 | bool isMain; 41 | }; 42 | 43 | #endif // FUNCTION_H 44 | -------------------------------------------------------------------------------- /src/gnome2.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://scalability-llnl.github.io/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "gnome2.h" 26 | 27 | Gnome2::Gnome2() 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /src/gnome2.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://scalability-llnl.github.io/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef GNOME2_H 26 | #define GNOME2_H 27 | 28 | #include "partition.h" 29 | 30 | // Gnomes are smaller than Dwarves 31 | class Gnome2 32 | { 33 | public: 34 | Gnome2(); 35 | 36 | virtual bool detectGnome(Partition * part); 37 | }; 38 | 39 | #endif // GNOME2_H 40 | -------------------------------------------------------------------------------- /src/importfunctor.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "importfunctor.h" 26 | #include "charmimporter.h" 27 | #include "ravelutils.h" 28 | #include 29 | 30 | #include "trace.h" 31 | #include "otfconverter.h" 32 | #include "importoptions.h" 33 | #include "otf2importer.h" 34 | 35 | ImportFunctor::ImportFunctor(ImportOptions * _options) 36 | : options(_options), 37 | trace(NULL) 38 | { 39 | } 40 | 41 | void ImportFunctor::doImportCharm(QString dataFileName) 42 | { 43 | std::cout << "Processing " << dataFileName.toStdString().c_str() << std::endl; 44 | QElapsedTimer traceTimer; 45 | qint64 traceElapsed; 46 | 47 | traceTimer.start(); 48 | 49 | CharmImporter * importer = new CharmImporter(); 50 | importer->importCharmLog(dataFileName, options); 51 | 52 | Trace* trace = importer->getTrace(); 53 | delete importer; 54 | trace->fullpath = dataFileName; 55 | //delete converter; 56 | connect(trace, SIGNAL(updatePreprocess(int, QString)), this, 57 | SLOT(updatePreprocess(int, QString))); 58 | connect(trace, SIGNAL(updateClustering(int)), this, 59 | SLOT(updateClustering(int))); 60 | connect(trace, SIGNAL(startClustering()), this, SLOT(switchProgress())); 61 | trace->preprocess(options); 62 | 63 | traceElapsed = traceTimer.nsecsElapsed(); 64 | RavelUtils::gu_printTime(traceElapsed, "Total trace: "); 65 | 66 | emit(done(trace)); 67 | } 68 | 69 | void ImportFunctor::doImportOTF2(QString dataFileName) 70 | { 71 | std::cout << "Processing " << dataFileName.toStdString().c_str() << std::endl; 72 | QElapsedTimer traceTimer; 73 | qint64 traceElapsed; 74 | 75 | traceTimer.start(); 76 | 77 | OTFConverter * importer = new OTFConverter(); 78 | connect(importer, SIGNAL(finishRead()), this, SLOT(finishInitialRead())); 79 | connect(importer, SIGNAL(matchingUpdate(int, QString)), this, 80 | SLOT(updateMatching(int, QString))); 81 | Trace* trace = importer->importOTF2(dataFileName, options); 82 | delete importer; 83 | 84 | if (trace) 85 | { 86 | connect(trace, SIGNAL(updatePreprocess(int, QString)), this, 87 | SLOT(updatePreprocess(int, QString))); 88 | connect(trace, SIGNAL(updateClustering(int)), this, 89 | SLOT(updateClustering(int))); 90 | connect(trace, SIGNAL(startClustering()), this, SLOT(switchProgress())); 91 | if (trace->options.origin == ImportOptions::OF_SAVE_OTF2) 92 | trace->preprocessFromSaved(); 93 | else 94 | trace->preprocess(options); 95 | } 96 | 97 | traceElapsed = traceTimer.nsecsElapsed(); 98 | RavelUtils::gu_printTime(traceElapsed, "Total trace: "); 99 | 100 | emit(done(trace)); 101 | } 102 | 103 | void ImportFunctor::doImportOTF(QString dataFileName) 104 | { 105 | #ifdef OTF1LIB 106 | std::cout << "Processing " << dataFileName.toStdString().c_str() << std::endl; 107 | QElapsedTimer traceTimer; 108 | qint64 traceElapsed; 109 | 110 | traceTimer.start(); 111 | 112 | OTFConverter * importer = new OTFConverter(); 113 | connect(importer, SIGNAL(finishRead()), this, SLOT(finishInitialRead())); 114 | connect(importer, SIGNAL(matchingUpdate(int, QString)), this, 115 | SLOT(updateMatching(int, QString))); 116 | Trace* trace = importer->importOTF(dataFileName, options); 117 | delete importer; 118 | 119 | if (trace) 120 | { 121 | connect(trace, SIGNAL(updatePreprocess(int, QString)), this, 122 | SLOT(updatePreprocess(int, QString))); 123 | connect(trace, SIGNAL(updateClustering(int)), this, 124 | SLOT(updateClustering(int))); 125 | connect(trace, SIGNAL(startClustering()), this, SLOT(switchProgress())); 126 | trace->preprocess(options); 127 | } 128 | 129 | traceElapsed = traceTimer.nsecsElapsed(); 130 | RavelUtils::gu_printTime(traceElapsed, "Total trace: "); 131 | 132 | emit(done(trace)); 133 | #endif 134 | } 135 | 136 | void ImportFunctor::finishInitialRead() 137 | { 138 | emit(reportProgress(25, "Constructing events...")); 139 | } 140 | 141 | void ImportFunctor::updateMatching(int portion, QString msg) 142 | { 143 | emit(reportProgress(25 + portion, msg)); 144 | } 145 | 146 | void ImportFunctor::updatePreprocess(int portion, QString msg) 147 | { 148 | emit(reportProgress(50 + portion / 2.0, msg)); 149 | } 150 | 151 | void ImportFunctor::updateClustering(int portion) 152 | { 153 | emit(reportClusterProgress(portion, "Clustering...")); 154 | } 155 | 156 | void ImportFunctor::switchProgress() 157 | { 158 | emit(switching()); 159 | } 160 | -------------------------------------------------------------------------------- /src/importfunctor.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef IMPORTFUNCTOR_H 26 | #define IMPORTFUNCTOR_H 27 | 28 | #include 29 | #include 30 | 31 | class Trace; 32 | class ImportOptions; 33 | 34 | // Handle signaling for progress bar 35 | class ImportFunctor : public QObject 36 | { 37 | Q_OBJECT 38 | public: 39 | ImportFunctor(ImportOptions * _options); 40 | Trace * getTrace() { return trace; } 41 | 42 | public slots: 43 | void doImportOTF(QString dataFileName); 44 | void doImportOTF2(QString dataFileName); 45 | void doImportCharm(QString dataFileName); 46 | void finishInitialRead(); 47 | void updateMatching(int portion, QString msg); 48 | void updatePreprocess(int portion, QString msg); 49 | void updateClustering(int portion); 50 | void switchProgress(); 51 | 52 | signals: 53 | void switching(); 54 | void done(Trace *); 55 | void reportProgress(int, QString); 56 | void reportClusterProgress(int, QString); 57 | 58 | private: 59 | ImportOptions * options; 60 | Trace * trace; 61 | }; 62 | 63 | #endif // IMPORTFUNCTOR_H 64 | -------------------------------------------------------------------------------- /src/importoptions.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef IMPORTOPTIONS_H 26 | #define IMPORTOPTIONS_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | // Container for all the structure extraction options 33 | class ImportOptions 34 | { 35 | public: 36 | ImportOptions(bool _waitall = true, 37 | bool _leap = false, bool _skip = false, 38 | bool _partition = false, QString _fxn = ""); 39 | 40 | // Annoying stuff for cramming into OTF2 format 41 | QList getOptionNames(); 42 | QString getOptionValue(QString option); 43 | void setOption(QString option, QString value); 44 | void saveSettings(QSettings * settings); 45 | void readSettings(QSettings * settings); 46 | 47 | enum OriginFormat { OF_NONE, OF_SAVE_OTF2, OF_OTF2, OF_OTF, OF_CHARM }; 48 | 49 | bool waitallMerge; // use waitall heuristic 50 | bool callerMerge; // merge for common callers 51 | bool leapMerge; // merge to complete leaps 52 | bool leapSkip; // but skip if you can't gain processes 53 | bool partitionByFunction; // partitions based on functions 54 | bool globalMerge; // merge across steps 55 | bool cluster; // clustering on gnomes should be done 56 | bool isendCoalescing; // group consecutive isends 57 | bool enforceMessageSizes; // send/recv size must match 58 | 59 | bool seedClusters; // seed has been set 60 | long clusterSeed; // random seed for clustering 61 | 62 | bool advancedStepping; // send structure over receives 63 | bool reorderReceives; // idealized receive order; 64 | 65 | OriginFormat origin; 66 | QString partitionFunction; 67 | QString breakFunctions; 68 | 69 | }; 70 | 71 | #endif // OTFIMPORTOPTIONS_H 72 | -------------------------------------------------------------------------------- /src/importoptionsdialog.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef IMPORTOPTIONSDIALOG_H 26 | #define IMPORTOPTIONSDIALOG_H 27 | 28 | #include 29 | #include "importoptions.h" 30 | 31 | // GUI to set import options, must functions are GUI handlers 32 | namespace Ui { 33 | class ImportOptionsDialog; 34 | } 35 | 36 | class ImportOptionsDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | explicit ImportOptionsDialog(QWidget *parent = 0, 42 | ImportOptions * _options = NULL); 43 | ~ImportOptionsDialog(); 44 | 45 | public slots: 46 | void onCancel(); 47 | void onOK(); 48 | void onPartitionByFunction(bool value); 49 | void onPartitionByHeuristic(bool value); 50 | void onWaitallMerge(bool merge); 51 | void onCallerMerge(bool merge); 52 | void onLeapMerge(bool merge); 53 | void onLeapSkip(bool skip); 54 | void onGlobalMerge(bool merge); 55 | void onIsend(bool coalesce); 56 | void onMessageSize(bool enforce); 57 | void onAdvancedStep(bool advanced); 58 | void onRecvReorder(bool reorder); 59 | void onFunctionEdit(const QString& text); 60 | void onBreakEdit(const QString& text); 61 | void onCluster(bool cluster); 62 | void onSeedEdit(const QString& text); 63 | 64 | 65 | private: 66 | Ui::ImportOptionsDialog *ui; 67 | 68 | ImportOptions * options; 69 | ImportOptions saved; 70 | 71 | void setUIState(); 72 | }; 73 | 74 | #endif // IMPORTOPTIONSDIALOG_H 75 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | /* Ravel */ 26 | #include 27 | #include "mainwindow.h" 28 | 29 | int main(int argc, char **argv) 30 | { 31 | QApplication app(argc, argv); 32 | MainWindow w; 33 | w.show(); 34 | return app.exec(); 35 | } 36 | -------------------------------------------------------------------------------- /src/mainwindow.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef MAINWINDOW_H 26 | #define MAINWINDOW_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | class Gnome; 35 | class Event; 36 | class Trace; 37 | class ImportOptions; 38 | class ImportOptionsDialog; 39 | class VisWidget; 40 | class VisOptions; 41 | class VisOptionsDialog; 42 | 43 | class QAction; 44 | class ImportFunctor; 45 | class OTF2ExportFunctor; 46 | class QProgressDialog; 47 | class QThread; 48 | class QWidget; 49 | class QCloseEvent; 50 | 51 | namespace Ui { 52 | class MainWindow; 53 | } 54 | 55 | // Mostly GUI handling. Right now also maintains all open traces 56 | // forever, but we need something better to do with that 57 | class MainWindow : public QMainWindow 58 | { 59 | Q_OBJECT 60 | 61 | public: 62 | explicit MainWindow(QWidget *parent = 0); 63 | ~MainWindow(); 64 | 65 | void closeEvent(QCloseEvent *); 66 | 67 | public slots: 68 | void launchImportOptions(); 69 | void launchVisOptions(); 70 | 71 | // Signal relays 72 | void pushSteps(float start, float stop, bool jump = false); 73 | void selectEvent(Event * event, bool aggregate, bool overdraw); 74 | void selectEntities(QList entities, Gnome *gnome); 75 | 76 | // Importing & Progress Bar 77 | void importTracebyGUI(); 78 | void traceFinished(Trace * trace); 79 | void updateProgress(int portion, QString msg); 80 | void traceSwitch(); 81 | 82 | // High level GUI update 83 | void handleSplitter(int pos, int index); 84 | void handleSideSplitter(int pos, int index); 85 | void toggleLogicalSteps(); 86 | void toggleClusteredSteps(); 87 | void togglePhysicalTime(); 88 | void toggleMetricOverview(); 89 | 90 | // Change Traces 91 | void traceTriggered(QAction * action); 92 | void closeTrace(); 93 | 94 | // Saving 95 | void saveCurrentTrace(); 96 | void exportFinished(); 97 | 98 | // Settings 99 | void writeSettings(); 100 | void readSettings(); 101 | 102 | signals: 103 | void operate(const QString &); 104 | void exportTrace(Trace *, const QString&, const QString&); 105 | 106 | private: 107 | Ui::MainWindow *ui; 108 | void importTrace(QString dataFileName); 109 | void activeTraceChanged(bool first = false); 110 | void linkSideSplitter(); 111 | void linkMainSplitter(); 112 | void setVisWidgetState(); 113 | 114 | // Saving traces & vis 115 | QList traces; 116 | QVector viswidgets; 117 | QList visactions; 118 | QVector splitterMap; 119 | QVector splitterActions; 120 | int activeTrace; 121 | 122 | // For progress bar 123 | ImportFunctor * importWorker; 124 | QThread * importThread; 125 | QProgressDialog * progress; 126 | OTF2ExportFunctor * exportWorker; 127 | QThread * exportThread; 128 | 129 | // Import Trace options 130 | ImportOptions * importoptions; 131 | ImportOptionsDialog * importdialog; 132 | 133 | // Color stuff & other vis options 134 | VisOptions * visoptions; 135 | VisOptionsDialog * visdialog; 136 | 137 | QString activetracename; 138 | 139 | QStack activetraces; 140 | QString dataDirectory; 141 | bool otf1Support; 142 | 143 | static const int OVERVIEW = 0; 144 | static const int STEPVIS = 1; 145 | static const int TIMEVIS = 2; 146 | static const int CLUSTERVIS = 3; 147 | static const int CLUSTERTREEVIS = 4; 148 | }; 149 | 150 | #endif // MAINWINDOW_H 151 | -------------------------------------------------------------------------------- /src/message.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "message.h" 26 | #include "commevent.h" 27 | #include "p2pevent.h" 28 | #include "viswidget.h" 29 | 30 | Message::Message(unsigned long long send, unsigned long long recv, int group) 31 | : CommBundle(), sender(NULL), receiver(NULL), 32 | sendtime(send), recvtime(recv), entitygroup(group), tag(0) 33 | { 34 | } 35 | 36 | bool Message::operator<(const Message &message) 37 | { 38 | return sendtime < message.sendtime; 39 | } 40 | 41 | bool Message::operator>(const Message &message) 42 | { 43 | return sendtime > message.sendtime; 44 | } 45 | 46 | bool Message::operator<=(const Message &message) 47 | { 48 | return sendtime <= message.sendtime; 49 | } 50 | 51 | bool Message::operator>=(const Message &message) 52 | { 53 | return sendtime >= message.sendtime; 54 | } 55 | 56 | bool Message::operator==(const Message &message) 57 | { 58 | return sendtime == message.sendtime; 59 | } 60 | 61 | 62 | CommEvent * Message::getDesignee() 63 | { 64 | return sender; 65 | } 66 | 67 | void Message::draw(QPainter * painter, CommDrawInterface *vis) 68 | { 69 | vis->drawMessage(painter, this); 70 | } 71 | -------------------------------------------------------------------------------- /src/message.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef MESSAGE_H 26 | #define MESSAGE_H 27 | 28 | class P2PEvent; 29 | class CommEvent; 30 | 31 | #include "commbundle.h" 32 | 33 | // Holder of message info 34 | class Message : public CommBundle 35 | { 36 | public: 37 | Message(unsigned long long send, unsigned long long recv, 38 | int group); 39 | P2PEvent * sender; 40 | P2PEvent * receiver; 41 | unsigned long long sendtime; 42 | unsigned long long recvtime; 43 | int entitygroup; 44 | unsigned int tag; 45 | unsigned long long size; 46 | 47 | CommEvent * getDesignee(); 48 | 49 | bool operator<(const Message &); 50 | bool operator>(const Message &); 51 | bool operator<=(const Message &); 52 | bool operator>=(const Message &); 53 | bool operator==(const Message &); 54 | 55 | void draw(QPainter * painter, CommDrawInterface * vis); 56 | }; 57 | 58 | #endif // MESSAGE_H 59 | -------------------------------------------------------------------------------- /src/metricrangedialog.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "metricrangedialog.h" 26 | #include "ui_metricrangedialog.h" 27 | #include 28 | 29 | MetricRangeDialog::MetricRangeDialog(QWidget *parent, long long int current, 30 | long long int original) 31 | : QDialog(parent), 32 | ui(new Ui::MetricRangeDialog), 33 | start_value(current), 34 | original_value(original) 35 | { 36 | ui->setupUi(this); 37 | 38 | ui->metricEdit->setText(QString::number(current)); 39 | connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, 40 | SLOT(onButtonClick(QAbstractButton*))); 41 | connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onOK())); 42 | connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onCancel())); 43 | } 44 | 45 | MetricRangeDialog::~MetricRangeDialog() 46 | { 47 | delete ui; 48 | } 49 | 50 | void MetricRangeDialog::onButtonClick(QAbstractButton* qab) 51 | { 52 | if (ui->buttonBox->buttonRole(qab) == QDialogButtonBox::ResetRole) 53 | { 54 | if (ui->metricEdit->text().toLongLong() != original_value) 55 | { 56 | start_value = original_value; 57 | ui->metricEdit->setText(QString::number(original_value)); 58 | emit(valueChanged(original_value)); 59 | } 60 | this->hide(); 61 | } 62 | } 63 | 64 | void MetricRangeDialog::onOK() 65 | { 66 | if (ui->metricEdit->text().toLongLong() != start_value) 67 | { 68 | start_value = ui->metricEdit->text().toLongLong(); 69 | ui->metricEdit->setText(QString::number(start_value)); 70 | emit(valueChanged(start_value)); 71 | } 72 | this->hide(); 73 | } 74 | 75 | void MetricRangeDialog::onCancel() 76 | { 77 | if (ui->metricEdit->text().toLongLong() != start_value) 78 | { 79 | ui->metricEdit->setText(QString::number(start_value)); 80 | } 81 | this->hide(); 82 | } 83 | 84 | void MetricRangeDialog::setCurrent(long long int current) 85 | { 86 | start_value = current; 87 | } 88 | -------------------------------------------------------------------------------- /src/metricrangedialog.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef METRICRANGEDIALOG_H 26 | #define METRICRANGEDIALOG_H 27 | 28 | #include 29 | 30 | class QAbstractButton; 31 | 32 | // Dialog for changing colorbar range 33 | namespace Ui { 34 | class MetricRangeDialog; 35 | } 36 | 37 | class MetricRangeDialog : public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | explicit MetricRangeDialog(QWidget *parent = 0, long long int current = 0, 43 | long long int original = 0); 44 | ~MetricRangeDialog(); 45 | void setCurrent(long long int current); 46 | 47 | signals: 48 | void valueChanged(long long int); 49 | 50 | public slots: 51 | void onButtonClick(QAbstractButton* qab); 52 | void onOK(); 53 | void onCancel(); 54 | 55 | private: 56 | Ui::MetricRangeDialog *ui; 57 | long long int start_value; 58 | long long int original_value; 59 | 60 | }; 61 | 62 | #endif // METRICRANGEDIALOG_H 63 | -------------------------------------------------------------------------------- /src/metricrangedialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | MetricRangeDialog 28 | 29 | 30 | 31 | 0 32 | 0 33 | 285 34 | 101 35 | 36 | 37 | 38 | Dialog 39 | 40 | 41 | 42 | 43 | 44 | Maximum Value: 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Horizontal 55 | 56 | 57 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | buttonBox 67 | accepted() 68 | MetricRangeDialog 69 | accept() 70 | 71 | 72 | 248 73 | 254 74 | 75 | 76 | 157 77 | 274 78 | 79 | 80 | 81 | 82 | buttonBox 83 | rejected() 84 | MetricRangeDialog 85 | reject() 86 | 87 | 88 | 316 89 | 260 90 | 91 | 92 | 286 93 | 274 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/metrics.cpp: -------------------------------------------------------------------------------- 1 | #include "metrics.h" 2 | 3 | Metrics::Metrics() 4 | : metrics(new QMap()) 5 | { 6 | } 7 | 8 | Metrics::~Metrics() 9 | { 10 | for (QMap::Iterator itr = metrics->begin(); 11 | itr != metrics->end(); ++itr) 12 | { 13 | delete itr.value(); 14 | } 15 | delete metrics; 16 | 17 | } 18 | 19 | void Metrics::addMetric(QString name, double event_value, 20 | double aggregate_value) 21 | { 22 | (*metrics)[name] = new MetricPair(event_value, aggregate_value); 23 | } 24 | 25 | void Metrics::setMetric(QString name, double event_value, 26 | double aggregate_value) 27 | { 28 | MetricPair * mp = metrics->value(name); 29 | mp->event = event_value; 30 | mp->aggregate = aggregate_value; 31 | } 32 | 33 | bool Metrics::hasMetric(QString name) 34 | { 35 | return metrics->contains(name); 36 | } 37 | 38 | double Metrics::getMetric(QString name, bool aggregate) 39 | { 40 | if (aggregate) 41 | return ((*metrics)[name])->aggregate; 42 | 43 | return ((*metrics)[name])->event; 44 | } 45 | 46 | QList Metrics::getMetricList() 47 | { 48 | QList names = QList(); 49 | for (QMap::Iterator counter = metrics->begin(); 50 | counter != metrics->end(); ++counter) 51 | { 52 | names.append(counter.key()); 53 | } 54 | return names; 55 | } 56 | -------------------------------------------------------------------------------- /src/metrics.h: -------------------------------------------------------------------------------- 1 | #ifndef METRICS_H 2 | #define METRICS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class Metrics 9 | { 10 | public: 11 | Metrics(); 12 | ~Metrics(); 13 | void addMetric(QString name, double event_value, 14 | double aggregate_value = 0); 15 | void setMetric(QString name, double event_value, 16 | double aggregate_value = 0); 17 | bool hasMetric(QString name); 18 | double getMetric(QString name, bool aggregate = false); 19 | QList getMetricList(); 20 | 21 | class MetricPair { 22 | public: 23 | MetricPair(double _e, double _a) 24 | : event(_e), aggregate(_a) {} 25 | 26 | double event; // value at event 27 | double aggregate; // value at prev. aggregate event 28 | }; 29 | 30 | QMap * metrics; // Lateness or Counters etc 31 | }; 32 | 33 | #endif // METRICS_H 34 | -------------------------------------------------------------------------------- /src/otf2exporter.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OTF2EXPORTER_H 26 | #define OTF2EXPORTER_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class Trace; 34 | class Entity; 35 | 36 | class OTF2Exporter 37 | { 38 | public: 39 | OTF2Exporter(Trace * _t); 40 | ~OTF2Exporter(); 41 | 42 | void exportTrace(QString path, QString filename); 43 | 44 | static OTF2_FlushType 45 | pre_flush( void* userData, 46 | OTF2_FileType fileType, 47 | OTF2_LocationRef location, 48 | void* callerData, 49 | bool final ) 50 | { 51 | Q_UNUSED(userData); 52 | Q_UNUSED(fileType); 53 | Q_UNUSED(location); 54 | Q_UNUSED(callerData); 55 | Q_UNUSED(final); 56 | return OTF2_FLUSH; 57 | } 58 | 59 | static OTF2_TimeStamp 60 | post_flush( void* userData, 61 | OTF2_FileType fileType, 62 | OTF2_LocationRef location ) 63 | { 64 | Q_UNUSED(userData); 65 | Q_UNUSED(fileType); 66 | Q_UNUSED(location); 67 | return 0; 68 | } 69 | 70 | OTF2_FlushCallbacks flush_callbacks; 71 | 72 | private: 73 | Trace * trace; 74 | QList * entities; 75 | int ravel_string; 76 | int ravel_version_string; 77 | 78 | OTF2_Archive * archive; 79 | OTF2_GlobalDefWriter * global_def_writer; 80 | 81 | void exportDefinitions(); 82 | void exportStrings(); 83 | int addString(QString str, int counter); 84 | void exportAttributes(); 85 | void exportFunctions(); 86 | void exportEntities(); 87 | void exportEntityGroups(); 88 | void exportEvents(); 89 | void exportEntityEvents(unsigned long entityid); 90 | 91 | QMap inverseStringMap; 92 | QMap * attributeMap; 93 | }; 94 | 95 | #endif // OTF2EXPORTER_H 96 | -------------------------------------------------------------------------------- /src/otf2exportfunctor.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "otf2exportfunctor.h" 26 | #include "otf2exporter.h" 27 | #include "ravelutils.h" 28 | 29 | #include 30 | 31 | OTF2ExportFunctor::OTF2ExportFunctor() 32 | { 33 | } 34 | 35 | void OTF2ExportFunctor::exportTrace(Trace * trace, const QString& path, 36 | const QString& filename) 37 | { 38 | std::cout << "Exporting " << filename.toStdString().c_str() << std::endl; 39 | QElapsedTimer traceTimer; 40 | qint64 traceElapsed; 41 | 42 | traceTimer.start(); 43 | 44 | OTF2Exporter * exporter = new OTF2Exporter(trace); 45 | exporter->exportTrace(path, filename); 46 | 47 | traceElapsed = traceTimer.nsecsElapsed(); 48 | RavelUtils::gu_printTime(traceElapsed, "Total export time: "); 49 | 50 | emit(done()); 51 | } 52 | -------------------------------------------------------------------------------- /src/otf2exportfunctor.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OTF2EXPORTFUNCTOR_H 26 | #define OTF2EXPORTFUNCTOR_H 27 | 28 | #include 29 | #include 30 | 31 | class Trace; 32 | 33 | class OTF2ExportFunctor : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | OTF2ExportFunctor(); 38 | 39 | public slots: 40 | void exportTrace(Trace *, const QString&, const QString&); 41 | 42 | signals: 43 | void done(); 44 | }; 45 | 46 | #endif // OTF2EXPORTFUNCTOR_H 47 | -------------------------------------------------------------------------------- /src/otfcollective.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "otfcollective.h" 26 | 27 | OTFCollective::OTFCollective(int _id, int _type, QString _name) 28 | : id(_id), 29 | type(_type), 30 | name(_name) 31 | { 32 | } 33 | -------------------------------------------------------------------------------- /src/otfcollective.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OTFCOLLECTIVE_H 26 | #define OTFCOLLECTIVE_H 27 | 28 | #include 29 | 30 | class OTFCollective 31 | { 32 | public: 33 | OTFCollective(int _id, int _type, QString _name); 34 | 35 | int id; 36 | int type; 37 | QString name; 38 | }; 39 | 40 | #endif // OTFCOLLECTIVE_H 41 | -------------------------------------------------------------------------------- /src/otfconverter.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OTFCONVERTER_H 26 | #define OTFCONVERTER_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class RawTrace; 34 | class OTFImporter; 35 | class OTF2Importer; 36 | class ImportOptions; 37 | class Trace; 38 | class Partition; 39 | class CommEvent; 40 | class CounterRecord; 41 | class EventRecord; 42 | 43 | // Uses the raw records read from the OTF: 44 | // - switches point events into durational events 45 | // - builds call tree 46 | // - matches messages to durational events 47 | class OTFConverter : public QObject 48 | { 49 | Q_OBJECT 50 | public: 51 | OTFConverter(); 52 | ~OTFConverter(); 53 | 54 | Trace * importOTF(QString filename, ImportOptions * _options); 55 | Trace * importOTF2(QString filename, ImportOptions * _options); 56 | Trace * importCharm(RawTrace *, ImportOptions * _options); 57 | 58 | signals: 59 | void finishRead(); 60 | void matchingUpdate(int, QString); 61 | 62 | private: 63 | void convert(); 64 | void matchEvents(); 65 | void matchEventsSaved(); 66 | void makeSingletonPartition(CommEvent * evt); 67 | void addToSavedPartition(CommEvent * evt, int partition); 68 | void handleSavedAttributes(CommEvent * evt, EventRecord *er); 69 | void mergeContiguous(QList *> * groups); 70 | void mergeByMultiCaller(); 71 | int advanceCounters(CommEvent * evt, QStack * counterstack, 72 | QVector * counters, int index, 73 | QMap * lastcounters); 74 | 75 | RawTrace * rawtrace; 76 | Trace * trace; 77 | ImportOptions * options; 78 | int phaseFunction; 79 | 80 | static const int event_match_portion = 24; 81 | static const int message_match_portion = 0; 82 | static const QString collectives_string; 83 | 84 | }; 85 | 86 | #endif // OTFCONVERTER_H 87 | -------------------------------------------------------------------------------- /src/otfimporter.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OTFIMPORTER_H 26 | #define OTFIMPORTER_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include "otf.h" 33 | 34 | class CommRecord; 35 | class Function; 36 | class EntityGroup; 37 | class OTFCollective; 38 | class Counter; 39 | class CollectiveRecord; 40 | class RawTrace; 41 | class PrimaryEntityGroup; 42 | 43 | // Use OTF API to get records 44 | class OTFImporter 45 | { 46 | public: 47 | OTFImporter(); 48 | ~OTFImporter(); 49 | RawTrace * importOTF(const char* otf_file, bool _enforceMessageSize); 50 | 51 | // Handlers per OTF 52 | static int handleDefTimerResolution(void * userData, uint32_t stream, 53 | uint64_t ticksPerSecond); 54 | static int handleDefFunctionGroup(void * userData, uint32_t stream, 55 | uint32_t funcGroup, const char * name); 56 | static int handleDefFunction(void * userData, uint32_t stream, 57 | uint32_t func, const char* name, 58 | uint32_t funcGroup, uint32_t source); 59 | static int handleDefProcess(void * userData, uint32_t stream, 60 | uint32_t process, const char* name, 61 | uint32_t parent); 62 | static int handleDefCounter(void * userData, uint32_t stream, 63 | uint32_t counter, const char* name, 64 | uint32_t properties, uint32_t counterGroup, 65 | const char* unit); 66 | static int handleEnter(void * userData, uint64_t time, uint32_t function, 67 | uint32_t process, uint32_t source); 68 | static int handleLeave(void * userData, uint64_t time, uint32_t function, 69 | uint32_t process, uint32_t source); 70 | static int handleSend(void * userData, uint64_t time, uint32_t sender, 71 | uint32_t receiver, uint32_t group, uint32_t type, 72 | uint32_t length, uint32_t source); 73 | static int handleRecv(void * userData, uint64_t time, uint32_t receiver, 74 | uint32_t sender, uint32_t group, uint32_t type, 75 | uint32_t length, uint32_t source); 76 | static int handleCounter(void * userData, uint64_t time, uint32_t process, 77 | uint32_t counter, uint64_t value); 78 | static int handleDefProcessGroup(void * userData, uint32_t stream, 79 | uint32_t procGroup, const char * name, 80 | uint32_t numberOfProcs, 81 | const uint32_t * procs); 82 | static int handleDefCollectiveOperation(void * userData, uint32_t stream, 83 | uint32_t collOp, const char * name, 84 | uint32_t type); 85 | static int handleCollectiveOperation(void * userData, uint64_t time, 86 | uint32_t process, uint32_t collective, 87 | uint32_t procGroup, uint32_t rootProc, 88 | uint32_t sent, uint32_t received, 89 | uint64_t duration, uint32_t source); 90 | static int handleBeginCollectiveOperation(void * userData, uint64_t time, 91 | uint32_t process, 92 | uint32_t collective, 93 | uint64_t matchingId, 94 | uint32_t procGroup, 95 | uint32_t rootProc, uint32_t sent, 96 | uint32_t received, 97 | uint32_t scltoken, 98 | OTF_KeyValueList * list); 99 | static int handleEndCollectiveOperation(void * userData, uint64_t time, 100 | uint32_t process, 101 | uint64_t matchingId, 102 | OTF_KeyValueList * list); 103 | 104 | // Match comm record of sender and receiver to find both times 105 | static bool compareComms(CommRecord * comm, unsigned int sender, 106 | unsigned int receiver, unsigned int tag, 107 | unsigned int size); 108 | static bool compareComms(CommRecord * comm, unsigned int sender, 109 | unsigned int receiver, unsigned int tag); 110 | 111 | 112 | static uint64_t convertTime(void* userData, uint64_t time); 113 | 114 | unsigned long long int ticks_per_second; 115 | double time_conversion_factor; 116 | int num_processes; 117 | int second_magnitude; 118 | 119 | int entercount; 120 | int exitcount; 121 | int sendcount; 122 | int recvcount; 123 | 124 | private: 125 | void setHandlers(); 126 | 127 | bool enforceMessageSize; 128 | 129 | OTF_FileManager * fileManager; 130 | OTF_Reader * otfReader; 131 | OTF_HandlerArray * handlerArray; 132 | 133 | QVector *> * unmatched_recvs; 134 | QVector *> * unmatched_sends; 135 | 136 | RawTrace * rawtrace; 137 | QMap * primaries; 138 | QMap * functionGroups; 139 | QMap * functions; 140 | QMap * entitygroups; 141 | QMap * collective_definitions; 142 | QMap * counters; 143 | 144 | QMap * collectives; 145 | QVector *> * collectiveMap; 146 | 147 | }; 148 | 149 | #endif // OTFIMPORTER_H 150 | -------------------------------------------------------------------------------- /src/overviewvis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef OVERVIEWVIS_H 26 | #define OVERVIEWVIS_H 27 | 28 | #include "viswidget.h" 29 | #include 30 | 31 | class VisOptions; 32 | class QResizeEvent; 33 | class QMouseEvent; 34 | class QPainter; 35 | class Trace; 36 | 37 | // Full timeline shown by metric 38 | class OverviewVis : public VisWidget 39 | { 40 | Q_OBJECT 41 | public: 42 | OverviewVis(QWidget *parent = 0, VisOptions *_options = new VisOptions()); 43 | void setTrace(Trace * t); 44 | void processVis(); 45 | void resizeEvent(QResizeEvent * event); 46 | void mousePressEvent(QMouseEvent * event); 47 | void mouseReleaseEvent(QMouseEvent * event); 48 | void mouseMoveEvent(QMouseEvent * event); 49 | 50 | public slots: 51 | void setSteps(float start, float stop, bool jump = false); 52 | 53 | protected: 54 | void qtPaint(QPainter *painter); 55 | 56 | private: 57 | int roundeven(float step); 58 | 59 | QString cacheMetric; // So we can tell if metric changes 60 | 61 | // We can do this by time or steps, currently steps 62 | unsigned long long minTime; 63 | unsigned long long maxTime; 64 | int maxStep; 65 | int startCursor; 66 | int stopCursor; 67 | unsigned long long startTime; 68 | unsigned long long stopTime; 69 | int startStep; 70 | int stopStep; 71 | float stepWidth; 72 | int height; 73 | bool mousePressed; 74 | QVector heights; // bar heights 75 | 76 | // Map between cursor position and steps 77 | QVector > stepPositions; 78 | }; 79 | 80 | #endif // OVERVIEWVIS_H 81 | -------------------------------------------------------------------------------- /src/p2pevent.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef P2PEVENT_H 26 | #define P2PEVENT_H 27 | 28 | #include "commevent.h" 29 | 30 | class QPainter; 31 | class CommDrawInterface; 32 | 33 | class P2PEvent : public CommEvent 34 | { 35 | public: 36 | P2PEvent(unsigned long long _enter, unsigned long long _exit, 37 | int _function, int _entity, int _pe, int _phase, 38 | QVector * _messages = NULL); 39 | P2PEvent(QList * _subevents); 40 | ~P2PEvent(); 41 | 42 | // Based on enter time, add_order & receive-ness 43 | bool operator<(const P2PEvent &); 44 | bool operator>(const P2PEvent &); 45 | bool operator<=(const P2PEvent &); 46 | bool operator>=(const P2PEvent &); 47 | bool operator==(const P2PEvent &); 48 | 49 | 50 | int comm_count(QMap *memo = NULL) { Q_UNUSED(memo); return 1; } 51 | bool isP2P() { return true; } 52 | bool isReceive() const; 53 | void fixPhases(); 54 | void initialize_strides(QList * stride_events, 55 | QList * recv_events); 56 | void update_strides(); 57 | void set_reorder_strides(QMap *> * stride_map, 58 | int offset, CommEvent * last = NULL, int debug = -1); 59 | void initialize_basic_strides(QSet * collectives); 60 | void update_basic_strides(); 61 | bool calculate_local_step(); 62 | void calculate_differential_metric(QString metric_name, 63 | QString base_name, 64 | bool aggregates); 65 | void writeToOTF2(OTF2_EvtWriter * writer, QMap * attributeMap); 66 | 67 | void track_delay(QPainter *painter, CommDrawInterface * vis); 68 | CommEvent * compare_to_sender(CommEvent * prev); 69 | 70 | void addComms(QSet * bundleset); 71 | QList neighborEntities(); 72 | QVector * getMessages() { return messages; } 73 | QSet * mergeForMessagesHelper(); 74 | 75 | ClusterEvent * createClusterEvent(QString metric, long long divider); 76 | void addToClusterEvent(ClusterEvent * ce, QString metric, 77 | long long divider); 78 | 79 | // ISend coalescing 80 | QList * subevents; 81 | 82 | // Messages involved wiht this event 83 | QVector * messages; 84 | 85 | bool is_recv; 86 | 87 | private: 88 | void set_stride_relationships(CommEvent * base); 89 | }; 90 | 91 | #endif // P2PEVENT_H 92 | -------------------------------------------------------------------------------- /src/partitioncluster.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef PARTITIONCLUSTER_H 26 | #define PARTITIONCLUSTER_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class CommEvent; 34 | class ClusterEntity; 35 | class PartitionCluster; 36 | class ClusterEvent; 37 | 38 | // Cluster node of a hierarchical clustering, contains a subset of a partition 39 | class PartitionCluster 40 | { 41 | public: 42 | PartitionCluster(int num_steps, int start, long long _divider = LLONG_MAX); 43 | PartitionCluster(int member, QList *elist, QString metric, 44 | long long int _divider = LLONG_MAX); 45 | PartitionCluster(long long int distance, PartitionCluster * c1, 46 | PartitionCluster * c2); 47 | ~PartitionCluster(); 48 | long long int addMember(ClusterEntity * cp, QList *elist, 49 | QString metric); 50 | long long int distance(PartitionCluster * other); 51 | void makeClusterVectors(); 52 | 53 | // Call at root before deconstructing 54 | void delete_tree(); 55 | 56 | // Tree info, also used for vis 57 | PartitionCluster * get_root(); 58 | PartitionCluster * get_closed_root(); 59 | int max_depth(); 60 | int max_open_depth(); 61 | bool leaf_open(); 62 | int visible_clusters(); 63 | void close(); 64 | 65 | // For debug 66 | QString memberString(); 67 | void print(QString indent = ""); 68 | 69 | 70 | 71 | int startStep; 72 | int max_entity; 73 | bool open; // Whether children are drawn 74 | bool drawnOut; 75 | long long int max_distance; // max within cluster distance 76 | long long int max_metric; 77 | long long int divider; // For threshholding (currently unused) 78 | PartitionCluster * parent; 79 | QList * children; 80 | QList * members; // Entities in the cluster 81 | QList * events; // Represented events 82 | QRect extents; // Where it was drawn 83 | 84 | // Vector that has previous 'lateness' filling in steps without events 85 | QVector * cluster_vector; 86 | int clusterStart; // Starting step of the cluster_vector 87 | }; 88 | 89 | #endif // PARTITIONCLUSTER_H 90 | -------------------------------------------------------------------------------- /src/primaryentitygroup.cpp: -------------------------------------------------------------------------------- 1 | #include "primaryentitygroup.h" 2 | #include "entity.h" 3 | 4 | PrimaryEntityGroup::PrimaryEntityGroup(int _id, QString _name) 5 | : id(_id), 6 | name(_name), 7 | entities(new QList()) 8 | { 9 | } 10 | 11 | PrimaryEntityGroup::~PrimaryEntityGroup() 12 | { 13 | for (QList::Iterator entity = entities->begin(); 14 | entity != entities->end(); ++entity) 15 | { 16 | delete *entity; 17 | *entity = NULL; 18 | } 19 | delete entities; 20 | } 21 | -------------------------------------------------------------------------------- /src/primaryentitygroup.h: -------------------------------------------------------------------------------- 1 | #ifndef PRIMARYENTITYGROUP_H 2 | #define PRIMARYENTITYGROUP_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class Entity; 9 | 10 | // This is the main class for organizing entities. 11 | // In MPI traces, we'll only have one (essentially MPI_COMM_WORLD) 12 | // but in something like Charm++ we'll have many 13 | class PrimaryEntityGroup 14 | { 15 | public: 16 | PrimaryEntityGroup(int _id, QString _name); 17 | ~PrimaryEntityGroup(); 18 | 19 | int id; 20 | QString name; 21 | 22 | // This order is important for communicator rank ID 23 | QList * entities; 24 | }; 25 | 26 | #endif // PRIMARYENTITYGROUP_H 27 | -------------------------------------------------------------------------------- /src/ravelutils.h: -------------------------------------------------------------------------------- 1 | #ifndef RAVEL_UTIL_H 2 | #define RAVEL_UTIL_H 3 | 4 | #include 5 | #include 6 | 7 | // For qSorting lists of pointers 8 | template 9 | bool dereferencedLessThan(T * o1, T * o2) { 10 | return *o1 < *o2; 11 | } 12 | 13 | class RavelUtils 14 | { 15 | public: 16 | // For units 17 | static QString getUnits(int zeros) 18 | { 19 | if (zeros >= 18) 20 | return "as"; 21 | else if (zeros >= 15) 22 | return "fs"; 23 | else if (zeros >= 12) 24 | return "ps"; 25 | else if (zeros >= 9) 26 | return "ns"; 27 | else if (zeros >= 6) 28 | return "us"; 29 | else if (zeros >= 3) 30 | return "ms"; 31 | else 32 | return "s"; 33 | } 34 | 35 | // For timing information 36 | static void gu_printTime(qint64 nanos, QString label) 37 | { 38 | std::cout << label.toStdString().c_str(); 39 | double seconds = (double)nanos * 1e-9; 40 | if (seconds < 300) 41 | { 42 | std::cout << seconds << " seconds " << std::endl; 43 | return; 44 | } 45 | 46 | double minutes = seconds / 60.0; 47 | if (minutes < 300) 48 | { 49 | std::cout << minutes << " minutes " << std::endl; 50 | return; 51 | } 52 | 53 | double hours = minutes / 60.0; 54 | std::cout << hours << " hours" << std::endl; 55 | return; 56 | } 57 | }; 58 | 59 | #endif // RAVEL_UTIL_H 60 | -------------------------------------------------------------------------------- /src/rawtrace.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "rawtrace.h" 26 | 27 | #include "primaryentitygroup.h" 28 | #include "entity.h" 29 | #include "eventrecord.h" 30 | #include "commrecord.h" 31 | #include "entitygroup.h" 32 | #include "otfcollective.h" 33 | #include "collectiverecord.h" 34 | #include "function.h" 35 | #include "counter.h" 36 | #include "counterrecord.h" 37 | #include "importoptions.h" 38 | #include 39 | 40 | 41 | RawTrace::RawTrace(int nt, int np) 42 | : options(new ImportOptions()), 43 | primaries(NULL), 44 | processingElements(NULL), 45 | functionGroups(NULL), 46 | functions(NULL), 47 | events(NULL), 48 | messages(NULL), 49 | messages_r(NULL), 50 | entitygroups(NULL), 51 | collective_definitions(NULL), 52 | counters(NULL), 53 | counter_records(NULL), 54 | collectives(NULL), 55 | collectiveMap(NULL), 56 | collectiveBits(NULL), 57 | num_entities(nt), 58 | num_pes(np), 59 | second_magnitude(1), 60 | from_saved_version(""), 61 | metric_names(NULL), 62 | metric_units(NULL) 63 | { 64 | 65 | } 66 | 67 | // Note we do not delete the function/functionGroup map because 68 | // we know that will get passed to the processed trace 69 | RawTrace::~RawTrace() 70 | { 71 | for (QVector *>::Iterator eitr = events->begin(); 72 | eitr != events->end(); ++eitr) 73 | { 74 | for (QVector::Iterator itr = (*eitr)->begin(); 75 | itr != (*eitr)->end(); ++itr) 76 | { 77 | delete *itr; 78 | *itr = NULL; 79 | } 80 | delete *eitr; 81 | *eitr = NULL; 82 | } 83 | delete events; 84 | 85 | for (QVector *>::Iterator eitr = messages->begin(); 86 | eitr != messages->end(); ++eitr) 87 | { 88 | for (QVector::Iterator itr = (*eitr)->begin(); 89 | itr != (*eitr)->end(); ++itr) 90 | { 91 | delete *itr; 92 | *itr = NULL; 93 | } 94 | delete *eitr; 95 | *eitr = NULL; 96 | } 97 | delete messages; 98 | delete messages_r; 99 | 100 | for (QVector *>::Iterator eitr = collectiveBits->begin(); 101 | eitr != collectiveBits->end(); ++eitr) 102 | { 103 | for (QVector::Iterator itr = (*eitr)->begin(); 104 | itr != (*eitr)->end(); ++itr) 105 | { 106 | delete *itr; 107 | *itr = NULL; 108 | } 109 | delete *eitr; 110 | *eitr = NULL; 111 | } 112 | delete collectiveBits; 113 | 114 | delete options; 115 | 116 | if (metric_names) 117 | delete metric_names; 118 | if (metric_units) 119 | delete metric_units; 120 | } 121 | -------------------------------------------------------------------------------- /src/rawtrace.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef RAWTRACE_H 26 | #define RAWTRACE_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | class PrimaryEntityGroup; 34 | class EntityGroup; 35 | class CommRecord; 36 | class OTFCollective; 37 | class CollectiveRecord; 38 | class Function; 39 | class Counter; 40 | class CounterRecord; 41 | class EventRecord; 42 | class ImportOptions; 43 | 44 | // Trace from OTF without processing 45 | class RawTrace 46 | { 47 | public: 48 | RawTrace(int nt, int np); 49 | ~RawTrace(); 50 | 51 | class CollectiveBit { 52 | public: 53 | CollectiveBit(uint64_t _time, CollectiveRecord * _cr) 54 | : time(_time), cr(_cr) {} 55 | 56 | uint64_t time; 57 | CollectiveRecord * cr; 58 | }; 59 | 60 | ImportOptions * options; 61 | QMap * primaries; 62 | PrimaryEntityGroup * processingElements; 63 | QMap * functionGroups; 64 | QMap * functions; 65 | QVector *> * events; 66 | QVector *> * messages; 67 | QVector *> * messages_r; // by receiver instead of sender 68 | QMap * entitygroups; 69 | QMap * collective_definitions; 70 | QMap * counters; 71 | QVector *> * counter_records; 72 | 73 | QMap * collectives; 74 | QVector *> * collectiveMap; 75 | QVector *> * collectiveBits; 76 | int num_entities; 77 | int num_pes; 78 | int second_magnitude; // seconds are 10^this over the smallest smaple unit 79 | QString from_saved_version; 80 | QList * metric_names; 81 | QMap * metric_units; 82 | }; 83 | 84 | #endif // RAWTRACE_H 85 | -------------------------------------------------------------------------------- /src/rpartition.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef RPARTITION_H 26 | #define RPARTITION_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | class Gnome; 35 | class Event; 36 | class CommEvent; 37 | class ClusterEntity; 38 | class Function; 39 | class Metrics; 40 | class Trace; 41 | 42 | class Partition 43 | { 44 | public: 45 | Partition(); 46 | ~Partition(); 47 | void addEvent(CommEvent * e); 48 | void deleteEvents(); 49 | void sortEvents(); 50 | void receive_reorder(); 51 | void receive_reorder_mpi(); 52 | void finalizeEntityEventOrder(); 53 | void step(); 54 | void basic_step(); 55 | 56 | // Based on step 57 | bool operator<(const Partition &); 58 | bool operator>(const Partition &); 59 | bool operator<=(const Partition &); 60 | bool operator>=(const Partition &); 61 | bool operator==(const Partition &); 62 | 63 | void fromSaved(); 64 | 65 | // Time gap between partitions 66 | unsigned long long int distance(Partition * other); 67 | 68 | // For leap merge - which children can we merge to 69 | void calculate_dag_leap(); 70 | QString generate_process_string(); // For debugging 71 | 72 | // When we're merging, find what this merged into 73 | Partition * newest_partition(); 74 | int num_events(); 75 | 76 | // For partition ordering 77 | bool broken_entry(Partition * child); 78 | void broken_entries(QSet * repairees); 79 | void stitched_atomics(QSet * stitchees); 80 | void semantic_children(); 81 | void true_children(); 82 | void set_atomics(); 83 | bool mergable(Partition * other); 84 | QSet entity_overlap(Partition * other); 85 | Partition * earlier_partition(Partition * other, QSet overlap_entities); 86 | QSet check_entity_children(); 87 | 88 | void calculate_imbalance(int num_pes); 89 | 90 | // For debugging 91 | void output_graph(QString filename, Trace *trace); 92 | bool verify_members(); 93 | bool verify_runtime(int runtime_id); 94 | bool verify_parents(); 95 | QString get_callers(QMap * functions); 96 | 97 | // Core partition information, events per process and step summary 98 | QMap *> * events; 99 | int max_step; 100 | int max_global_step; 101 | int min_global_step; 102 | int dag_leap; 103 | bool runtime; 104 | 105 | // For message merge 106 | bool mark; 107 | 108 | // For dag / Tarjan / merging 109 | QSet * parents; 110 | QSet * children; 111 | QSet * old_parents; 112 | QSet * old_children; 113 | Partition * new_partition; 114 | int tindex; 115 | int lowlink; 116 | 117 | // For leap merge 118 | bool leapmark; 119 | QSet * group; 120 | 121 | // For charm++ atomics 122 | int min_atomic; 123 | int max_atomic; 124 | 125 | // For metrics 126 | Metrics * metrics; 127 | 128 | // For graph drawing 129 | QString gvid; 130 | 131 | // For gnome and clustering 132 | // Cluster_vectors simplify the coding of distance calculations 133 | // between processes but don't aid performance so may be wasteful 134 | Gnome * gnome; 135 | int gnome_type; 136 | QVector * cluster_entities; 137 | void makeClusterVectors(QString metric); 138 | QMap *> * cluster_vectors; 139 | QMap * cluster_step_starts; 140 | 141 | bool debug_mark; 142 | int debug_name; 143 | QMap * debug_functions; 144 | 145 | private: 146 | // Stepping logic -- probably want to rewrite 147 | int set_stride_dag(QList *stride_events); 148 | 149 | QList * free_recvs; 150 | static const bool debug = false; 151 | 152 | }; 153 | 154 | #endif // RPARTITION_H 155 | -------------------------------------------------------------------------------- /src/stepvis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef STEPVIS_H 26 | #define STEPVIS_H 27 | 28 | #include "timelinevis.h" 29 | 30 | class MetricRangeDialog; 31 | class CommEvent; 32 | 33 | // Logical timeline vis 34 | class StepVis : public TimelineVis 35 | { 36 | Q_OBJECT 37 | public: 38 | StepVis(QWidget* parent = 0, VisOptions *_options = new VisOptions()); 39 | ~StepVis(); 40 | void setTrace(Trace * t); 41 | void processVis(); 42 | 43 | void mouseMoveEvent(QMouseEvent * event); 44 | void wheelEvent(QWheelEvent * event); 45 | void mouseDoubleClickEvent(QMouseEvent * event); 46 | void rightDrag(QMouseEvent * event); 47 | 48 | // Saves colorbar range information 49 | MetricRangeDialog * metricdialog; 50 | 51 | int getHeight() { return rect().height() - colorBarHeight; } 52 | void drawMessage(QPainter * painter, Message * message); 53 | void drawCollective(QPainter * painter, CollectiveRecord * cr); 54 | void drawDelayTracking(QPainter * painter, CommEvent * c); 55 | 56 | 57 | public slots: 58 | void setSteps(float start, float stop, bool jump = false); 59 | void setMaxMetric(long long int new_max); 60 | 61 | protected: 62 | void qtPaint(QPainter *painter); 63 | void drawNativeGL(); 64 | void paintEvents(QPainter *painter); 65 | void prepaint(); 66 | void overdrawSelected(QPainter *painter, QList entities); 67 | void drawColorBarGL(); 68 | void drawColorBarText(QPainter * painter); 69 | void drawCollective(QPainter * painter, CollectiveRecord * cr, 70 | int ellipse_width, int ellipse_height, 71 | int effectiveHeight); 72 | void drawLine(QPainter * painter, QPointF * p1, QPointF * p2); 73 | void drawArc(QPainter * painter, QPointF * p1, QPointF * p2, 74 | int width, bool forward = true); 75 | void setupMetric(); 76 | void drawColorValue(QPainter * painter); 77 | int getX(CommEvent * evt); 78 | int getY(CommEvent * evt); 79 | void drawPrimaryLabels(QPainter * painter, int effectiveHeight, 80 | float barHeight); 81 | 82 | private: 83 | double maxMetric; 84 | QString cacheMetric; 85 | QString maxMetricText; 86 | QString hoverText; 87 | int maxMetricTextWidth; 88 | float colorbar_offset; 89 | QRect lassoRect; 90 | float blockwidth; 91 | float blockheight; 92 | int ellipse_width; 93 | int ellipse_height; 94 | QMap * overdrawYMap; 95 | 96 | QMap * groupColorMap; 97 | 98 | static const int colorBarHeight = 24; 99 | }; 100 | 101 | #endif // STEPVIS_H 102 | -------------------------------------------------------------------------------- /src/timelinevis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef TIMELINEVIS_H 26 | #define TIMELINEVIS_H 27 | 28 | #include "viswidget.h" 29 | 30 | // Parent class for those who pan and zoom like a timeline view 31 | class TimelineVis : public VisWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | TimelineVis(QWidget* parent = 0, VisOptions * _options = new VisOptions()); 36 | ~TimelineVis(); 37 | virtual void processVis(); 38 | 39 | void mousePressEvent(QMouseEvent * event); 40 | void mouseReleaseEvent(QMouseEvent * event); 41 | virtual void mouseDoubleClickEvent(QMouseEvent * event); 42 | void leaveEvent(QEvent * event); 43 | virtual void rightDrag(QMouseEvent * event) { Q_UNUSED(event); } 44 | 45 | public slots: 46 | virtual void selectEvent(Event * event, bool aggregate, bool overdraw); 47 | void selectEntities(QList entities, Gnome *gnome); 48 | 49 | protected: 50 | void drawHover(QPainter *painter); 51 | void drawEntityLabels(QPainter * painter, int effectiveHeight, 52 | float barHeight); 53 | 54 | bool jumped; 55 | bool mousePressed; 56 | bool rightPressed; 57 | int mousex; 58 | int mousey; 59 | int pressx; 60 | int pressy; 61 | float stepwidth; 62 | float entityheight; 63 | int labelWidth; 64 | int labelHeight; 65 | int labelDescent; 66 | int cursorWidth; 67 | 68 | int maxStep; 69 | int maxEntities; 70 | int startPartition; 71 | float startStep; 72 | float startEntity; // refers to order rather than process really 73 | float stepSpan; 74 | float entitySpan; 75 | float lastStartStep; 76 | int idleFunction; 77 | QMap proc_to_order; 78 | QMap order_to_proc; 79 | 80 | static const int spacingMinimum = 12; 81 | 82 | }; 83 | #endif // TIMELINEVIS_H 84 | -------------------------------------------------------------------------------- /src/traditionalvis.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef TRADITIONALVIS_H 26 | #define TRADITIONALVIS_H 27 | 28 | #include "timelinevis.h" 29 | #include 30 | 31 | class CommEvent; 32 | 33 | // Physical timeline 34 | class TraditionalVis : public TimelineVis 35 | { 36 | Q_OBJECT 37 | public: 38 | TraditionalVis(QWidget * parent = 0, 39 | VisOptions *_options = new VisOptions()); 40 | ~TraditionalVis(); 41 | void setTrace(Trace * t); 42 | 43 | void mouseMoveEvent(QMouseEvent * event); 44 | void wheelEvent(QWheelEvent * event); 45 | void mouseDoubleClickEvent(QMouseEvent * event); 46 | void rightDrag(QMouseEvent * event); 47 | 48 | void drawMessage(QPainter * painter, Message * message); 49 | void drawCollective(QPainter * painter, CollectiveRecord * cr); 50 | void drawDelayTracking(QPainter * painter, CommEvent * c); 51 | 52 | 53 | signals: 54 | void timeScaleString(QString); 55 | 56 | public slots: 57 | void setSteps(float start, float stop, bool jump = false); 58 | 59 | protected: 60 | void qtPaint(QPainter *painter); 61 | 62 | // Paint MPI events we handle directly and thus can color. 63 | void paintEvents(QPainter *painter); 64 | 65 | void prepaint(); 66 | void drawNativeGL(); 67 | 68 | // Paint all other events available 69 | void paintNotStepEvents(QPainter *painter, Event * evt, float position, 70 | int entity_spacing, float barheight, 71 | float blockheight, QRect * extents); 72 | 73 | private: 74 | // For keeping track of map betewen real time and step time 75 | class TimePair { 76 | public: 77 | TimePair(unsigned long long _s1, unsigned long long _s2) 78 | : start(_s1), stop(_s2) {} 79 | 80 | unsigned long long start; 81 | unsigned long long stop; 82 | }; 83 | 84 | unsigned long long minTime; 85 | unsigned long long maxTime; 86 | unsigned long long startTime; 87 | unsigned long long timeSpan; 88 | QVector * stepToTime; 89 | QRect lassoRect; 90 | float blockheight; 91 | 92 | int getX(CommEvent * evt); 93 | int getY(CommEvent * evt); 94 | int getW(CommEvent * evt); 95 | }; 96 | 97 | #endif // TRADITIONALVIS_H 98 | -------------------------------------------------------------------------------- /src/verticallabel.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "verticallabel.h" 26 | 27 | #include 28 | 29 | // Adapted from 30 | // http://stackoverflow.com/questions/9183050/vertical-qlabel-or-the-equivalent 31 | VerticalLabel::VerticalLabel(QWidget *parent) 32 | : QLabel(parent) 33 | { 34 | 35 | } 36 | 37 | VerticalLabel::VerticalLabel(const QString &text, QWidget *parent) 38 | : QLabel(text, parent) 39 | { 40 | } 41 | 42 | void VerticalLabel::paintEvent(QPaintEvent*) 43 | { 44 | QPainter painter(this); 45 | painter.setFont(QFont("Helvetica", 9)); 46 | 47 | // The offsets here are kind of magical. Perhaps a better understanding of 48 | // boundingRect is needed so we don't need to do this. 49 | QFontMetrics font_metrics = painter.fontMetrics(); 50 | int labeloffset = 9 * (sizeHint().height() 51 | - font_metrics.boundingRect(text()).width()) / 10; 52 | 53 | painter.translate( sizeHint().width() - 8, 54 | sizeHint().height() - labeloffset); 55 | painter.rotate(270); 56 | 57 | painter.drawText(0,0, text()); 58 | } 59 | 60 | QSize VerticalLabel::minimumSizeHint() const 61 | { 62 | QSize s = QLabel::minimumSizeHint(); 63 | return QSize(s.height(), s.width()); 64 | } 65 | 66 | QSize VerticalLabel::sizeHint() const 67 | { 68 | QSize s = QLabel::sizeHint(); 69 | return QSize(s.height(), s.width()); 70 | } 71 | -------------------------------------------------------------------------------- /src/verticallabel.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef VERTICALLABEL_H 26 | #define VERTICALLABEL_H 27 | 28 | #include 29 | 30 | // Adapted from: 31 | // http://stackoverflow.com/questions/9183050/vertical-qlabel-or-the-equivalent 32 | // Draw a vertical label with appropriately rotated text 33 | class VerticalLabel : public QLabel 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit VerticalLabel(QWidget *parent = 0); 38 | explicit VerticalLabel(const QString &text, QWidget *parent=0); 39 | 40 | signals: 41 | 42 | public slots: 43 | 44 | protected: 45 | void paintEvent(QPaintEvent*); 46 | QSize sizeHint() const ; 47 | QSize minimumSizeHint() const; 48 | 49 | }; 50 | 51 | #endif // VERTICALLABEL_H 52 | -------------------------------------------------------------------------------- /src/visoptions.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #include "visoptions.h" 26 | #include "colormap.h" 27 | 28 | VisOptions::VisOptions(bool _showAgg, 29 | bool _metricTraditional, 30 | QString _metric) 31 | : absoluteTime(true), 32 | showAggregateSteps(_showAgg), 33 | colorTraditionalByMetric(_metricTraditional), 34 | showMessages(MSG_TRUE), 35 | topByCentroid(false), 36 | showInactiveSteps(true), 37 | traceBack(false), 38 | metric(_metric), 39 | maptype(COLOR_DIVERGING), 40 | divergentmap(new ColorMap(QColor(173, 216, 230), 0)), 41 | rampmap(new ColorMap(QColor(255, 247, 222), 0)), 42 | catcolormap(new ColorMap(QColor(158, 218, 229), 0, true)), // divergent blue 43 | colormap(divergentmap) 44 | { 45 | 46 | // rampmap from colorbrewer 47 | rampmap->addColor(QColor(252, 141, 89), 0.5); 48 | rampmap->addColor(QColor(127, 0, 0), 1); 49 | 50 | divergentmap->addColor(QColor(240, 230, 140), 0.5); 51 | divergentmap->addColor(QColor(178, 34, 34), 1); 52 | 53 | // Cat colors from d3's category20, reordered to put less saturated first 54 | catcolormap->addColor(QColor(219, 219, 141), 0.05); // light yellow-green 55 | catcolormap->addColor(QColor(199, 199, 199), 0.1); // light gray 56 | catcolormap->addColor(QColor(255, 187, 120), 0.15); // peach 57 | catcolormap->addColor(QColor(152, 223, 138), 0.2); // light green 58 | catcolormap->addColor(QColor(196, 156, 148), 0.25); // coffee 59 | catcolormap->addColor(QColor(247, 182, 210), 0.3); // light pink 60 | catcolormap->addColor(QColor(148, 192, 189), 0.35); // light blue 61 | catcolormap->addColor(QColor(197, 176, 213), 0.4); // lavender 62 | catcolormap->addColor(QColor(140, 86, 75), 0.45); // brown 63 | catcolormap->addColor(QColor(44, 160, 44), 0.5); // quite green 64 | catcolormap->addColor(QColor(214, 39, 40), 0.55); // red 65 | catcolormap->addColor(QColor(227, 119, 194), 0.6); // magenta 66 | catcolormap->addColor(QColor(255, 152, 150), 0.65); // pink 67 | catcolormap->addColor(QColor(127, 127, 127), 0.7); // gray 68 | catcolormap->addColor(QColor(174, 119, 232), 0.75); // purple 69 | catcolormap->addColor(QColor(188, 189, 34), 0.8); // chartreuse 70 | catcolormap->addColor(QColor(255, 127, 14), 0.85); // bright orange 71 | catcolormap->addColor(QColor(23, 190, 207), 0.9); // electric blue 72 | catcolormap->addColor(QColor(31, 119, 180), 0.95); // royal blue 73 | 74 | } 75 | 76 | VisOptions::VisOptions(const VisOptions& copy) 77 | { 78 | absoluteTime = copy.absoluteTime; 79 | showAggregateSteps = copy.showAggregateSteps; 80 | colorTraditionalByMetric = copy.colorTraditionalByMetric; 81 | showMessages = copy.showMessages; 82 | showInactiveSteps = copy.showInactiveSteps; 83 | topByCentroid = copy.topByCentroid; 84 | traceBack = copy.traceBack; 85 | metric = copy.metric; 86 | maptype = copy.maptype; 87 | divergentmap = new ColorMap(*(copy.divergentmap)); 88 | catcolormap = new ColorMap(*(copy.catcolormap)); 89 | rampmap = new ColorMap(*(copy.rampmap)); 90 | if (maptype == COLOR_SEQUENTIAL) 91 | colormap = rampmap; 92 | else if (maptype == COLOR_CATEGORICAL) 93 | colormap = catcolormap; 94 | else 95 | colormap = divergentmap; 96 | } 97 | 98 | 99 | void VisOptions::setRange(double low, double high) 100 | { 101 | rampmap->setRange(low, high); 102 | divergentmap->setRange(low, high); 103 | catcolormap->setRange(low, high); 104 | } 105 | -------------------------------------------------------------------------------- /src/visoptions.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef VISOPTIONS_H 26 | #define VISOPTIONS_H 27 | 28 | #include 29 | 30 | class ColorMap; 31 | 32 | class VisOptions 33 | { 34 | public: 35 | VisOptions(bool _showAgg = true, 36 | bool _metricTraditional = true, 37 | QString _metric = "Lateness"); 38 | VisOptions(const VisOptions& copy); 39 | void setRange(double low, double high); 40 | 41 | enum ColorMapType { COLOR_SEQUENTIAL, COLOR_DIVERGING, COLOR_CATEGORICAL }; 42 | enum MessageType { MSG_NONE, MSG_TRUE, MSG_SINGLE }; 43 | 44 | bool absoluteTime; 45 | bool showAggregateSteps; 46 | bool colorTraditionalByMetric; // color physical timeline by metric 47 | MessageType showMessages; // draw message lines 48 | bool topByCentroid; // focus processes are centroid of cluster 49 | bool showInactiveSteps; // default: no color for inactive proportion 50 | bool traceBack; // trace back idles and such 51 | QString metric; 52 | ColorMapType maptype; 53 | ColorMap * divergentmap; 54 | ColorMap * rampmap; // sequential colormap 55 | ColorMap * catcolormap; // categorical colormap 56 | ColorMap * colormap; // active colormap 57 | }; 58 | 59 | #endif // VISOPTIONS_H 60 | -------------------------------------------------------------------------------- /src/visoptionsdialog.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef VISOPTIONSDIALOG_H 26 | #define VISOPTIONSDIALOG_H 27 | 28 | #include 29 | #include 30 | #include "visoptions.h" 31 | 32 | class Trace; 33 | 34 | // GUI element for handling Vis options 35 | namespace Ui { 36 | class VisOptionsDialog; 37 | } 38 | 39 | class VisOptionsDialog : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit VisOptionsDialog(QWidget *parent = 0, 45 | VisOptions * _options = NULL, 46 | Trace * _trace = NULL); 47 | ~VisOptionsDialog(); 48 | 49 | public slots: 50 | void onCancel(); 51 | void onOK(); 52 | void onAbsoluteTime(bool absolute); 53 | void onMetricColorTraditional(bool metricColor); 54 | void onMetric(QString metric); 55 | void onShowAggregate(bool showAggregate); 56 | void onTraceBack(bool traceBack); 57 | void onShowMessages(int showMessages); 58 | void onColorCombo(QString type); 59 | void onShowInactive(bool showInactive); 60 | 61 | private: 62 | int mapMetricToIndex(QString metric); 63 | 64 | Ui::VisOptionsDialog *ui; 65 | bool isSet; 66 | 67 | VisOptions * options; 68 | VisOptions saved; 69 | 70 | Trace * trace; 71 | 72 | void setUIState(); 73 | }; 74 | 75 | #endif // VISOPTIONSDIALOG_H 76 | -------------------------------------------------------------------------------- /src/visoptionsdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 26 | 27 | VisOptionsDialog 28 | 29 | 30 | 31 | 0 32 | 0 33 | 357 34 | 292 35 | 36 | 37 | 38 | Visualization Options 39 | 40 | 41 | 42 | 43 | 44 | Show steps in between messaging events. MPI only. 45 | 46 | 47 | show aggregate event steps 48 | 49 | 50 | 51 | 52 | 53 | 54 | Experimental. 55 | 56 | 57 | trace back idle time 58 | 59 | 60 | 61 | 62 | 63 | 64 | Cluster glyphs have transparent area to show inactive timelines at that step. 65 | 66 | 67 | show inactive proportion in cluster steps 68 | 69 | 70 | 71 | 72 | 73 | 74 | Physical timeline events also colored using metric. 75 | 76 | 77 | color physical time view with structure metric 78 | 79 | 80 | 81 | 82 | 83 | 84 | Physical time axis shows absolute time rather than offset time. 85 | 86 | 87 | absolute time in physical time view 88 | 89 | 90 | 91 | 92 | 93 | 94 | 0 95 | 96 | 97 | 0 98 | 99 | 100 | 101 | 102 | Message lines can be drawn from sender to receiver, within the sender event, or not at all. 103 | 104 | 105 | message style: 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 1 114 | 0 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | structure metric: 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 1 135 | 0 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | color map: 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 1 156 | 0 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Qt::Horizontal 167 | 168 | 169 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | buttonBox 179 | accepted() 180 | VisOptionsDialog 181 | accept() 182 | 183 | 184 | 248 185 | 254 186 | 187 | 188 | 157 189 | 274 190 | 191 | 192 | 193 | 194 | buttonBox 195 | rejected() 196 | VisOptionsDialog 197 | reject() 198 | 199 | 200 | 316 201 | 260 202 | 203 | 204 | 286 205 | 274 206 | 207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /src/viswidget.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // Copyright (c) 2014, Lawrence Livermore National Security, LLC. 3 | // Produced at the Lawrence Livermore National Laboratory. 4 | // 5 | // This file is part of Ravel. 6 | // Written by Kate Isaacs, kisaacs@acm.org, All rights reserved. 7 | // LLNL-CODE-663885 8 | // 9 | // For details, see https://github.com/scalability-llnl/ravel 10 | // Please also see the LICENSE file for our notice and the LGPL. 11 | // 12 | // This program is free software; you can redistribute it and/or modify 13 | // it under the terms of the GNU General Public License (as published by 14 | // the Free Software Foundation) version 2.1 dated February 1999. 15 | // 16 | // This program is distributed in the hope that it will be useful, but 17 | // WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and 19 | // conditions of the GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public License 22 | // along with this program; if not, write to the Free Software Foundation, 23 | // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | ////////////////////////////////////////////////////////////////////////////// 25 | #ifndef VISWIDGET_H 26 | #define VISWIDGET_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "visoptions.h" 36 | #include "commdrawinterface.h" 37 | 38 | class VisOptions; 39 | class Trace; 40 | class QPainter; 41 | class Message; 42 | class Gnome; 43 | class QPaintEvent; 44 | class Event; 45 | 46 | class VisWidget : public QGLWidget, public CommDrawInterface 47 | { 48 | Q_OBJECT 49 | public: 50 | VisWidget(QWidget *parent = 0, VisOptions * _options = new VisOptions()); 51 | ~VisWidget(); 52 | virtual void setTrace(Trace *t); 53 | Trace * getTrace() { return trace; } 54 | virtual void processVis(); 55 | void clear(); 56 | virtual QSize sizeHint() const; 57 | 58 | void setClosed(bool _closed); 59 | bool isClosed() { return closed; } 60 | void setVisOptions(VisOptions * _options); 61 | QWidget * container; 62 | 63 | virtual int getHeight() { return rect().height(); } 64 | virtual void drawMessage(QPainter * painter, Message * msg) 65 | { Q_UNUSED(painter); Q_UNUSED(msg); } 66 | virtual void drawCollective(QPainter * painter, CollectiveRecord * cr) 67 | { Q_UNUSED(painter); Q_UNUSED(cr); } 68 | virtual void drawDelayTracking(QPainter * painter, CommEvent * c) 69 | { Q_UNUSED(painter); Q_UNUSED(c); } 70 | 71 | signals: 72 | void repaintAll(); 73 | void stepsChanged(float start, float stop, bool jump); 74 | void eventClicked(Event * evt, bool aggregate, bool overdraw); 75 | void entitiesSelected(QList processes, Gnome * gnome); 76 | 77 | public slots: 78 | virtual void setSteps(float start, float stop, bool jump = false); 79 | virtual void selectEvent(Event *, bool, bool); 80 | virtual void selectEntities(QList entities, Gnome * gnome); 81 | 82 | protected: 83 | void initializeGL(); 84 | void paintEvent(QPaintEvent *event); 85 | void incompleteBox(QPainter *painter, 86 | float x, float y, float w, float h, QRect *extents); 87 | int boundStep(float step); // Determine upper bound on step 88 | 89 | virtual void drawNativeGL(); 90 | virtual void qtPaint(QPainter *painter); 91 | virtual void prepaint(); 92 | QString drawTimescale(QPainter * painter, unsigned long long start, 93 | unsigned long long span, int margin = 0); 94 | 95 | private: 96 | void beginNativeGL(); 97 | void endNativeGL(); 98 | 99 | protected: 100 | Trace * trace; 101 | bool visProcessed; 102 | VisOptions * options; 103 | QColor backgroundColor; 104 | QBrush selectColor; 105 | bool changeSource; 106 | int border; 107 | 108 | // Interactions 109 | QMap drawnEvents; 110 | QList selected_entities; 111 | Gnome * selected_gnome; 112 | Event * selected_event; 113 | bool selected_aggregate; 114 | bool overdraw_selected; 115 | Event * hover_event; 116 | bool hover_aggregate; 117 | bool closed; 118 | 119 | static const int initStepSpan = 15; 120 | static const int timescaleHeight = 20; 121 | static const int timescaleTickHeight = 5; 122 | }; 123 | 124 | #endif // VISWIDGET_H 125 | --------------------------------------------------------------------------------