Skip to content

mapping-tester fixes for errors caused by conservative mappings#250

Merged
davidscn merged 1 commit into
precice:developfrom
FabioTucciarone:conservative-mapping-tester-fixes
Oct 22, 2025
Merged

mapping-tester fixes for errors caused by conservative mappings#250
davidscn merged 1 commit into
precice:developfrom
FabioTucciarone:conservative-mapping-tester-fixes

Conversation

@FabioTucciarone
Copy link
Copy Markdown
Contributor

Main changes of this PR

This PR aims to fix some small problems in the mapping-tester concerning conservative mappings.

  • incorrect configuration causing crash
  • incorrect reading of timing data causing null entries

Description of the errors fixed by this PR

Executing a conservative mapping using the current config-template.xml causes the following error:

---[preCICE:B:0] (cplscheme::CouplingSchemeConfiguration in checkSubstepExchangeWaveformDegree) WARNING : You defined <exchange data="Data" ... to="A" /> in the <coupling-scheme:... />, but <participant name="A"> has no corresponding <read-data name="Data" ... />. Usually this means that there is an error in your configuration.---[preCICE:A:0] (cplscheme::CouplingSchemeConfiguration in checkSubstepExchangeWaveformDegree) WARNING : You defined <exchange data="Data" ... to="A" /> in the <coupling-scheme:... />, but <participant name="A"> has no corresponding <read-data name="Data" ... />. Usually this means that there is an error in your configuration.

---[preCICE:B:0] (cplscheme::BaseCouplingScheme in checkCouplingDataAvailable) ERROR : Data Data on mesh B-Mesh doesn't contain any samples while initializing a coupling scheme of participant B. There are two common configuration issues that may cause this. Either, make sure participant B specifies data Data to be written using tag <write-data mesh="B-Mesh" data="Data"/>. Or ensure participant B defines a mapping to mesh B-Mesh from a mesh using data Data.
terminate called after throwing an instance of 'precice::Error'

This is caused by a small error in the configuration of the coupling scheme.

Using the gatherstats.py script with a fix for the previous problem applied as follows:

python3 "${MAPPING_TESTER}"/gatherstats.py --outdir "${RUN_LOCATION}" --file statistics.csv

causes the entries for mapDataTime and computeMappingTime to be empty:

┌────────────┬────────────────┬─────────────┬────────────────────┐
│ globalTime ┆ initializeTime ┆ mapDataTime ┆ computeMappingTime │
│ ---        ┆ ---            ┆ ---         ┆ ---                │
│ i64        ┆ i64            ┆ str         ┆ str                │
╞════════════╪════════════════╪═════════════╪════════════════════╡
│ 42064406   ┆ 6942           ┆ null        ┆ null               │
└────────────┴────────────────┴─────────────┴────────────────────┘

Author's checklist

  • I used the pre-commit hook and used pre-commit run --all to apply all available hooks.
  • I added a test to cover the proposed changes in our test suite.
  • I updated the documentation in docs/README.md.
  • I added a changelog entry in ./changelog-entries/ (create if necessary).
  • I updated potential breaking changes in the tutorial precice/tutorials/aste-turbine.

@davidscn
Copy link
Copy Markdown
Member

@FabioTucciarone can you rebase and trigger the CI again?

- incorrect configuration causing crash
- incorrect reading of timing data causing null entries
Copy link
Copy Markdown
Member

@davidscn davidscn left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@davidscn davidscn merged commit ed7435e into precice:develop Oct 22, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants