precice icon indicating copy to clipboard operation
precice copied to clipboard

preCICE allows mixing different configuration files

Open ajaust opened this issue 5 years ago • 5 comments

It is possible to mix implicit and explicit couplings.

Describe your setup

Operating system (e.g. Linux distribution and version): Ubuntu 18.04 preCICE Version: Commit cdf38703e0ad7debbd76c6785fdc0d3d9d3d2dfc from this PR: https://github.com/precice/precice/pull/84 as debug build

preCICE is used via Python using the bindings v2.1.1.1

Describe the problem

One can mix implicit and explicit couplings. The solver using the explicit coupling will interpret the subiterations of the implicit solver as time windows and participate. The simulation will eventually hang

Step To Reproduce

  1. Choose a serial-implicit coupling configuration of your solver
  2. Choose a serial-explicit coupling configuration of your solver
  3. Run the simulation
  4. The serial-implicit solver will start the subiterations while the serial-explicit solver will interpret each subiteration as time windows.

I have only testet this with serial coupings.

Expected behaviour

I would expect an error message and termination of the solvers.

ajaust avatar Nov 14 '20 20:11 ajaust

You mean that you use two different precice-config.xmls for both coupled solvers? That is not allowed and could indeed be a good idea to implement a check for this.

uekerman avatar Nov 15 '20 10:11 uekerman

You mean that you use two different precice-config.xmls for both coupled solvers?

Yes, I mixed two different config files. Sorry for being unclear here.

Even for the "same" config file one could mess up:

  1. Start solver A with precice-config.xml. It will wait for solver B.
  2. Edit precice-config.xml to use a different coupling/different settings and save the changes.
  3. Start solver B with precice-config.xml. Simulation will start, but most likely with unexpected behavior.

In this case it would be the "same" file, but with different content.

Maybe it would be safest to compute a hash of the configuration files used and then to compare them?!

ajaust avatar Nov 15 '20 11:11 ajaust

This PR is related to #669. We need a validation step in the master-master handshake. Integrating the hash of the configuration file content should be simple.

fsimonis avatar Nov 16 '20 15:11 fsimonis

Maybe we should rename the issue to "preCICE allows mixing of different configurations" again?

I have not tested it further, but I assume one could also start solvers with other options being changed/mixed, like one solver starting with max-iterations value=10 and the other one with max-iterations value=20?!

ajaust avatar Nov 16 '20 15:11 ajaust

A possible good-enough implementation could be to hash the content of the configuration file after reading and exchange this when establishing connections between solvers.

fsimonis avatar Oct 15 '24 14:10 fsimonis