Adds element index range to properties/kernels - #1932
Merged
Conversation
- [x] Updates domain containers with element index range indexing
Contributor
There was a problem hiding this comment.
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_mappingViews 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
ElementIndexRangeand exposebase_ispecfor 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)); | ||
| }); |
icui
approved these changes
Jun 16, 2026
lsawade
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please describe the changes/features in this pull request.
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.