Issue with copy behavior in spiner EOS
@Yurlungur is already working on this.
Since Mar 13, 2025.
- Dominant language
- C++
- Stars
- 39
- Forks
- 22
- Avg merge
- 10h 22m
- Merged PRs (30d)
- 3
Description
In https://github.com/lanl/singularity-eos/pull/375 , a test was added that looks like this:
portableFor(
"Positive temperature test", 0, n_eos, PORTABLE_LAMBDA(const int i) {
const auto &this_eos = v_EOS[i];
// Find the reference state (really we just want the density :shrug:)
Real rho_ref;
Real temp_ref;
Real sie_ref;
Real press_ref;
Real cv_ref;
Real bmod_ref;
Real dpde_ref;
Real dvdt_ref;
this_eos.ValuesAtReferenceState(rho_ref, temp_ref, sie_ref, press_ref, cv_ref,
bmod_ref, dpde_ref, dvdt_ref);
// Sanity check on the density to make sure we don't screw this up
PORTABLE_ALWAYS_REQUIRE(rho_ref > 0, "Zero reference density");
Before this, a host array of EOS objects was created and GetOnDevice() was called for each model (even if it technically wasn't necessary). Then the array was copied into the device array, v_EOS.
If instead I create a copy of the EOS in v_EOS by removing the auto & from the above code so that this_eos is now
const auto this_eos = v_EOS[i];
then the PORTABLE_ALWAYS_REQUIRE statement above fails for the spiner EOS. It passes for all other EOS though.
This also happens when the const qualifier is removed:
auto this_eos = v_EOS[i];
or when using the EOS type instead of auto.
I interpret this as the copied spiner EOS having an uninitialized state somehow, but I don't fully understand this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.