Conception and Development of a Pipe & Filter Framework for C++
Johannes Ohlemacher November 23, 2016
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 1 / 38
Conception and Development of a Pipe & Filter Framework for C++ - - PowerPoint PPT Presentation
Conception and Development of a Pipe & Filter Framework for C++ Johannes Ohlemacher November 23, 2016 Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 1 / 38 Outline 1. Motivation
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 1 / 38
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 2 / 38
Motivation
◮ high performance, low overhead Pipe-and-Filter (P&F) Framework ◮ flexibel and extensible ◮ architecture designed to be implementable in other languages Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 3 / 38
Motivation
◮ high performance, low overhead Pipe-and-Filter (P&F) Framework ◮ flexibel and extensible ◮ architecture designed to be implementable in other languages
◮ How does the language influence the performance of TeeTime? ◮ Compare TeeTime with an established C++ solution (FastFlow) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 3 / 38
Goals
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 4 / 38
Foundations
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 5 / 38
Foundations
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 6 / 38
Foundations
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 7 / 38
Foundations Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 8 / 38
Foundations Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 9 / 38
Design and Evaluation of a SPSC Queue
1❤tt♣s✿✴✴❣✐t❤✉❜✳❝♦♠✴❢❛❝❡❜♦♦❦✴❢♦❧❧② 2❤tt♣✿✴✴✇✇✇✳❜♦♦st✳♦r❣ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 10 / 38
Design and Evaluation of a SPSC Queue
1❤tt♣s✿✴✴❣✐t❤✉❜✳❝♦♠✴❢❛❝❡❜♦♦❦✴❢♦❧❧② 2❤tt♣✿✴✴✇✇✇✳❜♦♦st✳♦r❣ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 10 / 38
Design and Evaluation of a SPSC Queue Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 11 / 38
Design and Evaluation of a SPSC Queue Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 12 / 38
Design and Evaluation of a SPSC Queue
◮ Scenario 1: pointers ◮ Scenario 2: std::vector<int> ◮ Scenario 3: 4x4 double matrix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 13 / 38
Design and Evaluation of a SPSC Queue Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 14 / 38
Design and Evaluation of TeeTime for C++
AbstractStage <<abstract>> +debugName +execute() +createRunnable() #addOutputPort(): OutputPort<T> #addInputPort(): InputPort<T> AbstractOutputPort <<abstract>> AbstractInputPort <<abstract>> InputPort<T> +receive(): T OutputPort<T> +send(value: T) * * Pipe<T> <<abstract>> source target Configuration #declareStageActive(stage, cpuAffinity) #declareStageNonActive(stage) #connectPorts(outputport, inputport, capacity) #createStage<T>(args...): Stage #createStageFromFunctionPtr(FunctionPtr): Stage #createStageFromLambda(lambda): Stage +executeBlocking() UnsynchedQueue<T> SynchedPipe<T, TQueue>
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 15 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 16 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 17 / 38
Design and Evaluation of TeeTime for C++
◮ Scenario 1: CPU intensive ◮ Scenario 2: IO intensive ◮ Scenario 3: CPU and IO intensive
◮ C1: TeeTime (no affinity) ◮ C2: TeeTime (prefer same CPU) ◮ C3: TeeTime (avoid same core) ◮ C4: FastFlow (multi alloc) ◮ C5: FastFlow (single alloc) ◮ C6: TeeTime (Java) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 18 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 19 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 20 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 21 / 38
Design and Evaluation of TeeTime for C++ Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 22 / 38
Design and Evaluation of TeeTime for C++ 2 4 6 8 10 12 14 16 18 20 22 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Speedup Number of worker threads MD5 Benchmark, 20µs Ideal C1: TeeTime (no affinity) C2: TeeTime (prefer same CPU) C3: TeeTime (avoid same core) C4: FastFlow (multi alloc) C5: FastFlow (single alloc) C6: TeeTime (Java) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 23 / 38
Design and Evaluation of TeeTime for C++ 2 4 6 8 10 12 14 16 18 20 22 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Speedup Number of worker threads MD5 Benchmark, 500ns Ideal C1: TeeTime (no affinity) C2: TeeTime (prefer same CPU) C3: TeeTime (avoid same core) C4: FastFlow (multi alloc) C5: FastFlow (single alloc) C6: TeeTime (Java) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 24 / 38
Design and Evaluation of TeeTime for C++ 2 4 6 8 10 12 14 16 18 20 22 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Speedup Number of worker threads IO Benchmark, 20000 * 1MB Ideal C1: TeeTime (no affinity) C2: TeeTime (prefer same CPU) C3: TeeTime (avoid same core) C4: FastFlow (multi alloc) C5: FastFlow (single alloc) C6: TeeTime (Java) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 25 / 38
Design and Evaluation of TeeTime for C++ 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000 22000 24000 26000 28000 30000 32000 34000 36000 38000 40000 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Time (milliseconds) Number of worker threads IO Benchmark, 20000 * 1MB C1: TeeTime (no affinity) C2: TeeTime (prefer same CPU) C3: TeeTime (avoid same core) C4: FastFlow (multi alloc) C5: FastFlow (single alloc) C6: TeeTime (Java) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 26 / 38
Design and Evaluation of TeeTime for C++ 2 4 6 8 10 12 14 16 18 20 22 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 Speedup Number of worker threads Mipmaps Benchmark, 100 * 512x512 Ideal C1: TeeTime (no affinity) C2: TeeTime (prefer same CPU) C3: TeeTime (avoid same core) C4: FastFlow (multi alloc) C5: FastFlow (single alloc) Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 27 / 38
Conclusions and Future Work
◮ in many cases even better due to less memory management ◮ TeeTime supports better modularity and stages are more reusable
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 28 / 38
Conclusions and Future Work
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 29 / 38
Appendix
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 30 / 38
Appendix
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 31 / 38
Appendix
Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 32 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 33 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 34 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 35 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 36 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 37 / 38
Appendix Johannes Ohlemacher Conception and Development of a Pipe & Filter Framework for C++ November 23, 2016 38 / 38