Kdb Parallel Processing - peach and .Q.fc
Contents
- Parallel processing can be used to speed up calculations.
- The function must be costly enough to justify the messaging overhead.
- Take account of how work is being distributed.
- The normal rule of using vector operations still applies. (prefer .Q.fc)
- Parallelising on different functions/data is possible
Parallel processing can be used to speed up calculations
The function must be costly enough to justify the messaging overhead
When the function is fast the overhead of passing the data to the threads outweighs the parallelisation benefits
Take account of how work is being distributed
- PEACH - When 2 slaves, assigns items at 0,2,4,6.. to one thread. 1,3,5,7 to another.
- .Q.FC - Cuts vector into s equal sized continuous pieces, where s is number slaves passes whole vector piece at once to each thread
Performance for semi-realistic data sizes
Conclusion
- each was consistantly slow
- peach was faster except on data b.
- .Q.fc was slightly faster still except on a.
Careful sending unbalanced workloads to peach / .Q.fc. would be nice if they were smarter to batch into groups and queue them to each processor
.Q.fc appears to use less memory but this test isn't really representative in real world usage I've seen .Q.fc explode memory wise particularly when the vectors its passing to threads are just over a power of 2 as the memory manager then allocates basically double the space needed. peach is less likely to explode like that.