74 #ifndef prof_Prof_Metric_AExprIncr_hpp 75 #define prof_Prof_Metric_AExprIncr_hpp 100 #define epsilon (0.000001) 336 double z2 = a2 + (s * s);
364 double mean = a1 /
n;
365 double z1 = (mean * mean);
367 sdev = sqrt(z2 - z1);
384 virtual std::ostream&
385 dump(std::ostream& os = std::cout)
const 391 virtual std::ostream&
392 dumpMe(std::ostream& os = std::cout)
const = 0;
444 {
return (
accumVar(0, mdata) = DBL_MIN ); }
448 {
return (
srcVar(0, mdata) = DBL_MIN ); }
457 if (s != DBL_MIN && s != 0.0) {
458 z = (a == DBL_MIN) ? s : std::min(a, s);
461 DIAG_MsgIf(0,
"MinIncr: min("<< a <<
", " << s <<
") = " << z);
492 virtual std::ostream&
493 dumpMe(std::ostream& os = std::cout)
const;
521 {
return (
accumVar(0, mdata) = 0.0); }
525 {
return (
srcVar(0, mdata) = 0.0); }
531 double z = std::max(a, s);
532 DIAG_MsgIf(0,
"MaxIncr: max("<< a <<
", " << s <<
") = " << z);
563 virtual std::ostream&
564 dumpMe(std::ostream& os = std::cout)
const;
592 {
return (
accumVar(0, mdata) = 0.0); }
596 {
return (
srcVar(0, mdata) = 0.0); }
603 DIAG_MsgIf(0,
"SumIncr: +("<< a <<
", " << s <<
") = " << z);
634 virtual std::ostream&
635 dumpMe(std::ostream& os = std::cout)
const;
663 {
return (
accumVar(0, mdata) = 0.0); }
667 {
return (
srcVar(0, mdata) = 0.0); }
674 DIAG_MsgIf(0,
"MeanIncr: +("<< a <<
", " << s <<
") = " << z);
718 virtual std::ostream&
719 dumpMe(std::ostream& os = std::cout)
const;
795 virtual std::ostream&
796 dumpMe(std::ostream& os = std::cout)
const;
881 virtual std::ostream&
882 dumpMe(std::ostream& os = std::cout)
const;
931 z = (sdev / mean) * 100;
967 virtual std::ostream&
968 dumpMe(std::ostream& os = std::cout)
const;
1036 virtual std::ostream&
1037 dumpMe(std::ostream& os = std::cout)
const;
uint m_accumId[maxAccums]
virtual std::string combineString1() const
virtual std::string finalizeString() const
MinIncr(uint accumId, uint srcId)
virtual std::string combineString1() const
std::string combineString2StdDev() const
virtual double initialize(Metric::IData &mdata) const
virtual double accumulate(Metric::IData &mdata) const
void srcId(int i, uint x)
bool isSetSrc(int i) const
virtual double initializeSrc(Metric::IData &mdata) const
std::string finalizeStringStdDev(std::string *meanRet=NULL) const
std::string finalizeStringSum() const
virtual double accumulate(Metric::IData &mdata) const
virtual double finalize(Metric::IData &mdata) const
std::string combineString1NumSource() const
virtual std::string combineString1() const
std::string finalizeStringCoefVar() const
bool isSetNumSrcVar() const
double & accumVar(int i, Metric::IData &mdata) const
virtual double combine(Metric::IData &mdata) const
string toStr(const int x, int base)
virtual std::string combineString1() const
double accumVar(int i, const Metric::IData &mdata) const
virtual bool hasNumSrcVar() const
virtual double initialize(Metric::IData &mdata) const
double accumulateStdDev(Metric::IData &mdata) const
virtual double finalize(Metric::IData &mdata) const
virtual double finalize(Metric::IData &mdata) const
const char * DIAG_Unimplemented
virtual double initialize(Metric::IData &mdata) const
virtual std::string combineString2() const
virtual double combine(Metric::IData &mdata) const =0
virtual std::string finalizeString() const
static double var(const Metric::IData &mdata, uint mId)
virtual double initializeSrc(Metric::IData &mdata) const
virtual std::ostream & dumpMe(std::ostream &os=std::cout) const =0
double finalizeStdDev(Metric::IData &mdata) const
std::string finalizeStringNumSource() const
virtual std::string combineString1() const
virtual std::string combineString2() const
virtual double initializeSrc(Metric::IData &mdata) const
virtual double combine(Metric::IData &mdata) const
virtual double initialize(Metric::IData &mdata) const
virtual std::string combineString1() const
virtual double finalize(Metric::IData &mdata) const
virtual double initializeSrc(Metric::IData &mdata) const
virtual std::string finalizeString() const
virtual std::string finalizeString() const
virtual double accumulate(Metric::IData &mdata) const
virtual bool hasNumSrcVar() const
std::string finalizeStringRStdDev() const
double initializeSrcStdDev(Metric::IData &mdata) const
virtual double initializeSrc(Metric::IData &GCC_ATTR_UNUSED mdata) const
virtual double combine(Metric::IData &mdata) const
virtual double accumulate(Metric::IData &mdata) const =0
virtual double finalize(Metric::IData &mdata) const =0
#define DIAG_MsgIf(ifexpr,...)
virtual double combine(Metric::IData &mdata) const
std::string srcStr(int i) const
AExprIncr(uint accumId, uint srcId)
virtual bool hasNumSrcVar() const
static bool isok(double x)
virtual double accumulate(Metric::IData &mdata) const
virtual double accumulate(Metric::IData &mdata) const
virtual std::string combineString1() const
static double & var(Metric::IData &mdata, uint mId)
std::string combineString1Max() const
StdDevIncr(uint accumId, uint accum2Id, uint srcId)
std::string finalizeStringMean() const
virtual double finalize(Metric::IData &mdata) const
virtual double combine(Metric::IData &mdata) const
std::string combineString1Min() const
virtual uint numAccum() const
virtual double accumulate(Metric::IData &mdata) const
virtual uint numSrcVarId() const
virtual int hasAccum() const
virtual double initializeSrc(Metric::IData &mdata) const
double combineStdDev(Metric::IData &mdata) const
virtual double initializeSrc(Metric::IData &mdata) const =0
virtual std::string combineString2() const
virtual std::string combineString2() const
std::string combineString1Mean() const
virtual std::string finalizeString() const
virtual double combine(Metric::IData &mdata) const
virtual std::string combineString1() const
virtual bool hasNumSrcVar() const
virtual bool hasNumSrcVar() const
virtual double initialize(Metric::IData &mdata) const
virtual double initializeSrc(Metric::IData &mdata) const
virtual double accumulate(Metric::IData &mdata) const
virtual uint accumId(int i) const
virtual std::string finalizeString() const
double demandMetric(size_t mId, size_t size=0) const
virtual double initialize(Metric::IData &mdata) const
virtual double finalize(Metric::IData &mdata) const
uint numSrc(const Metric::IData &mdata) const
NumSourceIncr(uint accumId, uint srcId)
std::string finalizeStringMin() const
virtual double combine(Metric::IData &mdata) const
void accumId(int i, uint x)
virtual std::string toString() const
MeanIncr(uint accumId, uint srcId)
virtual std::string finalizeString() const
virtual double combine(Metric::IData &mdata) const
virtual double initialize(Metric::IData &mdata) const
virtual uint numSrcFxd() const
virtual uint numAccum() const
std::string finalizeStringMax() const
uint numSrcVarVar(const Metric::IData &mdata) const
std::string combineString1Sum() const
RStdDevIncr(uint accumId, uint accum2Id, uint srcId)
virtual double initializeSrc(Metric::IData &mdata) const
std::string combineString1StdDev() const
virtual std::string finalizeString() const
virtual std::ostream & dump(std::ostream &os=std::cout) const
<!-- ********************************************************************--> n<!-- HPCToolkit Experiment DTD --> n<!-- Version 2.1 --> n<!-- ********************************************************************--> n<!ELEMENT HPCToolkitExperiment(Header,(SecCallPathProfile|SecFlatProfile) *)> n<!ATTLIST HPCToolkitExperiment\n version CDATA #REQUIRED > n n<!-- ******************************************************************--> n n<!-- Info/NV:flexible name-value pairs:(n) ame;(t) ype;(v) alue --> n<!ELEMENT Info(NV *)> n<!ATTLIST Info\n n CDATA #IMPLIED > n<!ELEMENT NV EMPTY > n<!ATTLIST NV\n n CDATA #REQUIRED\n t CDATA #IMPLIED\n v CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Header --> n<!-- ******************************************************************--> n<!ELEMENT Header(Info *)> n<!ATTLIST Header\n n CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Section Header --> n<!-- ******************************************************************--> n<!ELEMENT SecHeader(MetricTable?, MetricDBTable?, TraceDBTable?, LoadModuleTable?, FileTable?, ProcedureTable?, Info *)> n n<!-- MetricTable:--> n<!ELEMENT MetricTable(Metric) * > n n<!-- Metric:(i) d;(n) ame --> n<!--(v) alue-type:transient type of values --> n<!--(t) ype:persistent type of metric --> n<!-- fmt:format;show;--> n<!ELEMENT Metric(MetricFormula *, Info?)> n<!ATTLIST Metric\n i CDATA #REQUIRED\n n CDATA #REQUIRED\n es CDATA #IMPLIED\n em CDATA #IMPLIED\n ep CDATA #IMPLIED\n v(raw|final|derived-incr|derived) \"raw\\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ fmt CDATA #IMPLIED\ show (1|0) \1\\ show-percent (1|0) \1> n n<!-- MetricFormula represents derived metrics: (t)ype; (frm): formula --> n<!ELEMENT MetricFormula (Info?)> n<!ATTLIST MetricFormula\ t (combine|finalize) \finalize\\ i CDATA #IMPLIED\ frm CDATA #REQUIRED> n n<!-- Metric data, used in sections: (n)ame [from Metric]; (v)alue --> n<!ELEMENT M EMPTY> n<!ATTLIST M\ n CDATA #REQUIRED\ v CDATA #REQUIRED> n n<!-- MetricDBTable: --> n<!ELEMENT MetricDBTable (MetricDB)*> n n<!-- MetricDB: (i)d; (n)ame --> n<!-- (t)ype: persistent type of metric --> n<!-- db-glob: file glob describing files in metric db --> n<!-- db-id: id within metric db --> n<!-- db-num-metrics: number of metrics in db --> n<!-- db-header-sz: size (in bytes) of a db file header --> n<!ELEMENT MetricDB EMPTY> n<!ATTLIST MetricDB\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ db-glob CDATA #IMPLIED\ db-id CDATA #IMPLIED\ db-num-metrics CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- TraceDBTable: --> n<!ELEMENT TraceDBTable (TraceDB)> n n<!-- TraceDB: (i)d --> n<!-- db-min-time: min beginning time stamp (global) --> n<!-- db-max-time: max ending time stamp (global) --> n<!ELEMENT TraceDB EMPTY> n<!ATTLIST TraceDB\ i CDATA #REQUIRED\ db-glob CDATA #IMPLIED\ db-min-time CDATA #IMPLIED\ db-max-time CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- LoadModuleTable assigns a short name to a load module --> n<!ELEMENT LoadModuleTable (LoadModule)*> n n<!ELEMENT LoadModule (Info?)> n<!ATTLIST LoadModule\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- FileTable assigns a short name to a file --> n<!ELEMENT FileTable (File)*> n n<!ELEMENT File (Info?)> n<!ATTLIST File\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- ProcedureTable assigns a short name to a procedure --> n<!ELEMENT ProcedureTable (Procedure)*> n n<!-- Info/NV: flexible name-value pairs: (n)ame; (t)ype; (v)alue --> n<!-- f: family of the procedure (fake, root, ...)--> n<!ELEMENT Procedure (Info?)> n<!ATTLIST Procedure\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ f CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Call path profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecCallPathProfile (SecHeader, SecCallPathProfileData)> n<!ATTLIST SecCallPathProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecCallPathProfileData (PF|M)*> n<!-- Procedure frame --> n<!-- (i)d: unique identifier for cross referencing --> n<!-- (s)tatic scope id --> n<!-- (n)ame: a string or an id in ProcedureTable --> n<!-- (lm) load module: a string or an id in LoadModuleTable --> n<!-- (f)ile name: a string or an id in LoadModuleTable --> n<!-- (l)ine range: \beg-end\ (inclusive range) --> n<!-- (a)lien: whether frame is alien to enclosing P --> n<!-- (str)uct: hpcstruct node id --> n<!-- (t)ype: hpcrun node type: memory access, variable declaration, ... --> n<!-- (v)ma-range-set: \{[beg-end), [beg-end)...}\ --> n<!ELEMENT PF (PF|Pr|L|C|S|M)*> n<!ATTLIST PF\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Procedure (static): GOAL: replace with 'P' --> n<!ELEMENT Pr (Pr|L|C|S|M)*> n<!ATTLIST Pr\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ a (1|0) \0\\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Callsite (a special StatementRange) --> n<!ELEMENT C (PF|M)*> n<!ATTLIST C\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Flat profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecFlatProfile (SecHeader, SecFlatProfileData)> n<!ATTLIST SecFlatProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecFlatProfileData (LM|M)*> n<!-- Load module: (i)d; (n)ame; (v)ma-range-set --> n<!ELEMENT LM (F|P|M)*> n<!ATTLIST LM\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ v CDATA #IMPLIED> n<!-- File --> n<!ELEMENT F (P|L|S|M)*> n<!ATTLIST F\ i CDATA #IMPLIED\ n CDATA #REQUIRED> n<!-- Procedure (Note 1) --> n<!ELEMENT P (P|A|L|S|C|M)*> n<!ATTLIST P\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Alien (Note 1) --> n<!ELEMENT A (A|L|S|C|M)*> n<!ATTLIST A\ i CDATA #IMPLIED\ f CDATA #IMPLIED\ n CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Loop (Note 1,2) --> n<!ELEMENT L (A|Pr|L|S|C|M)*> n<!ATTLIST L\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ f CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Statement (Note 2) --> n<!-- (it): trace record identifier --> n<!ELEMENT S (S|M)*> n<!ATTLIST S\ i CDATA #IMPLIED\ it CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Note 1: Contained Cs may not contain PFs --> n<!-- Note 2: The 's' attribute is not used for flat profiles --> n
virtual double accumulate(Metric::IData &mdata) const
virtual double finalize(Metric::IData &mdata) const
virtual double initialize(Metric::IData &mdata) const
double srcVar(int i, const Metric::IData &mdata) const
CoefVarIncr(uint accumId, uint accum2Id, uint srcId)
AExprIncr(uint accumId, uint accum2Id, uint srcId)
double initializeStdDev(Metric::IData &mdata) const
virtual double initialize(Metric::IData &mdata) const =0
virtual double finalize(Metric::IData &mdata) const
SumIncr(uint accumId, uint srcId)
double & srcVar(int i, Metric::IData &mdata) const
virtual uint numAccum() const
MaxIncr(uint accumId, uint srcId)