15 #include <CD_NamespaceHeader.H>
17 template <
typename Duration>
21 CH_TIME(
"MFHelmholtzOp::computeOperatorLoads");
26 CH_assert(a_numApply > 0);
27 CH_assert(a_phi.ghostVect() == m_ghostPhi);
29 LevelData<MFCellFAB> Lphi;
30 this->create(Lphi, a_phi);
32 const DisjointBoxLayout& dbl = a_phi.disjointBoxLayout();
33 const DataIterator& dit = dbl.dataIterator();
35 Vector<long long> loads(dbl.size(), 0LL);
37 const int nbox = dit.size();
39 #pragma omp parallel for schedule(runtime)
40 for (
int mybox = 0; mybox < nbox; mybox++) {
41 const DataIndex& din = dit[mybox];
42 const int intCode = din.intCode();
44 const auto t0 = std::chrono::steady_clock::now();
46 for (
int i = 0; i < a_numApply; i++) {
50 for (
auto& op : m_helmOps) {
51 const int iphase = op.first;
53 RefCountedPtr<EBMultigridInterpolator>& phaseInterpolator = m_interpolator.getInterpolator(iphase);
55 EBCellFAB& phi = (EBCellFAB&)a_phi[din].getPhase(iphase);
57 phaseInterpolator->coarseFineInterpH(phi, Interval(m_comp, m_comp), din);
63 m_jumpBC->matchBC((*m_jump)[din], a_phi[din],
true, din);
67 for (
auto& op : m_helmOps) {
68 const Box cellBox = Lphi.disjointBoxLayout()[din];
70 const int iphase = op.first;
72 EBCellFAB& Lph = Lphi[din].getPhase(iphase);
73 EBCellFAB& phi = a_phi[din].getPhase(iphase);
75 const EBCellFAB& Acoef = (*m_Acoef)[din].getPhase(iphase);
76 const EBFluxFAB& Bcoef = (*m_Bcoef)[din].getPhase(iphase);
77 const BaseIVFAB<Real>& BcoefIrreg = *(*m_BcoefIrreg)[din].getPhasePtr(iphase);
79 op.second->applyOp(Lph, phi, Acoef, Bcoef, BcoefIrreg, cellBox, din,
true);
83 const auto t1 = std::chrono::steady_clock::now();
84 const auto duration = (std::chrono::duration_cast<Duration>(t1 - t0));
86 loads[intCode] = (
long long)duration.count();
94 #include <CD_NamespaceFooter.H>
Declaration of a class for solving multiphase Helmholtz equations.
Agglomeration of basic MPI reductions.
Vector< long long > computeOperatorLoads(LevelData< MFCellFAB > &a_phi, const int a_numApply) noexcept
Time the applyOp routine. Template parameter is std::chrono duration. E.g. std::chrono::microseconds.
Definition: CD_MFHelmholtzOpImplem.H:19
void vectorSum(Vector< Real > &a_data) noexcept
Perform a summation of all the MPI ranks's input data.
Definition: CD_ParallelOpsImplem.H:448