Skip to content

Adds element index range to properties/kernels - #1932

Merged
Rohit-Kakodkar merged 1 commit into
develfrom
domain-container-element-index-range
Jun 17, 2026
Merged

Adds element index range to properties/kernels#1932
Rohit-Kakodkar merged 1 commit into
develfrom
domain-container-element-index-range

Conversation

@Rohit-Kakodkar

Copy link
Copy Markdown
Collaborator

Description

Please describe the changes/features in this pull request.

  • Updates domain containers with element index range indexing

Issue Number

If there is an issue created for these changes, link it here

Checklist

Please make sure to check developer documentation on specfem docs.

  • I ran the code through pre-commit to check style
  • THE DOCUMENTATION BUILDS WITHOUT WARNINGS/ERRORS
  • I have added labels to the PR (see right hand side of the PR page)
  • My code passes all the integration tests
  • I have added sufficient unittests to test my changes
  • I have added/updated documentation for the changes I am proposing
  • I have updated CMakeLists to ensure my code builds
  • My code builds across all platforms

- [x] Updates domain containers with element index range indexing
@Rohit-Kakodkar
Rohit-Kakodkar requested review from icui and lsawade June 15, 2026 13:52
@Rohit-Kakodkar
Rohit-Kakodkar marked this pull request as ready for review June 15, 2026 15:34
Copilot AI review requested due to automatic review settings June 15, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the assembly properties/kernels containers to use contiguous element index ranges (via ElementIndexRange) and replaces the old View-based element→container index lookup with an arithmetic mapping based on per-(medium,property) base offsets.

Changes:

  • Replaced host/device property_index_mapping Views with a typed arithmetic mapping (ispec - base_ispec) stored per (medium, property) combination.
  • Updated properties/kernels host+device data access helpers to use the new typed mapping API.
  • Updated domain container constructors to accept ElementIndexRange and expose base_ispec for offset initialization.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/specfem/assembly/properties/store_on_host.hpp Switch host property writes to typed arithmetic index mapping.
core/specfem/assembly/properties/load_on_host.hpp Switch host property reads to typed arithmetic index mapping.
core/specfem/assembly/properties/load_on_device.hpp Switch device property reads to typed arithmetic index mapping.
core/specfem/assembly/properties.hpp Remove View-based mapping usage in max() and use typed arithmetic mapping.
core/specfem/assembly/kernels/data_access/store_on_host.hpp Switch host kernel writes to typed arithmetic index mapping.
core/specfem/assembly/kernels/data_access/store_on_device.hpp Switch device kernel writes to typed arithmetic index mapping.
core/specfem/assembly/kernels/data_access/load_on_host.hpp Switch host kernel reads to typed arithmetic index mapping.
core/specfem/assembly/kernels/data_access/load_on_device.hpp Switch device kernel reads to typed arithmetic index mapping.
core/specfem/assembly/kernels/data_access/add_on_host.hpp Switch host kernel accumulation to typed arithmetic index mapping.
core/specfem/assembly/kernels/data_access/add_on_device.hpp Switch device kernel accumulation to typed arithmetic index mapping.
core/specfem/assembly/kernels.hpp Update kernels container initialization to match new value_containers initializer API.
core/specfem/assembly/impl/value_containers.hpp Replace mapping Views with per-tag base offsets and provide typed arithmetic mapping method.
core/specfem/assembly/impl/domain_properties.tpp Update properties initialization to use ElementIndexRange and set base_ispec.
core/specfem/assembly/impl/domain_properties.hpp Update properties ctor signatures to ElementIndexRange and add base_ispec.
core/specfem/assembly/impl/domain_kernels.hpp Update kernels ctor signature to ElementIndexRange and add base_ispec.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 72 to 76
KOKKOS_LAMBDA(const int i) {
local_ispecs(i) =
index_mapping(ispecs(i)); // Map the ispec to the property index
properties.template property_index_mapping<MediumTag, PropertyTag>(
ispecs(i));
});
@Rohit-Kakodkar
Rohit-Kakodkar merged commit 145f2e8 into devel Jun 17, 2026
10 checks passed
@Rohit-Kakodkar
Rohit-Kakodkar deleted the domain-container-element-index-range branch June 17, 2026 13:26
@Rohit-Kakodkar Rohit-Kakodkar added the performance enhancement Leads to performance improvements label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance enhancement Leads to performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants