Fix a bug in the new TraceAnalyzer phase drawing logic

Fix a bug that caused groupwise phases to not display in the correct
locations.
This commit is contained in:
2021-08-11 19:44:58 +02:00
parent 790435f32d
commit d764cb43c1
3 changed files with 16 additions and 2 deletions

View File

@@ -188,8 +188,8 @@ std::vector<std::shared_ptr<TracePlotLine>> Phase::getTracePlotLines(const Trace
}
else if (getGranularity() == Granularity::Groupwise)
{
return drawingProperties.getBankLinesFromGroup(transaction->rank,
transaction->bankgroup % drawingProperties.groupsPerRank);
return drawingProperties.getBankLinesGroupwise(transaction->rank,
transaction->bank % drawingProperties.banksPerGroup);
}
else // if (getGranularity() == Granularity::Bankwise)
{

View File

@@ -230,6 +230,19 @@ TracePlotLineVector TraceDrawingProperties::getBankLinesFromGroup(unsigned int r
return tracePlotLineCache->getBankLinesFromGroup(rank, group);
}
TracePlotLineVector TraceDrawingProperties::getBankLinesGroupwise(unsigned int rank,
unsigned int bank) const
{
auto rankLines = tracePlotLineCache->getBankLinesFromRank(rank);
TracePlotLineVector groupwiseLines;
std::copy_if(rankLines.begin(), rankLines.end(), std::back_inserter(groupwiseLines),
[bank](std::shared_ptr<TracePlotLine> line)
{ return std::static_pointer_cast<TracePlotBankLine>(line)->bank == bank; });
return groupwiseLines;
}
TracePlotLineVector TraceDrawingProperties::getBankLinesFromRank(unsigned int rank) const
{
return tracePlotLineCache->getBankLinesFromRank(rank);

View File

@@ -93,6 +93,7 @@ public:
TracePlotLineVector getFirstRankLines(unsigned int rank) const;
TracePlotLineVector getBankLines(unsigned int rank, unsigned int group, unsigned int bank) const;
TracePlotLineVector getBankLinesFromGroup(unsigned int rank, unsigned int group) const;
TracePlotLineVector getBankLinesGroupwise(unsigned int rank, unsigned int bank) const;
TracePlotLineVector getBankLinesFromRank(unsigned int rank) const;
const std::shared_ptr<QHash<int, QString>> getLabels() const;