DABC threads tests, November 14
This is more generic tests with treads and DABC.
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.
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.
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 %
- 14 Nov 2007