Skip to content

dirichlet_from_buffers is GPU_DECLAREd and GPU_UPDATEd from different modules; a missed update silently degrades Dirichlet BCs #1790

Description

@sbryngelson

dirichlet_from_buffers is declared and device-mapped in one module but assigned and updated from another:

  • src/common/m_boundary_primitives.fpp:21-22logical :: dirichlet_from_buffers = .false. + GPU_DECLARE(create=...)
  • src/common/m_boundary_common.fpp:42-44 — assigned, then GPU_UPDATE(device='[dirichlet_from_buffers]')
  • src/common/m_boundary_primitives.fpp:886 — read on device: if (.not. dirichlet_from_buffers) then

This is the same cross-module declare/update idiom as Re_idx, so it is not novel. The concern is the failure mode: if the device update ever fails to take, the flag reads .false. on device and Dirichlet BCs silently degrade to zero-gradient — wrong boundary physics with no error, no NaN, and no crash.

Not a known-failing case today; filing so the fragility is tracked rather than rediscovered from a wrong answer.

Suggested check: confirm on Cray CCE (where declare/update attachment has bitten us before) that the device value actually reflects the host assignment at the read site, e.g. a one-off assertion or a targeted case with use_dirichlet_buffers = .true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions