Skip to content
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

When loading an external field from file if the bounds in the file do not include ghost cells an out of bounds array access occurs and corrupts memory. #5588

Open
6 of 13 tasks
clarkse opened this issue Jan 22, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@clarkse
Copy link
Member

clarkse commented Jan 22, 2025

Description

In RZ/3D modes when loading an external field from a file, the tilebox that is looped over to load into the array is a grown tilebox.

Expected behavior

I expected only internal cells to be interpolated and the ghosts to be filled by setting the boundary conditions after a load.

How to reproduce

This is part of a CI test being developed in PR #5275

I needed to generate an OpenPMD file larger than the total domain to avoid accessing out of bounds array elements in the array that is loaded from file.

The problem arises from growing the tilebox of output in the kernel that interpolates data to the mesh from the file. In WarpXInitData.cpp: WarpX::ReadExternalFieldFromFile (
const std::string& read_fields_from_path, amrex::MultiFab* mf,
const std::string& F_name, const std::string& F_component)

System information

Please check all relevant boxes and provide details.

  • Operating system (name and version):
    • Linux: e.g., Ubuntu 22.04 LTS
    • macOS: e.g., macOS Monterey 12.4
    • Windows: e.g., Windows 11 Pro
  • Version of WarpX: e.g., latest, 24.10, etc.
  • Installation method:
    • Conda
    • Spack
    • PyPI
    • Brew
    • From source with CMake
    • Module system on an HPC cluster
  • Other dependencies: yes/no, describe
  • Computational resources:
    • MPI: e.g., 2 MPI processes
    • OpenMP: e.g., 2 OpenMP threads
    • CPU: e.g., 2 CPUs
    • GPU: e.g., 2 GPUs (NVIDIA, AMD, etc.)

This issue is being generated as a placeholder to discuss appropriate options. E.g. should an error be thrown, extrapolation, or zero filling occur when the total simulation domain exceeds the domain of the input file?

@clarkse clarkse added the bug Something isn't working label Jan 22, 2025
@RemiLehe RemiLehe self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants