I met a problem when I coupled preCICE with OpenFOAM. OpenFOAM has been installed through Singularity container https://sylabs.io/guides/3.5/user-guide/ on our school’s HPC (Centos 7). But preCICE was built with Cmake directly on the HPC. Is it possible to connect preCICE with OpenFOAM which is built in Singularity or other containers? Or do I need to install OpenFOAM on the HPC without Singularity?
I have not worked with Singularity, but I assume it works very similarly to Docker.
Docker containers are (in the application layer) isolated systems and cannot access external libraries. Therefore, no, you will not be able to link to preCICE, at least not easily.
If you want to stick to OpenFOAM through a container, you could try building the adapter inside the container (see how we do it for our system tests). Then, you could specify in the precice-config.xml that you want to use TCP sockets and you could specify a shared directory as the exchange-directory.
During the initialization phase, each participant writes a file with its (network) address into the exchange-directory path. If both participants can access this, then they can find each other.