ASTE OpenFOAM Setting up primary communication

Hi,
I am currently extending the OpenFOAM adapter to read accelerations. The other participant will be a control software written in Matlab, which is currently not available and developed by somebody else. The Matlab participant shall write a single acceleration vector per time step, which I plan on writing consistently to the interface patch in OpenFOAM. For testing I have set up ASTE, which reads the acceleration data from a dummy vtu mesh. Currently, only the basics of the acceleration module are implemented (creating interface, readers and writers) which allows the Simulation to run up to the step at which communication is taking place. However, at this point the the preCICE gets stuck at:
Setting up primary communication to coupling partner/s

My setup involves two separate docker containers, one running OpenFOAM+preCICE+customOpenFOAMadapter the other running ASTE+preCICE. Both Docker containers are started with the UID passed to the container and both have access to the common folder (…/), so this should not be an issue of permissions.
I also don’t see any of the other issues highlighted here Help! The participants are not finding each other! - #2 by Makis)

Is there any reason why preCICE might get stuck? Could it be due to the OpenFOAM side not being fully implemented? I was expecting preCICE to throw some error if something was wrong due to this.
This is the corresponding config:
precice-config.xml (2.8 KB)
ASTE config and preciceDict below:
aste-config.json.txt (358 Bytes)
preciceDict.txt (471 Bytes)

Thanks in advance!
David

EDIT: Added ASTE and Openfoam outputs

As a quick update. I saw that the build tests for ASTE throw on fail on test 13 (mapping). I previously ignored this error, since it I figured this might not apply to me, since I am not using the mapping function. It appears to be a VTK issue, so I decided to build it from source. I am running into some issues with the building and the python libs.

 -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) 
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
 CMake/FindPythonLibs.cmake:213 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMake/vtkPythonWrapping.cmake:1 (find_package)
 Wrapping/PythonCore/CMakeLists.txt:2 (include)

After failing to build VTK7, I switched to VTK9. Now test 13 still fails, but not due to a VTK error anymore:

