Using Static Code Analysis to Improve Performance of GridRPC Applications
description
Transcript of Using Static Code Analysis to Improve Performance of GridRPC Applications
![Page 1: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/1.jpg)
Using Static Code Analysis to Improve Performance of GridRPC Applications
Oleg Girko, Alexey LastovetskySchool of Computer Science & Informatics
University College DublinDublin, Ireland
![Page 2: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/2.jpg)
GridRPC and collective mapping GridRPC limitations
Individual mapping Client-server communication only No communication parallelism
Collective mapping Improved balancing of computation load Reduced volume of communication Improved balancing of communication load Increased parallelism of communication Reduced client memory usage and paging
Collective mapping requirements DAG of task depndencies Order of task execution
![Page 3: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/3.jpg)
Runtime discovery (SmartGridSolve)
• grpc_map() { … }• Discovery phase and execution phase• Constraints on the code
– No control flow dependent on remote task result
– grpc_local() { … } for side effects
![Page 4: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/4.jpg)
Runtime discovery: fault tolerance
• Error phase• Re-mapping• Re-execution from the beginning• Additional constraints on code
![Page 5: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/5.jpg)
ADL: algorithm definition language
• Separate algorithm definition• Parameterised grpc_map() { … }• Increased programming efforts
– Need to write a separate algorithm definition
– Need to keep ADL in sync with the algorithm– No check if ADL diverged from the algorithm
![Page 6: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/6.jpg)
Static code analysis
• Non-intrusive• Algorithm definition extracted by
code analysis• No limitations of other approaches
– No restrictions on code– No separate algorithm description
![Page 7: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/7.jpg)
Static code analysis: build process
![Page 8: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/8.jpg)
Static code analysis: build process
Source code is parsed by Clang to produce AST
![Page 9: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/9.jpg)
Static code analysis: build process
• Source code is parsed by Clang to produce AST Resulting ASTs from all files are analysed
together
![Page 10: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/10.jpg)
Static code analysis: build process
• Source code is parsed by Clang to produce AST• Resulting ASTs from all files are analysed
together Files containing blocks for collective mapping
are being preprocessed
![Page 11: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/11.jpg)
Static code analysis: build process
• Source code is parsed by Clang to produce AST• Resulting ASTs from all files are analysed
together• Files containing blocks for collective mapping
are being preprocessed Resulting C code is being compiled
![Page 12: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/12.jpg)
Static code analysis: build process
• Source code is parsed by Clang to produce AST• Resulting ASTs from all files are analysed
together• Files containing blocks for collective mapping
are being preprocessed Resulting C code is being compiled and linked
![Page 13: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/13.jpg)
Static code analysis: build process
• Source code is parsed by Clang to produce AST• Resulting ASTs from all files are analysed
together• Files containing blocks for collective mapping are
being preprocessed• Resulting C code is being compiled Appliction performance model is built at runtime
![Page 14: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/14.jpg)
Static code analysis: analysing AST
![Page 15: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/15.jpg)
Static code analysis: analysing AST
Function calls are treated as inlined
![Page 16: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/16.jpg)
Static code analysis: analysing AST
• Function calls are treated as inlined• Control flow is approximated
Loops are unrolled
![Page 17: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/17.jpg)
Static code analysis: analysing AST
• Function calls are treated as inlined• Control flow is approximated
– Loops are unrolled Branches are treated as parallel execution
![Page 18: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/18.jpg)
Static code analysis: analysing AST
• Function calls are treated as inlined• Control flow is approximated
– Loops are unrolled– Branches are treated as parallel execution
Non-scalar GridRPC call arguments are correlated, assinged ID
![Page 19: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/19.jpg)
Static code analysis: analysing AST
• Function calls are treated as inlined• Control flow is approximated
– Loops are unrolled– Branches are treated as parallel execution
• Non-scalar GridRPC call arguments are correlated, assinged ID
• Extracted information: Argument IDs => task dependency DAG
![Page 20: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/20.jpg)
Static code analysis: analysing AST
• Function calls are treated as inlined• Control flow is approximated
– Loops are unrolled– Branches are treated as parallel execution
• Non-scalar GridRPC call arguments are correlated, assinged ID
• Extracted information:– Argument IDs => task dependency DAG Task start and task wait events => order of task execution
![Page 21: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/21.jpg)
Static code analysis: further development
• Covering more cases– Better detection of run-time
parameters– Support for argstack and valist– Test case: HydroPad
![Page 22: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/22.jpg)
Static code analysis: further development
• Fault tolerance– Not restarting from scratch– Keeping log of GridRPC calls and task
dependencies– Restarting failed task and all task it
depends on– Reducing likelihood of data loss
![Page 23: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/23.jpg)
Conclusion Collective mapping Existing approches
Runtime discovery ADL
Static code analysis Further development
![Page 24: Using Static Code Analysis to Improve Performance of GridRPC Applications](https://reader035.fdocuments.in/reader035/viewer/2022062222/56816273550346895dd2e306/html5/thumbnails/24.jpg)
Questions?