CCA/EBT: Code Comprehension Assistance Tool
for Evidence-Based Performance Tuning†**†*
M. Hashimoto , M. Terai , T. Maeda , and K. Minami†Sokware Technology and AI Research Lab, Chiba Insltute of Technology*RIKEN Advanced Insltute for Computalonal Science

INTRODUCTIONSCREENSHOTS

Application performance tuning is still quite an art, despite advances in auto-tuning systems[1][9].
EBT (evidence-based performance tuning) [5] aims at helping performance engineers gain andshare evidence of performance improvements to make better decisions.
Long-term goal is to construct a database of facts, or factbase, extracted from performancetuning histories of computational kernels such that we can search the database for promising
optimization patterns that fit a given computational kernel.

OBJECTIVES• Localng computalonal kernels
Prediclng localon of computalonal kernels
Assislng in the manual inspeclon of source code
• Idenlfying oplmizalon paHerns applied to computalonal kernels• Construclng database of posilve/negalve examples of oplmizalon paHerns

Fig. 2: Project view
A project summary view provides the following:• Automalcally generated links to the documents whose names contain “README”,• The result of topic analysis as a ranking of candidate applicalons (qcd, alps, ...),• A link to the tree view, and• Progress of a user’s loop classiﬁcalon performed in the tree view.

TECHNICAL HIGHLIGHTS

Fig. 1: Overview of CCA/EBTLoop Kernel Prediction based on Machine Learning1) Features were extracted from 175,963 loops from 1000 Tab. 1: SyntacYc features of a loop
computation-intensive applications hosted on GitHub [6]. Abbrv.
Feature2) 100 were randomly sampled and then manually
FOp # floating-point operationsclassified by experienced performance engineers.
St # statements
3) By using the classification results as training data andBr # branches
C-SVC in LIB-SVM [3] from scikit-learn, we constructed a
predictive model.
AR # array references
4) The model achieved 20-fold cross-validated
DAR # direct array referencesclassification accuracy of 81% [6].
IAR # indirect array references
B/F Bytes per flop
MLL Maximum loop nest level
Dedicated Fortran Parser
The parser understands the following.
Specifications: FORTRAN77, Fortran90, Fortran95, Fortran2003, Fortran2008
Dialects: IBM, PGI, Intel
Directives: CPP, OpenMP, OpenACC, OCL(Fujitsu), XLF(IBM), DIR/DEC(Intel)

Fig. 3: Tree view
A tree view shows the following:• Outline of the AST and the call tree of an enlre applicalon,• Predicted loop kernels decorated with extracted stalc features (eslmated B/F, ...), and• Eslmalon scheme selector for features AR, DAR, IAR, and B/F(suﬃxes 0, 1, and 2 of them indicate the eslmalon schemes ES0, ES1, and ES2, respeclvely).
⚠ The size of a call tree can be inﬁnite when it contains recursive calls.
A procedure or a funclon appear only at the deepest level of non-recursive calls.
A source code view (appears by doubleclicking a tree node) has the following:• Highlighted array references,• Quick look of the definitions(appear on mouse-over),• The definition of an array reference(by double-clicking).

Schemes for Statically Estimating Volume of Memory Traffic
ES0 Data is shared in cache only among syntactically identical array references.
ES1 The data referenced by the array references that differ only by the first dimension arelocated in the same cache block. (ex. a(i,n) and a(j,n))
ES2 The data referenced by the array references that differ only by the first dimension and byadditions/subtractions of constants at the second dimension are located in the same cache block.
(ex. a(i,n) and a(j,n+1))
The tool is available at
hHps://github.com/ebt-hpc/cca

Topic Analysis for Source Code• Helping performance engineers understand an application
Analyzing comments and variable names occurring in the source code
- Examining the topic or research field of the application.
• Constructing a topic model with latent semantic indexing (LSI) [4]Based on 168 papers of scientific applications from several research fields- Quantum chemistry, astrophysics, climate science, ...

RELATED WORK
Commercial and open-source Fortran analysis tools include the following:• FORCHECK [2] --- A Fortran source code analyzer and programming aid,
• Photran [7] --- An IDE and refactoring tool for Fortran, and• CamFort [8] --- Light-weight veriﬁcalon and transformalon tools for Fortran.
CCA/EBT is capable of prediclng loop kernels and of parsing 1000 applicalons in a fully
automated way.

Fig. 4: Source code view

REFERENCES
1. Basu et al. Intl. Journal of High Performance Compu7ng Applica7ons 2013, 27, 4.
2. Forcheck b.v. hHp://www.forcheck.nl/.
3. Chang & Lin. ACM Transac7ons on Intelligent Systems Technology 2011, 2, 3.
4. Deerwester et al. Journal of the American Society for Informa7on Science 1990, 41, 6.
5. Hashimoto et al. Proc. Intl. Conference on Mining So>ware Repositories. 2015.
6. Hashimoto et al. Proc. Intl. Conference on Performance Engineering. 2017.
7. Johnson et al. hHp://www.eclipse.org/photran/.
8. Orchard & Rice. Proc. Workshop on Refactoring Tools. 2013.
9. Tiwari et al. Intl. Journal of High Perform. Compu7ng Applica7ons 2011, 25, 3.
10. Williams et al. Communica7ons of the ACM, 2009, 52, 4.

ACKNOWLEDGMENTS
This work was supported in part by JSPS KAKENHI Grant Number JP26540031.