Predictive Modeling for Thread Optimization in OpenMP-Based Parallelization Using Machine Learning

Akash Yadav, Mushtaq Ahmed · 2024

High-performance applications frequently utilize parallelization tools to achieve faster execution times. OpenMP is a prominent library that facilitates the parallelization of sequentially written C code through directive-based parallelization. These directives employ various parameters to parallelize the code efficiently. Performance tuning of these parameters is typically performed manually, a method that is both time-consuming and suboptimal. Although several research efforts have sought to automate this tuning process, their effectiveness has been limited. Out of various parameters, deciding the number of threads to be executed in parallel is a crucial part. In this study, we first created a comprehensive dataset by executing loops containing different types of statements within their bodies. This dataset includes various parameters such as the number of threads, type of operations, loop trip count, and other relevant features. Then, we applied a Random Forest Regression-based machine learning technique to predict the optimal number of threads, i.e., indicates the ideal number of threads that maximizes performance, for parallelizing loops using OpenMP directives. The results indicate that our proposed approach significantly outperforms other regression-based methods, providing more accurate and efficient predictions for thread optimization.

Read the paper · More papers on PaperTik