Skip to content

Python interface socket "desync"

There seems to be a timing issue with the socket for the Python API. This only happens if the exchanged data is relatively large and is somewhat random. I've included a test case that reproduces the issue with some certainty:

I'm using the develop-branch and build it with Python 3 support by configuring with:

CPPFLAGS=-I/usr/include/suitesparse PYTHON_VERSION=3 ./configure --enable-python=yes

When the error occurs, the Python script's last output is:

cmd to peer: 2 (REGULAR_DATA)
Sending node dynamics data
Sent 134808 bytes, dynamics size is 134808
cmd from peer: 5 (ABORT)
got ABORT from peer

But MBDyn aborts with:

StructExtForce(50000): recv() failed (got 73088 of 134808 bytes)

The cause appears to be a time delay between calling mbcNodal.recv() and mbcNodal.send(), I found a workaround for this by adding a sleep time to the force element: force: 5000, external structural, socket, ... sleep time, 0.05, coupling, tight, .... However, this is not a good permanent solution, since having to sleep every iteration, slows down the simulation by a lot. I first noticed the problem when I tried to include the node orientation in the communication because this usually doubles the exchange data size.

This discussion in the mailing list seems to be about this issue as well.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information