13/15 Testing: aste.example.mapping_tester
13/15 Test: aste.example.mapping_tester
Command: "/sources/aste-3.1.0/examples/mapping_tester/run.sh" "FIXTURE_REQUIRES" "mapping_tester"
Directory: /sources/aste-3.1.0/examples/mapping_tester
"aste.example.mapping_tester" start time: Jun 10 14:11 UTC
Output:
----------------------------------------------------------
++ pwd
+ TEST_LOCATION=/sources/aste-3.1.0/examples/mapping_tester
+ export TEST_LOCATION
+ MAPPING_TESTER=/sources/aste-3.1.0/examples/mapping_tester/../../tools/mapping-tester/
+ TEST_CASE_LOCATION=/sources/aste-3.1.0/examples/mapping_tester/case
+ python3 /sources/aste-3.1.0/examples/mapping_tester/../../tools/mapping-tester//generate.py --setup /sources/aste-3.1.0/examples/mapping_tester/setup-test.json --outdir /sources/aste-3.1.0/examples/mapping_tester/case --template /sources/aste-3.1.0/examples/mapping_tester/../../tools/mapping-tester//config-template.xml --exit
Generating /sources/aste-3.1.0/examples/mapping_tester/case/tps/consistent/coarse_mesh-fine_mesh/2-2
Generating /sources/aste-3.1.0/examples/mapping_tester/case/np/consistent/coarse_mesh-fine_mesh/2-2
Generated 2 cases
Generating master scripts
+ python3 /sources/aste-3.1.0/examples/mapping_tester/../../tools/mapping-tester//preparemeshes.py --setup /sources/aste-3.1.0/examples/mapping_tester/setup-test.json --outdir /sources/aste-3.1.0/examples/mapping_tester/case --force
---[ASTE-Evaluate] INFO : Reading input mesh "/sources/aste-3.1.0/examples/mapping_tester/fine_mesh.vtk"
---[ASTE-Evaluate] INFO : Mesh contains 3458 points.
---[ASTE-Evaluate] INFO : Evaluated "0.78 + cos(10*(x+y+z))" on the input mesh "/sources/aste-3.1.0/examples/mapping_tester/fine_mesh.vtk".
---[ASTE-Evaluate] INFO : Evaluated function saved to "0.78 + cos(10*(x+y+z))" variable on output mesh "fine_mesh.vtu"
---[ASTE-Evaluate] INFO : Written output to "/sources/aste-3.1.0/examples/mapping_tester/case/meshes/fine_mesh/1/fine_mesh.vtu".
---[ASTE-Partition] INFO : Processing mesh /sources/aste-3.1.0/examples/mapping_tester/case/meshes/fine_mesh/1/fine_mesh.vtu
---[ASTE-Partition] INFO : Writing output to /sources/aste-3.1.0/examples/mapping_tester/case/meshes/fine_mesh/2/fine_mesh
---[ASTE-Evaluate] INFO : Reading input mesh "/sources/aste-3.1.0/examples/mapping_tester/coarse_mesh.vtk"
---[ASTE-Evaluate] INFO : Mesh contains 438 points.
---[ASTE-Evaluate] INFO : Evaluated "0.78 + cos(10*(x+y+z))" on the input mesh "/sources/aste-3.1.0/examples/mapping_tester/coarse_mesh.vtk".
---[ASTE-Evaluate] INFO : Evaluated function saved to "0.78 + cos(10*(x+y+z))" variable on output mesh "coarse_mesh.vtu"
---[ASTE-Evaluate] INFO : Written output to "/sources/aste-3.1.0/examples/mapping_tester/case/meshes/coarse_mesh/1/coarse_mesh.vtu".
---[ASTE-Partition] INFO : Processing mesh /sources/aste-3.1.0/examples/mapping_tester/case/meshes/coarse_mesh/1/coarse_mesh.vtu
---[ASTE-Partition] INFO : Writing output to /sources/aste-3.1.0/examples/mapping_tester/case/meshes/coarse_mesh/2/coarse_mesh
Warning: outdir "/sources/aste-3.1.0/examples/mapping_tester/case" already exisits.
Preparing Mesh fine_mesh in /sources/aste-3.1.0/examples/mapping_tester/case/meshes/fine_mesh/1
Preparing Mesh fine_mesh with 2 paritions in /sources/aste-3.1.0/examples/mapping_tester/case/meshes/fine_mesh/2
Preparing Mesh coarse_mesh in /sources/aste-3.1.0/examples/mapping_tester/case/meshes/coarse_mesh/1
Preparing Mesh coarse_mesh with 2 paritions in /sources/aste-3.1.0/examples/mapping_tester/case/meshes/coarse_mesh/2
+ export ASTE_A_MPIARGS=
+ ASTE_A_MPIARGS=
+ export ASTE_B_MPIARGS=
+ ASTE_B_MPIARGS=
+ cd /sources/aste-3.1.0/examples/mapping_tester/case
+ bash ./runall.sh
==========
= tps (consistent) coarse_mesh - fine_mesh
==========
env: 'time': No such file or directory
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
env: 'time': No such file or directory
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
env: 'time': No such file or directory
env: 'time': No such file or directory
[da415d3a7598:09253] *** Process received signal ***
[da415d3a7598:09253] Signal: Segmentation fault (11)
[da415d3a7598:09253] Signal code: Address not mapped (1)
[da415d3a7598:09253] Failing at address: 0x7f7eec981d30
Terminated
<end of output>
Test time =   4.98 sec
----------------------------------------------------------
Test Failed.
"aste.example.mapping_tester" end time: Jun 10 14:11 UTC
"aste.example.mapping_tester" time elapsed: 00:00:04
----------------------------------------------------------

Regardless of the issues with VTK, I think I know where the problem lies. I was using two separate dockers for ASTE and OpenFOAM. When running them both, there is some kind of permissions issue with the mounted volume I use for exchanging data. When I start on container and the attach to it using docker exec, communication can be established…
I would love to understand why it doesn’t work with two separate containers, which both have the same user and group ids as the host system.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

How do you connect the containers?

For our system tests, we use Docker Compose, in which case it is important to mount the same volume and to set a specific network interface:

Hi,
Yes it turns out it was a network issue, but I wasn’t able to add this here since I had already marked the topic as solved.
I am not using Docker Compose (yet), but I now simply start the first participant container and then I start the second one using the --network argument, which allows me to specify a running container. This way they share the same network.

1 Like