precice.Interface not working

Hello everyone,
I am a new user of preCICE, and I just installed it on top of a FEniCS docker image. I also installed python bindings which are ok since “import precice” works without any errors.

Unfortunately, when I try to test it using the provided solver-dummy and the 1D Elastic Tube cases, both scripts get stuck at the following row:

solver-dummy:

interface = precice.Interface(participant_name, configuration_file_name,
                              solver_process_index, solver_process_size)

1D Elastic Tube:

interface = precice.Interface("Fluid", args.configurationFileName, 0, 1)

There are no outputs or error messages in the terminal, I only get a blinking cursors and the preCICE configuration seems stuck in an infinite loop.

I don’t know what to do. Thank you in advance for the help.

Hi @bayswiss!

Could you please post the screen output/log of the solvers? How did you identify that the solvers gets stuck exactly there?

Also, just to clarify: Are you running both solvers in the same Docker container?

Hi @Makis, thank you for the quick response.

There is no log/output. As I said, the process seems to be ongoing and the terminal cursor blinks forever. I would share a black screen.

To identify the line I just added some print commands before and after. It gets stuck at the precice.Interface() line.

Yes, I am running both solvers in the same Docker container.

Thank you very much.

Any ideas of what could be the issue?

I guess (hope) that something easy-to-debug is going on here. Could you please explain step by step how you are running the cases?

Sharing the Dockerfile would also help.

As I read in this forum, I started installing precice on top of the fenics docker image (specifically, dolfinx/dolfinx:nightly).

I followed the installation steps for Ubuntu given here:
https://precice.org/installation-packages.html#ubuntu

Then I installed python bindings as explained here:
https://precice.org/installation-bindings-python.html#installation

Then I downloaded the solverdummy case files and I run the given commands on two terminals:

python3 solverdummy.py precice-config.xml SolverOne
python3 solverdummy.py precice-config.xml SolverTwo

of course I read the Readme file before and installed all the needed requirements.

It seems related to something not working with the configuration file, like r/w permissions or network.

What I can tell you is that the solvers work perfectly outside of the container, if I install preCICE directly on my system.

Thank you

1 Like

You could check the owner and file permissions in the container, e.g., with ls -la.

During initialization, one of the two solver writes a file in a precice-run/ directory, next to the configuration file (precice-config.xml). Is this directory created? It should contain some kind of address inside.

It is very interesting that this only happens when running in Docker. Try setting network="eth0" in your m2n tag: Communication configuration | preCICE - The Coupling Library

Nothing seemed to work.

I installed from scratch everything on my workstation (before I was working on my laptop), following the same steps, and now it works. I have to go deeper into this, because I need to use the laptop too.

I will give you updates.

2 Likes