[MBDyn-users] Socket communication overhead

Richard Crozier r.crozier at ed.ac.uk
Thu May 25 11:50:30 CEST 2017

On 28/04/17 19:49, Pierangelo Masarati wrote:
> On 04/27/2017 10:29 PM, Richard Crozier wrote:
>> I thought tcp sockets will always have higher overhead than local, 
>> particularly for many small messages as headers and things are 
>> inserted for TCP and more checking is done, although I wouldn't have 
>> thought the diff would be that large. A colleague in IT suggested the 
>> buffer sizes would be worth investigating, but he didn't look at the 
>> socket code.
>> I'm using Mint Linux 17.3 which is based off Ubuntu 14.04, although 
>> I'm using the Linux 4.4.0-34 kernel which is not the default. I could 
>> try on another Linux based OS quite easily here if you think it is 
>> worth checking.
> Please do, if you don't mind.  Thanks, p.

I finally had a chance to test this, and I see the same slowdown for TCP 
vs local sockets on another machine using Scientific Linux 7.2, more detail:

Linux version 3.10.0-514.16.1.el7.x86_64 
(mockbuild at sl7-uefisign.fnal.gov) (gcc version 4.8.5 20150623 (Red Hat 
4.8.5-11) (GCC) ) #1 SMP Wed Apr 12 07:10:20 CDT 2017

This however, is using my code. I attempted to benchmark a minimal case, 
without my matlab interface, using the test_strext_cxx (or whatever it 
is) test function but because it's autotools and these aren't actually 
installed you can't actually benchmark them as the libraries they call 
are actually fake scripts not the real libraries. I couldn't hack the 
build system to just install them as the release does not contain 
bootstrap.sh so I can't make changes to the build system. Even then 
extracting timing info for libraries is really difficult. Some simple 
timing tests I did weren't really giving the same kind of results, but 
it was for a very simple problem.

Incidentally not having bootstrap.sh is also causing me difficulty as I 
am trying to cross-compile mbdyn for windows and think I'm hitting an 
error others had when compiling mbdyn under cygwin:


my cross-compile ends with a very similar error:

libtool: link: lib -OUT:.libs/liby12.lib  y12mae.o y12maf.o y12mbe.o 
y12mbf.o y12mce.o y12mcf.o y12mde.o y12mdf.o y12mfe.o y12mge.o y12mhe.o
../../libtool: line 1112: lib: command not found
make[4]: *** [liby12.la] Error 127
make[4]: Leaving directory 
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory 
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory 
make[1]: *** [build-only-mbdyn_i686-w64-mingw32.static] Error 2
make[1]: Leaving directory `/opt/mxe'

later posts in this thread suggest a fix by modifying configure.in which 
I would like to try, but need the real development sources, or at least 
bootstrap.sh to do this.

by the way, I know I would need to modify the socket comms for winsock, 
but thought I'd try to get the cross-compile working first.

If you are interested, I am using the M Cross Environment to do the 
cross-compile, see mxe.cc for more information.



The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

More information about the MBDyn-users mailing list