Skip to content

Warnings #567

Description

@aaadelmann

Warning Summary

This summarizes warnings observed in two PR-544 builds.

Build Summary

Build Site Configure warnings Build warning rows Unique grouped rows
3766785 / PR-544-gh200-Release-1-rank Daint gh200 CUDA 12.9.1 0 38 4
3766775 / PR-544-openmp-Release-4-ranks Eiger OpenMP 0 50 2

Grouped Warnings

Count in 3766785 GH200 CUDA Count in 3766775 Eiger OpenMP File Line Warning
10 0 /user-environment/env/default/include/experimental/__p0009_bits/utility.hpp 201 CUDA warning #20013-D: calling constexpr host function min from __host__ __device__ function in_range
10 0 /user-environment/env/default/include/experimental/__p0009_bits/utility.hpp 202 CUDA warning #20013-D: calling constexpr host function max from __host__ __device__ function in_range
10 0 /user-environment/env/default/include/experimental/__p0009_bits/utility.hpp 219 CUDA warning #20013-D: calling constexpr host function max from __host__ __device__ function check_mul_result_is_nonnegative_and_representable
8 0 unit_tests/Particle/ParticleUpdateNonuniform.cpp 881 CUDA warning #128-D: loop is not reachable
0 25 src/Communicate/Archive.hpp 343 GCC/OpenMP warning: 'value' may be used uninitialized [-Wmaybe-uninitialized]
0 25 src/Communicate/Archive.hpp 340 GCC note: 'value' declared here

Interpretation

The GH200 CUDA build has 38 warning. These reduce to two issues:

  1. 30 warning come from the environment mdspan implementation:

    /user-environment/env/default/include/experimental/__p0009_bits/utility.hpp
    

    The CUDA compiler warns that std::min / std::max-like constexpr host functions are called from __host__ __device__ functions. The compiler suggests --expt-relaxed-constexpr. These warnings are external to IPPL source, but they may be triggered through IPPL/Kokkos use of mdspan.

  2. 8 warning rows come from:

    unit_tests/Particle/ParticleUpdateNonuniform.cpp:881
    

    The warning is:

    warning #128-D: loop is not reachable
    

    This points at:

    REQUIRE_RANKS(PREF_RANKS);

    inside TYPED_TEST(TestParticleUpdateORB, ThreeDCornerMigrationAfterOrb), after:

    if constexpr (TestFixture::Dim != 3) {
        GTEST_SKIP() << "3-D specific test";
    }

    Likely cause: CUDA sees unreachable control flow after template instantiation / macro expansion for the non-3D typed-test variants.

The Eiger OpenMP build has 50 warning. These reduce to one real warning plus its repeated note:

  1. 25 warning rows come from:

    src/Communicate/Archive.hpp:343
    

    The warning is:

    'value' may be used uninitialized [-Wmaybe-uninitialized]
    

    The relevant code is:

    T value;
    char* dst = reinterpret_cast<char*>(&value);
    copyBytes(dst, src, size);
    view.data()[i](d) = value;

    GCC does not prove that copyBytes(dst, src, size) initializes all bytes of value before the assignment. This is probably a false positive if copyBytes always copies sizeof(T) bytes, but the warning points at a fragile pattern.

  2. 25 additional warnings are the associated GCC note:

    src/Communicate/Archive.hpp:340:23: note: 'value' declared here
    

Possible Follow-Up

  • For the Archive.hpp warning, initialize value defensively:

    T value{};

    This should silence GCC and avoid any real uninitialized-read risk if the copy path ever changes.

  • For the ParticleUpdateNonuniform.cpp CUDA warning, avoid placing REQUIRE_RANKS(PREF_RANKS) in a path that CUDA sees after a compile-time skipped branch. One option is to move the body into an else branch:

    if constexpr (TestFixture::Dim != 3) {
        GTEST_SKIP() << "3-D specific test";
    } else {
        REQUIRE_RANKS(PREF_RANKS);
        ...
    }
  • For the external mdspan CUDA warnings, options are:

    • enable --expt-relaxed-constexpr for CUDA builds if acceptable,
    • check whether a newer Kokkos/mdspan combination avoids the warning,
    • suppress this specific CUDA diagnostic for external/system headers if the project policy allows it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions