Skip to content

Commit

Permalink
update clang format action version to avoid distutils issue (#525)
Browse files Browse the repository at this point in the history
* update clang format action version to avoid distutils issue

* clang format to 18

* more files updated for clang-format to version 18
  • Loading branch information
baperry2 authored Sep 4, 2024
1 parent 1be18ca commit 1e7eb65
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/clang-format-lint-action@v0.16.2
uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: './Source ./Testing ./Mechanisms'
exclude: '.'
extensions: 'H,h,cpp'
clangFormatVersion: 16
clangFormatVersion: 18

Codespell:
needs: Formatting
Expand Down
2 changes: 1 addition & 1 deletion Source/Radiation/POneSingle.H
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public:
bcoef_(bcoef),
robin_a_(robin_a),
robin_b_(robin_b),
robin_f_(robin_f){};
robin_f_(robin_f) {};

void solve()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Radiation/POneSingleEB.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public:
bcoef_(bcoef),
robin_a_(robin_a),
robin_b_(robin_b),
robin_f_(robin_f){};
robin_f_(robin_f) {};

void solve()
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Reactions/ReactorCvodeUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ fKernelComputeAJchem(
amrex::Real temp_pt = u_curr[NUM_SPECIES];

const int consP = reactor_type == ReactorTypes::h_reactor_type;
amrex::GpuArray<amrex::Real, neqs* neqs> Jmat_pt = {0.0};
amrex::GpuArray<amrex::Real, neqs * neqs> Jmat_pt = {0.0};
auto eos = pele::physics::PhysicsType::eos();
eos.RTY2JAC(rho_pt, temp_pt, massfrac.arr, Jmat_pt.arr, consP);

Expand Down Expand Up @@ -318,7 +318,7 @@ fKernelDenseAJchem(
amrex::Real temp_pt = u_curr[NUM_SPECIES];

const int consP = reactor_type == ReactorTypes::h_reactor_type;
amrex::GpuArray<amrex::Real, neqs* neqs> Jmat_pt = {0.0};
amrex::GpuArray<amrex::Real, neqs * neqs> Jmat_pt = {0.0};
auto eos = pele::physics::PhysicsType::eos();
eos.RTY2JAC(rho_pt, temp_pt, massfrac.arr, Jmat_pt.arr, consP);

Expand Down
2 changes: 1 addition & 1 deletion Source/Spray/BreakupSplash/ReitzKHRT.H
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ updateBreakupKHRT(
rad_part = rp;
num_dens = np;
} // if (rs < rad_part && We_g > We_crit)...
} // if (!breakupRT)...
} // if (!breakupRT)...
p.rdata(SprayComps::pstateDia) = 2. * rad_part;
p.rdata(SprayComps::pstateNumDens) = num_dens;
p.rdata(SprayComps::pstateN0) = N0;
Expand Down
2 changes: 1 addition & 1 deletion Source/Spray/BreakupSplash/TABBreakup.H
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ updateBreakupTAB(
yn = ynp;
ydotn = ydotnp;
} // if (tbv < subdt)
} // if (Wer + A <= 1)
} // if (Wer + A <= 1)
if (curt + subdt > dt) {
subdt = dt - curt;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Spray/SprayInjection.H
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ SprayParticleContainer::uniformSprayInit(
nparticles.pop_back();
}
} // if (which == MyProc)
} // for (int which ...
} // for (int which ...
for (auto& kv : host_particles) {
auto grid = kv.first.first;
auto tile = kv.first.second;
Expand Down
4 changes: 2 additions & 2 deletions Source/Spray/SprayParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ SprayParticleContainer::updateParticles(
p.id() = -1;
}
} // End of subcycle loop
} // End of p.id() > 0 check
}); // End of loop over particles
} // End of p.id() > 0 check
}); // End of loop over particles
if (make_new_drops) {
Gpu::copy(
Gpu::deviceToHost, N_SB_d.begin(), N_SB_d.end(), N_SB_h.begin());
Expand Down
26 changes: 13 additions & 13 deletions Source/Transport/TransportParams.H
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ struct TransParm<EOSType, SimpleTransport>
amrex::GpuArray<amrex::Real, NUM_SPECIES> dip = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES> pol = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES> zrot = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT> fitmu = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT> fitlam = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES* NUM_FIT> fitdbin = {
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT> fitmu = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT> fitlam = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES * NUM_FIT> fitdbin = {
0.0};
bool use_soret = false;
int numLite = 3;
amrex::GpuArray<int, 3> liteSpec = {0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT* 3> fittdrat = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT * 3> fittdrat = {0.0};
amrex::GpuArray<int, NUM_SPECIES> nlin = {0};
};

Expand All @@ -82,22 +82,22 @@ struct TransParm<eos::SRK, SimpleTransport>
amrex::GpuArray<amrex::Real, NUM_SPECIES> pol = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES> zrot = {0.0};

amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT> fitmu = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT> fitlam = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES* NUM_FIT> fitdbin = {
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT> fitmu = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT> fitlam = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES * NUM_FIT> fitdbin = {
0.0};
bool use_soret = false;
int numLite = 10;
amrex::GpuArray<int, 10> liteSpec = {0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_FIT* 10> fittdrat = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_FIT * 10> fittdrat = {0.0};
amrex::GpuArray<int, NUM_SPECIES> nlin = {0};
amrex::GpuArray<amrex::Real, 10 * 4> Afac = {0.0};
amrex::GpuArray<amrex::Real, 7 * 4> Bfac = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES> sqrtT2ij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES> sqrtEpsilonij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES> sqrtMWij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES> sqrtKappaij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES* NUM_SPECIES* NUM_SPECIES>
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES> sqrtT2ij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES> sqrtEpsilonij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES> sqrtMWij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES> sqrtKappaij = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES * NUM_SPECIES * NUM_SPECIES>
Upsilonijk = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES> Kappai = {0.0};
amrex::GpuArray<amrex::Real, NUM_SPECIES> omega = {0.0};
Expand Down
12 changes: 4 additions & 8 deletions Source/Utility/Diagnostics/DiagConditional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,11 @@ DiagConditional::writeAverageDataToFile(
widths[3 + 2 * f] =
std::max(width, static_cast<int>(m_fieldNames[f].length()) + 5);
condFile << std::left << std::setw(widths[3 + 2 * f])
<< m_fieldNames[f] + "_Avg"
<< " ";
<< m_fieldNames[f] + "_Avg" << " ";
widths[4 + 2 * f] =
std::max(width, static_cast<int>(m_fieldNames[f].length()) + 7);
condFile << std::left << std::setw(widths[4 + 2 * f])
<< m_fieldNames[f] + "_StdDev"
<< " ";
<< m_fieldNames[f] + "_StdDev" << " ";
}
condFile << "\n";

Expand Down Expand Up @@ -408,8 +406,7 @@ DiagConditional::writeIntegralDataToFile(
widths[1 + f] =
std::max(width, static_cast<int>(m_fieldNames[f].length()) + 5);
condFile << std::left << std::setw(widths[1 + f])
<< m_fieldNames[f] + "_Int"
<< " ";
<< m_fieldNames[f] + "_Int" << " ";
}
condFile << "\n";

Expand Down Expand Up @@ -459,8 +456,7 @@ DiagConditional::writeSumDataToFile(
widths[1 + f] =
std::max(width, static_cast<int>(m_fieldNames[f].length()) + 5);
condFile << std::left << std::setw(widths[1 + f])
<< m_fieldNames[f] + "_Sum"
<< " ";
<< m_fieldNames[f] + "_Sum" << " ";
}
condFile << "\n";

Expand Down
3 changes: 1 addition & 2 deletions Source/Utility/Diagnostics/DiagPDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ DiagPDF::writePDFToFile(
widths[0] = std::max(width, static_cast<int>(m_fieldName.length()) + 1);
widths[1] = std::max(width, static_cast<int>(m_fieldName.length()) + 5);
pdfFile << std::setw(widths[0]) << m_fieldName << " "
<< std::setw(widths[1]) << m_fieldName + "_PDF"
<< "\n";
<< std::setw(widths[1]) << m_fieldName + "_PDF" << "\n";

for (int i{0}; i < a_pdf.size(); ++i) {
pdfFile << std::setw(widths[0]) << std::setprecision(prec)
Expand Down
2 changes: 1 addition & 1 deletion Support/ceptr/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pep8-naming = "^0.12.1"
flake8-docstrings = "^1.7.0"
flake8-use-fstring = "^1.4"
flynt = "^0.77"
clang-format = "==17.0.6"
clang-format = "==18.1.8"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 1e7eb65

Please sign in to comment.