precice icon indicating copy to clipboard operation
precice copied to clipboard

Incorrect context matching in configuration checks

Open fsimonis opened this issue 1 year ago • 4 comments

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:

  1. https://github.com/precice/precice/blob/6552ffae7e6ef180c745fc0792f040cf1ee522f1/src/m2n/config/M2NConfiguration.cpp#L145-L147 Introduced in bacb133b7d147cef6349377a8c04c40f78cd9e9e
  2. https://github.com/precice/precice/blob/6552ffae7e6ef180c745fc0792f040cf1ee522f1/src/mapping/config/MappingConfiguration.cpp#L396-L402 Introduced in 9245132881f335e530b5990e9595b1d69697b89c
  3. ParticipantConfiguration: #1965

Expected behaviour

Correctly check these conditions.

fsimonis avatar Feb 28 '24 11:02 fsimonis

  1. is not very wrong, but we could add the participant name. Only makes a difference if there are multiple m2ns.
  2. is indeed a bug.

uekerman avatar Feb 28 '24 16:02 uekerman

Looks like 2 needs to be checked somewhere else altogether. MappingConfiguration has no idea which Participant it is attached to.

fsimonis avatar Feb 29 '24 12:02 fsimonis

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?

MakisH avatar Mar 01 '24 08:03 MakisH

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");

fsimonis avatar Mar 01 '24 10:03 fsimonis