DABC threads tests, November 14

This is more generic tests with treads and DABC.

BNet prototype

One can distribute different BNet modules over different number of threads. Three situation were tested:
  • 1 thread for all 10 modules
  • 3 threads - local controller, sender, receiever
  • 10 threads - separate thread per module

In the table InfiniBand network datarate is shown.

Buffer size 1 thrdSorted ascending 3 thrd 10 thrd
32K 340 220 180
64K 620 390 320
128K 755 700 610
256K 875 870 810

Core tests

Code in "core/test/coretest.cxx" file

This is simple chain of 10 modules, connected one after another. First module produces buffers and sends them to output, next modules retransmit all buffers from input to output, last module takes buffer from input and release them.

There is two implementation of such modules:
  • with explicit main loop (based on ModuleM class)
  • with event-driven module (based on ModuleF class)

For first case each module requires explicit thread, for second case one can use as many thread as one wants. While we have double-CPU machine, tests with one, two and ten threads were done. On 64-bit machine 64-bit code was used.

In table shown time (in microsec) need to complete full chain of transfer for one buffer.

Machine 10 thrd (M) 10 thrd (F) 2 thrd (F) 1 thrd (F)
lxg0516 Intel 2.4 Ghz, Debian 118 113 20.4 14.2
depc237 Intel Core 2 Duo 2.4 Ghz, SuSE 10.2 35.4 32.8 7.0 5.0
depcp001 Double Opteron 2.2 Ghz, SuSE 10.2 30.7 29.8 4.7 5.3

It is clear, that ModuleM is slower than ModuleF. It is because of much more frequent use of pthread_condition_wait() function. It's typical usage shown in next log output, where each thread in destructor reports percentage of condition wait calls.

local: ~Thread Module9 realwait:97.2390433 %
local: ~Thread Module8 realwait:82.6050868 %
local: ~Thread Module7 realwait:86.8371212 %
local: ~Thread Module6 realwait:83.7662101 %
local: ~Thread Module5 realwait:96.3710427 %
local: ~Thread Module4 realwait:35.0045719 %
local: ~Thread Module3 realwait:89.5340256 %
local: ~Thread Module2 realwait:93.4141722 %
local: ~Thread Module1 realwait:85.0700781 %
local: ~Thread Module0 realwait:96.2913233 %

In case of two threads of ModuleF it is less than 1%:
local: ~Thread MainThread1 realwait:0.2920439 %
local: ~Thread MainThread0 realwait:0.0055936 %

In case of single thread there is practically no waits at all:
local: ~Thread MainThread realwait:0.0000640 %

LinevSergey - 14 Nov 2007
Topic revision: r3 - 2007-11-14, LinevSergey
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)