Conversation
Test generic SIMD patterns with new unit tests.
Add SIMD runners to CI.
|
/run-hpsf-gitlab-ci |
|
GitLab CI 1415577 finished with status: failed. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1415577. |
False-positive on `-Wnull-dereference` for ``` In member function ‘void amrex::ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>::WriteParticles(int, std::ofstream&, int, amrex::Vector<int>&, amrex::Vector<int>&, amrex::Vector<long int>&, const amrex::Vector<int>&, const amrex::Vector<int>&, const amrex::Vector<std::map<std::pair<int, int>, typename amrex::ParticleTile<T_ParticleType, NArrayReal, NArrayInt, Allocator>::SoA::IntVector> >&, bool) const [with T_ParticleType = amrex::Particle<3, 0>; int T_NArrayReal = 0; int T_NArrayInt = 0; Allocator = std::allocator; T_CellAssignor = amrex::DefaultAssignor]’: cc1plus: error: potential null pointer dereference [-Werror=null-dereference] cc1plus: error: potential null pointer dereference [-Werror=null-dereference] ```
|
@WeiqunZhang can you please remove the |
|
/run-hpsf-gitlab-ci |
|
Oh wow, GCC has so many false positives. I might bump to 13... |
False-positive on `-Wnull-dereference` for
```
inlined from ‘void amrex::ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>::WriteParticles(int, std::ofstream&, int, amrex::Vector<int>&, amrex::Vector<int>&, amrex::Vector<long int>&, const amrex::Vector<int>&, const amrex::Vector<int>&, const amrex::Vector<std::map<std::pair<int, int>, typename amrex::ParticleTile<T_ParticleType, NArrayReal, NArrayInt, Allocator>::SoA::IntVector> >&, bool) const [with T_ParticleType = amrex::Particle<3, 0>; int T_NArrayReal = 0; int T_NArrayInt = 0; Allocator = std::allocator; T_CellAssignor = amrex::DefaultAssignor]’ at /home/runner/work/amrex/amrex/Src/Particle/AMReX_ParticleIO.H:623:36:
/usr/include/c++/12/bits/stl_construct.h:119:7: error: potential null pointer dereference [-Werror=null-dereference]
119 | ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
```
|
Sometimes, it's not entirely the compiler's fault. They always assume the worse case scenario. But if we also do that, it will affect the code's performance. |
|
Yeah it seems a bit unhappy in GCC 11 & 12 with the ParticleIO routines. I could disable that nullptr check, but since I try to build a first SIMD runner, I would like to not turn that one off to keep this covered for purely SIMD code paths. Let me know if I shall add a purely new runner, there might be a reason to keep GCC 10 around as a runner as well for now. |
|
GitLab CI 1416671 finished with status: success. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1416671. |
Error:
```
inlined from ‘void amrex::particle_detail::packIOData(amrex::Vector<int>&, amrex::Vector<double>&, const PC&, int, int, const amrex::Vector<int>&, const amrex::Vector<int>&, const amrex::Vector<std::map<std::pair<int, int>, typename PC::IntVector> >&, const amrex::Vector<int>&, int, bool) [with PC = amrex::ParticleContainer_impl<amrex::Particle<3, 0>, 0, 0, std::allocator, amrex::DefaultAssignor>]’ at /home/runner/work/amrex/amrex/Src/Particle/AMReX_WriteBinaryParticleData.H:457:26,
inlined from ‘void amrex::ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>::WriteParticles(int, std::ofstream&, int, amrex::Vector<int>&, amrex::Vector<int>&, amrex::Vector<long int>&, const amrex::Vector<int>&, const amrex::Vector<int>&, const amrex::Vector<std::map<std::pair<int, int>, typename amrex::ParticleTile<T_ParticleType, NArrayReal, NArrayInt, Allocator>::SoA::IntVector> >&, bool) const [with T_ParticleType = amrex::Particle<3, 0>; int T_NArrayReal = 0; int T_NArrayInt = 0; Allocator = std::allocator; T_CellAssignor = amrex::DefaultAssignor]’ at /home/runner/work/amrex/amrex/Src/Particle/AMReX_ParticleIO.H:623:36:
/usr/include/c++/13/bits/stl_construct.h:119:7: error: potential null pointer dereference [-Werror=null-dereference]
119 | ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
|
The |
This reverts commit c5d1b5a.
| where[grid] = VisMF::FileOffset(ofs); | ||
|
|
||
| if (count[grid] == 0) { continue; } | ||
| if (count[grid] <= 0) { continue; } |
|
Thank you for your help, it works 🎉 And fixes a warning 🎉 |
Summary
Needed to cover SIMD features and generic SIMD/non-SIMD patterns.
Bravely vibe coded, but now reviewed and improved for sensibility.
Additional background
#4924 #4607 #4600 #4520
Checklist
The proposed changes: