Incorrect context matching in configuration checks
Describe your setup
preCICE Version: 6552ffae7e6ef180c745fc0792f040cf1ee522f1 (develop)
Describe the problem
In the configuration step, the local participant has an additional context including the local rank and the total amount of parallel ranks, analogous to MPI comm rank and size.
This size only makes sense to check, when the currently configured participant actually matches the local participant.
We use incomplete checks in:
- https://github.com/precice/precice/blob/6552ffae7e6ef180c745fc0792f040cf1ee522f1/src/m2n/config/M2NConfiguration.cpp#L145-L147 Introduced in bacb133b7d147cef6349377a8c04c40f78cd9e9e
- https://github.com/precice/precice/blob/6552ffae7e6ef180c745fc0792f040cf1ee522f1/src/mapping/config/MappingConfiguration.cpp#L396-L402 Introduced in 9245132881f335e530b5990e9595b1d69697b89c
- ParticipantConfiguration: #1965
Expected behaviour
Correctly check these conditions.
- is not very wrong, but we could add the participant name. Only makes a difference if there are multiple m2ns.
- is indeed a bug.
Looks like 2 needs to be checked somewhere else altogether. MappingConfiguration has no idea which Participant it is attached to.
Where would you suggest checking this?
This size only makes sense to check, when the currently configured participant actually matches the local participant.
I am not sure I understand: In which situation the currently configured would be different than the local?
In which situation the currently configured would be different than the local?
- A coupled to B, B coupled to C.
- A runs in parallel, B and C run in serial.
- C uses a geometric multiscale mapping
- Then participant A triggers this error.
I think this needs to be checked in the constructor of these Mappings for now. PRECICE_CHECK(!utils::IntraComm::isParallel(), "Not supported");