-
Notifications
You must be signed in to change notification settings - Fork 50
Precommit test #1182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Precommit test #1182
Conversation
d4375f9 to
9a527f2
Compare
ursg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only took some picks of files here and there (and did not scroll through 280 files in 10 minutes!). There are definitely some clang-format options that still need tuning.
| uint thread_id = 0; | ||
|
|
||
| public: | ||
| void syncDeviceData(void) { CHK_ERR(cudaMemcpyAsync(d_ptr, ptr, bytes, cudaMemcpyHostToDevice, gpuStreamList[thread_id])); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that these have been compressed to one-liners now. I wonder what clang-format option would help there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess AllowShortFunctionsOnASingleLine=Empty would be a reasonable setting for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void setDipoleField(const FieldFunction& dipole) { dipoleField = dipole; }; | ||
| void setConstantBackgroundField(const std::array<Real, 3> B) { BGB = B; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, too: The threshold for single-lining simple functions is too small, IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void solve( | ||
| int & iteration, | ||
| int & nRestarts, | ||
| Real & residual, | ||
| Real & minPotentialN, | ||
| Real & maxPotentialN, | ||
| Real & minPotentialS, | ||
| Real & maxPotentialS | ||
| ); | ||
| void solveInternal( | ||
| int & iteration, | ||
| int & nRestarts, | ||
| Real & residual, | ||
| Real & minPotentialN, | ||
| Real & maxPotentialN, | ||
| Real & minPotentialS, | ||
| Real & maxPotentialS | ||
| ); | ||
| void initSolver(bool zeroOut = true); /*!< Initialize the CG solver */ | ||
| iSolverReal Atimes(uint nodeIndex, int parameter, bool transpose = false); /*!< Evaluate neighbour nodes' coupled parameter */ | ||
| Real Asolve(uint nodeIndex, int parameter, bool transpose = false); /*!< Evaluate own parameter value */ | ||
| void solve(int& iteration, int& nRestarts, Real& residual, Real& minPotentialN, Real& maxPotentialN, Real& minPotentialS, Real& maxPotentialS); | ||
| void solveInternal(int& iteration, int& nRestarts, Real& residual, Real& minPotentialN, Real& maxPotentialN, Real& minPotentialS, Real& maxPotentialS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These, too, are less readable now than before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a consequence of having too permissive line width, I'm assuming it's only going to split calls and definitions if they don't fit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the below are better imho if forcing them to just have one per line in a blanket fashion. Having variably one or more per line is just going to confuse people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah BPPS_AlwaysOnePerLine is probably fine if not ideal imo. I don't think I agree about it being case-by-case being bad, like 1-3 param functions can be single-line. How does the formatting look with a lower line width?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this turned out to be absolutely awful as it applies the same rule to template parameters which we absolutely do not want one per line, ever. So we'll have to live with BPPS_OnePerLine which will occasionally result in these one-liners (we'd have to tone down line width to address that)
sysboundary/ionosphere.h
Outdated
| void mapDownBoundaryData(FsGrid<std::array<Real, fsgrids::bfield::N_BFIELD>, FS_STENCIL_WIDTH>& perBGrid, FsGrid<std::array<Real, fsgrids::dperb::N_DPERB>, FS_STENCIL_WIDTH>& dPerBGrid, | ||
| FsGrid<std::array<Real, fsgrids::moments::N_MOMENTS>, FS_STENCIL_WIDTH>& momentsGrid, FsGrid<std::array<Real, fsgrids::volfields::N_VOL>, FS_STENCIL_WIDTH>& volGrid, | ||
| FsGrid<fsgrids::technical, FS_STENCIL_WIDTH>& technicalGrid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this exactly what the BinPackArguments option was supposed to prevent? Or is this now only affecting arguments in the function definition, and is separately handled for declarations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it is BinPackArguments (which are the actual values supplied in a function invocation) vs. BinPackParameters (which is the parameter list in the function definition and/or declaration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also "ExperimentalAutoDetectBinPacking", but I have no idea what it does.
datareduction/datareducer.cpp
Outdated
| for (auto& c : lowercase) | ||
| c = tolower(c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should definitely have curlies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting of all these datareducers, that I had been quite vocal about in the fsgrid PR, now actually looks pretty nice!
|
scrolling through the config reference, i see |
|
In other news, we have a successful pair of TP runs! 🎉 |
d1bef79 to
573af76
Compare
iowrite.h
Outdated
| bool writeGrid( | ||
| dccrg::Dccrg<SpatialCell,dccrg::Cartesian_Geometry>& mpiGrid, | ||
| FsGrid< std::array<Real, fsgrids::bfield::N_BFIELD>, FS_STENCIL_WIDTH> & perBGrid, | ||
| FsGrid< std::array<Real, fsgrids::efield::N_EFIELD>, FS_STENCIL_WIDTH> & EGrid, | ||
| FsGrid< std::array<Real, fsgrids::ehall::N_EHALL>, FS_STENCIL_WIDTH> & EHallGrid, | ||
| FsGrid< std::array<Real, fsgrids::egradpe::N_EGRADPE>, FS_STENCIL_WIDTH> & EGradPeGrid, | ||
| FsGrid< std::array<Real, fsgrids::moments::N_MOMENTS>, FS_STENCIL_WIDTH> & momentsGrid, | ||
| FsGrid< std::array<Real, fsgrids::dperb::N_DPERB>, FS_STENCIL_WIDTH> & dPerBGrid, | ||
| FsGrid< std::array<Real, fsgrids::dmoments::N_DMOMENTS>, FS_STENCIL_WIDTH> & dMomentsGrid, | ||
| FsGrid< std::array<Real, fsgrids::bgbfield::N_BGB>, FS_STENCIL_WIDTH> & BgBGrid, | ||
| FsGrid< std::array<Real, fsgrids::volfields::N_VOL>, FS_STENCIL_WIDTH> & volGrid, | ||
| FsGrid< fsgrids::technical, FS_STENCIL_WIDTH> & technicalGrid, | ||
| dccrg::Dccrg< | ||
| SpatialCell, | ||
| dccrg::Cartesian_Geometry>& mpiGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::bfield::N_BFIELD>, | ||
| FS_STENCIL_WIDTH>& perBGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::efield::N_EFIELD>, | ||
| FS_STENCIL_WIDTH>& EGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::ehall::N_EHALL>, | ||
| FS_STENCIL_WIDTH>& EHallGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::egradpe::N_EGRADPE>, | ||
| FS_STENCIL_WIDTH>& EGradPeGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::moments::N_MOMENTS>, | ||
| FS_STENCIL_WIDTH>& momentsGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::dperb::N_DPERB>, | ||
| FS_STENCIL_WIDTH>& dPerBGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::dmoments::N_DMOMENTS>, | ||
| FS_STENCIL_WIDTH>& dMomentsGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::bgbfield::N_BGB>, | ||
| FS_STENCIL_WIDTH>& BgBGrid, | ||
| FsGrid< | ||
| std::array< | ||
| Real, | ||
| fsgrids::volfields::N_VOL>, | ||
| FS_STENCIL_WIDTH>& volGrid, | ||
| FsGrid< | ||
| fsgrids::technical, | ||
| FS_STENCIL_WIDTH>& technicalGrid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my god bruh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh this particular mess could do with a proper fsgrids wrapper anyhow.
bacbef1 to
191cdb3
Compare
Actually include clang-format 22 in CI step (Re-)Enable clang-format in precommit config Actually run on push to precommitTest Fix precommit action yml file Fix precommit ci apt installation commands Also install python in precommit CI try to get precommit to actually find git Make sure precommit runs in the correct directory Try to debug why git is not found in precommit CI See if including npm or nodejs help widg precommit artefact upload Don't actually run clang-format (but everything else) Make sure precommit ci step has the right name Re-enable clang-format Actually add push permissions to the precommit workflow Also ignore .DAT files and any line with a # in it. Actually, *don't* bin pack argument Update some precommit hook versions Run precommit CI on push to any branch (thus: permission!) Actually have pull-request, not push permissions for precommit A random one-character commit that introduces a whitespace error. Remove the whitespace error again. Fix order of filter. swap order because why not? Whyyyy? Add back precommitTest to change the PR target branch again. No branch specification, run that on any PR. Another unimportant small change More trivial and pointless change Add a poem about neutrinos.
common.h
Outdated
| #define CHECK_FLOAT(x) \ | ||
| { \ | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a weird way to reformat this. It seems to identify the "{}" here as an empty code block, but this totally breaks the ideomatic use of {} to signify an empty piece of code.
Also, why does it even touch this line, if the regex forbids it from touching anything with a # in it?
yyyaaammmlll......
reverting some Revert "reverting some" This reverts commit 13242b0. Finally?
one more space Y and Z clang format bypass in Hall term too.
|
To sum up our findings of today: Do we have a workaround for that? |
|
So your solution is to have a "#" in every comment in front of an omp pragma, hence clang-format ignoring it? "No sir, I don't like it." |
No description provided.