changed: reduce verbosity of multithreading group output for 2D LR splines
This commit is contained in:
parent
a51f7a65ff
commit
ab8f5a38f2
@ -468,3 +468,28 @@ bool ASMLRSpline::checkThreadGroups (const IntMat& groups,
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
void ASMLRSpline::analyzeThreadGroups(const IntMat& groups)
|
||||
{
|
||||
size_t min = std::numeric_limits<size_t>::max() - 1;
|
||||
size_t max = 0;
|
||||
std::vector<size_t> groupSizes;
|
||||
double avg = 0;
|
||||
for (const auto& group : groups) {
|
||||
min = std::min(group.size(), min);
|
||||
max = std::max(group.size(), max);
|
||||
groupSizes.push_back(group.size());
|
||||
avg += group.size();
|
||||
}
|
||||
avg /= groups.size();
|
||||
size_t half = groupSizes.size() / 2;
|
||||
std::nth_element(groupSizes.begin(), groupSizes.begin() + half, groupSizes.end());
|
||||
IFEM::cout << "\n Elements are divided in " << groups.size() << " colors "
|
||||
<< "(min = " << min
|
||||
<< ", max = " << max
|
||||
<< ", avg = " << avg
|
||||
<< ", med = " << groupSizes[half]
|
||||
<< ").\n";
|
||||
|
||||
}
|
||||
|
@ -189,6 +189,10 @@ protected:
|
||||
const std::vector<const LR::LRSpline*> bases,
|
||||
const LR::LRSpline* threadBasis);
|
||||
|
||||
//! \brief Analyze and print thread group statistics.
|
||||
//! \param groups The generated thread groups
|
||||
static void analyzeThreadGroups(const IntMat& groups);
|
||||
|
||||
LR::LRSpline* geo; //!< Pointer to the actual spline geometry object
|
||||
};
|
||||
|
||||
|
@ -2604,10 +2604,14 @@ void ASMu2D::generateThreadGroups (const Integrand& integrand, bool silence,
|
||||
if (silence || threadGroups[0].size() < 2) return;
|
||||
|
||||
std::cout <<"\nMultiple threads are utilized during element assembly.";
|
||||
#ifdef SP_DEBUG
|
||||
for (size_t i = 0; i < threadGroups[0].size(); i++)
|
||||
std::cout <<"\n Color "<< i+1 <<": "
|
||||
<< threadGroups[0][i].size() <<" elements";
|
||||
std::cout << std::endl;
|
||||
#else
|
||||
this->analyzeThreadGroups(threadGroups[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1102,9 +1102,13 @@ void ASMu2Dmx::generateThreadGroups (const Integrand& integrand, bool silence,
|
||||
this->checkThreadGroups(threadGroups[0], bases, threadBasis);
|
||||
|
||||
std::cout <<"\nMultiple threads are utilized during element assembly.";
|
||||
#ifdef SP_DEBUG
|
||||
for (size_t i = 0; i < threadGroups[0].size(); i++)
|
||||
std::cout <<"\n Color "<< i+1 <<": "
|
||||
<< threadGroups[0][i].size() <<" elements";
|
||||
#else
|
||||
this->analyzeThreadGroups(threadGroups[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1969,9 +1969,13 @@ void ASMu3D::generateThreadGroups (const Integrand& integrand, bool silence,
|
||||
if (silence || threadGroups[0].size() < 2) return;
|
||||
|
||||
std::cout <<"\nMultiple threads are utilized during element assembly.";
|
||||
#if SP_DEBUG
|
||||
for (size_t i = 0; i < threadGroups[0].size(); i++)
|
||||
std::cout <<"\n Color "<< i+1 <<": "
|
||||
<< threadGroups[0][i].size() <<" elements";
|
||||
#else
|
||||
this->analyzeThreadGroups(threadGroups[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user