HPCToolkit
CallPath-MetricComponentsFact.hpp
Go to the documentation of this file.
1
// -*-Mode: C++;-*-
2
3
// * BeginRiceCopyright *****************************************************
4
//
5
// $HeadURL$
6
// $Id$
7
//
8
// --------------------------------------------------------------------------
9
// Part of HPCToolkit (hpctoolkit.org)
10
//
11
// Information about sources of support for research and development of
12
// HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13
// --------------------------------------------------------------------------
14
//
15
// Copyright ((c)) 2002-2019, Rice University
16
// All rights reserved.
17
//
18
// Redistribution and use in source and binary forms, with or without
19
// modification, are permitted provided that the following conditions are
20
// met:
21
//
22
// * Redistributions of source code must retain the above copyright
23
// notice, this list of conditions and the following disclaimer.
24
//
25
// * Redistributions in binary form must reproduce the above copyright
26
// notice, this list of conditions and the following disclaimer in the
27
// documentation and/or other materials provided with the distribution.
28
//
29
// * Neither the name of Rice University (RICE) nor the names of its
30
// contributors may be used to endorse or promote products derived from
31
// this software without specific prior written permission.
32
//
33
// This software is provided by RICE and contributors "as is" and any
34
// express or implied warranties, including, but not limited to, the
35
// implied warranties of merchantability and fitness for a particular
36
// purpose are disclaimed. In no event shall RICE or contributors be
37
// liable for any direct, indirect, incidental, special, exemplary, or
38
// consequential damages (including, but not limited to, procurement of
39
// substitute goods or services; loss of use, data, or profits; or
40
// business interruption) however caused and on any theory of liability,
41
// whether in contract, strict liability, or tort (including negligence
42
// or otherwise) arising in any way out of the use of this software, even
43
// if advised of the possibility of such damage.
44
//
45
// ******************************************************* EndRiceCopyright *
46
47
//***************************************************************************
48
//
49
// File:
50
// $HeadURL$
51
//
52
// Purpose:
53
// [The purpose of this file]
54
//
55
// Description:
56
// [The set of functions, macros, etc. defined in the file]
57
//
58
//***************************************************************************
59
60
#ifndef Analysis_CallPath_MetricComponentsFact_hpp
61
#define Analysis_CallPath_MetricComponentsFact_hpp
62
63
//************************* System Include Files ****************************
64
65
#include <iostream>
66
#include <vector>
67
#include <stack>
68
#include <string>
69
70
//*************************** User Include Files ****************************
71
72
#include <
include/uint.h
>
73
74
#include <
lib/prof/CallPath-Profile.hpp
>
75
76
//*************************** Forward Declarations ***************************
77
78
//****************************************************************************
79
80
namespace
Analysis
{
81
82
namespace
CallPath {
83
84
85
class
MetricComponentsFact
86
{
87
public
:
88
MetricComponentsFact
() { }
89
90
virtual
~MetricComponentsFact
() { }
91
92
virtual
void
93
make
(
Prof::CallPath::Profile
& prof);
94
95
virtual
bool
96
isSeparable
(
const
Prof::CCT::AProcNode
* x) = 0;
97
98
protected
:
99
100
void
101
make
(
Prof::CCT::ANode
*
node
,
102
const
std::vector<uint>& m_src,
const
std::vector<uint>& m_dst,
103
bool
isSeparableCtxt);
104
105
106
static
inline
bool
107
isTimeMetric
(
const
Prof::Metric::ADesc
* mdesc)
108
{
109
const
std::string& nm = mdesc->
nameBase
();
110
return
((nm.find(
"PAPI_TOT_CYC"
) == 0) || (nm.find(
"WALLCLOCK"
) == 0));
111
}
112
113
114
static
const
std::string
s_sum
;
// FIXME: share w/ MetricMgr
115
static
const
std::string
s_cfvar
;
// FIXME: share w/ MetricMgr
116
117
static
inline
bool
118
isDerivedMetric
(
const
Prof::Metric::ADesc
* mdesc,
const
std::string& type)
119
{
120
const
std::string& nm = mdesc->
nameBase
();
121
size_t
pos = nm.find(type);
122
return
((pos != std::string::npos) && (pos + type.length() == nm.length()));
123
}
124
125
126
static
void
127
convertToWorkMetric
(
Prof::Metric::ADesc
* mdesc);
128
129
};
130
131
132
//***************************************************************************
133
134
class
MPIBlameShiftIdlenessFact
:
public
MetricComponentsFact
135
{
136
public
:
137
MPIBlameShiftIdlenessFact
() { }
138
virtual
~MPIBlameShiftIdlenessFact
() { }
139
140
virtual
void
141
make
(
Prof::CallPath::Profile
& prof);
142
143
virtual
bool
144
isSeparable
(
const
Prof::CCT::AProcNode
* x);
145
146
private
:
147
// make imbalance and idleness metrics
148
void
149
makeMetrics
(
Prof::CCT::ANode
*
node
,
150
const
std::vector<uint>& m_src,
151
const
std::vector<uint>& m_imbalIncl,
152
const
std::vector<uint>& m_imbalExcl,
153
const
std::vector<uint>& m_idleIncl,
154
uint
mId_bal,
155
Prof::Metric::AExprIncr
* balancedExpr,
156
double
balancedThreshold,
157
Prof::CCT::ANode
* balancedFrm,
158
Prof::CCT::ANode
* balancedNode);
159
160
private
:
161
static
const
std::string
s_tag1
;
162
static
const
std::string
s_tag2
;
163
static
const
std::string
s_tag3
;
164
165
};
166
167
168
//***************************************************************************
169
170
class
PthreadOverheadMetricFact
:
public
MetricComponentsFact
171
{
172
public
:
173
PthreadOverheadMetricFact
() { }
174
virtual
~PthreadOverheadMetricFact
() { }
175
176
virtual
bool
177
isSeparable
(
const
Prof::CCT::AProcNode
* x);
178
179
private
:
180
static
const
std::string
s_tag
;
181
182
};
183
184
185
//***************************************************************************
186
187
class
CilkOverheadMetricFact
:
public
MetricComponentsFact
188
{
189
public
:
190
CilkOverheadMetricFact
() { }
191
virtual
~CilkOverheadMetricFact
() { }
192
193
virtual
bool
194
isSeparable
(
const
Prof::CCT::AProcNode
* x);
195
196
private
:
197
static
const
std::string
s_tag
;
198
199
};
200
201
202
//***************************************************************************
203
204
}
// namespace CallPath
205
206
}
// namespace Analysis
207
208
//****************************************************************************
209
210
#endif // Analysis_CallPath_MetricComponentsFact_hpp
Analysis::CallPath::MetricComponentsFact::convertToWorkMetric
static void convertToWorkMetric(Prof::Metric::ADesc *mdesc)
Definition:
CallPath-MetricComponentsFact.cpp:193
Analysis::CallPath::CilkOverheadMetricFact
Definition:
CallPath-MetricComponentsFact.hpp:187
Analysis::CallPath::PthreadOverheadMetricFact
Definition:
CallPath-MetricComponentsFact.hpp:170
Analysis::CallPath::MPIBlameShiftIdlenessFact::s_tag1
static const std::string s_tag1
Definition:
CallPath-MetricComponentsFact.hpp:161
Analysis::CallPath::CilkOverheadMetricFact::CilkOverheadMetricFact
CilkOverheadMetricFact()
Definition:
CallPath-MetricComponentsFact.hpp:190
Analysis::CallPath::MetricComponentsFact::~MetricComponentsFact
virtual ~MetricComponentsFact()
Definition:
CallPath-MetricComponentsFact.hpp:90
Analysis::CallPath::MPIBlameShiftIdlenessFact::~MPIBlameShiftIdlenessFact
virtual ~MPIBlameShiftIdlenessFact()
Definition:
CallPath-MetricComponentsFact.hpp:138
Analysis::CallPath::MetricComponentsFact
Definition:
CallPath-MetricComponentsFact.hpp:85
Analysis::CallPath::MetricComponentsFact::MetricComponentsFact
MetricComponentsFact()
Definition:
CallPath-MetricComponentsFact.hpp:88
Analysis::CallPath::MPIBlameShiftIdlenessFact::s_tag3
static const std::string s_tag3
Definition:
CallPath-MetricComponentsFact.hpp:163
Analysis::CallPath::PthreadOverheadMetricFact::~PthreadOverheadMetricFact
virtual ~PthreadOverheadMetricFact()
Definition:
CallPath-MetricComponentsFact.hpp:174
Analysis::CallPath::PthreadOverheadMetricFact::PthreadOverheadMetricFact
PthreadOverheadMetricFact()
Definition:
CallPath-MetricComponentsFact.hpp:173
Analysis
Definition:
Args.cpp:86
Analysis::CallPath::MetricComponentsFact::make
virtual void make(Prof::CallPath::Profile &prof)
Definition:
CallPath-MetricComponentsFact.cpp:99
Analysis::CallPath::MetricComponentsFact::isTimeMetric
static bool isTimeMetric(const Prof::Metric::ADesc *mdesc)
Definition:
CallPath-MetricComponentsFact.hpp:107
Analysis::CallPath::MPIBlameShiftIdlenessFact
Definition:
CallPath-MetricComponentsFact.hpp:134
Prof::CallPath::Profile
Definition:
CallPath-Profile.hpp:104
node
cct_node_t * node
Definition:
cct.c:128
Analysis::CallPath::MPIBlameShiftIdlenessFact::MPIBlameShiftIdlenessFact
MPIBlameShiftIdlenessFact()
Definition:
CallPath-MetricComponentsFact.hpp:137
uint.h
Prof::CCT::AProcNode
Definition:
CCT-Tree.hpp:1017
Prof::Metric::ADesc::nameBase
const std::string & nameBase() const
Definition:
Metric-ADesc.hpp:313
uint
unsigned int uint
Definition:
uint.h:124
makeMetrics
static void makeMetrics(Prof::CallPath::Profile &prof, const Analysis::Args &args, const Analysis::Util::NormalizeProfileArgs_t &nArgs)
CallPath-Profile.hpp
Analysis::CallPath::MetricComponentsFact::s_sum
static const std::string s_sum
Definition:
CallPath-MetricComponentsFact.hpp:114
Analysis::CallPath::MetricComponentsFact::isDerivedMetric
static bool isDerivedMetric(const Prof::Metric::ADesc *mdesc, const std::string &type)
Definition:
CallPath-MetricComponentsFact.hpp:118
Analysis::CallPath::PthreadOverheadMetricFact::s_tag
static const std::string s_tag
Definition:
CallPath-MetricComponentsFact.hpp:180
Prof::Metric::AExprIncr
Definition:
Metric-AExprIncr.hpp:111
Analysis::CallPath::MetricComponentsFact::s_cfvar
static const std::string s_cfvar
Definition:
CallPath-MetricComponentsFact.hpp:115
Analysis::CallPath::MetricComponentsFact::isSeparable
virtual bool isSeparable(const Prof::CCT::AProcNode *x)=0
Prof::CCT::ANode
Definition:
CCT-Tree.hpp:293
Analysis::CallPath::CilkOverheadMetricFact::~CilkOverheadMetricFact
virtual ~CilkOverheadMetricFact()
Definition:
CallPath-MetricComponentsFact.hpp:191
Analysis::CallPath::MPIBlameShiftIdlenessFact::s_tag2
static const std::string s_tag2
Definition:
CallPath-MetricComponentsFact.hpp:162
Prof::Metric::ADesc
Definition:
Metric-ADesc.hpp:97
Analysis::CallPath::CilkOverheadMetricFact::s_tag
static const std::string s_tag
Definition:
CallPath-MetricComponentsFact.hpp:197
src
lib
analysis
CallPath-MetricComponentsFact.hpp
Generated by
1.8.13