Return
Defect Detection and Correction in OpenMP: A Static Analysis and Machine Learning-Based Solution
DOI:10.1109/ACCESS.2025.3589175.png)
Abstract
En 中文
Concurrency defects such as race conditions, deadlocks, and improper synchronization remain a critical challenge in developing reliable OpenMP-based parallel applications. Traditional static analysis tools often focus only on defect detection, offering limited or no automated correction capabilities. This paper presents a novel static analysis tool designed to detect and automatically correct concurrency-related defects in OpenMP programs. The tool performs lexical and syntactic analysis to extract OpenMP constructs, verify directive usage, and identify incorrect synchronization patterns. A rule-based correction engine is employed to repair detected defects through minimally invasive code transformations, such as inserting critical sections, correcting directive placement, and adjusting data-sharing clauses. To enhance predictive accuracy, the tool incorporates machine learning classifiers—Naive Bayes (NB), Decision Tree (DT), Random Forest (RF), and Linear Support Vector Machine (LSVM)—trained on various feature combinations, including Abstract Features (AF), Halstead Features (HF), and Semantic Features (SF). Evaluation results show that NB and LSVM achieved up to 99% accuracy with simple feature sets, while DT and RF exhibited lower performance across all combinations. The tool was validated on a curated dataset of annotated OpenMP programs, achieving a 99.15% correction rate with minimal execution overhead. These results confirm the effectiveness and practicality of the proposed solution in improving the correctness and maintainability of OpenMP applications. This work bridges the gap between static defect detection and automated correction, contributing a scalable and intelligent approach to reliable parallel software development.
Keywords:
Static analysis
OpenMP
parallel programming
data races
deadlocks
software defect detection

