# An Architecture for a Tri-Programming Model-Based Parallel Hybrid Testing Tool
## 4 Architecture of the Proposed Tri-Level Programming Model  
Figures 1 and 2 illustrate the construction of a hybrid testing tool for MPI + OpenMP + CUDA and C++. The design comprises two parts. The first part identifies any run-time issues and notifies the developer during the static phase, while the second part uses \begin{table}
\begin{tabular}{c c c c c} \hline
**References** & **Technique** & **Error(s) Detected** & **Programme Model** & **Limitation(s)** \\ \hline
[34] & Static & Mismatches & MPI & Works with single-level programming models. \\  & & & Only identifies mismatches in MPI. \\ \hline
[45] & Static & Data Races & CUDA, and OpenCLTM & Works with single-level programming models. \\ \hline
[59] & Static & Data Races & OpenMP & Works with single-level programming models. \\ \hline
[36] & Dynamic &
\begin{tabular}{c} Deadlocks \\ Mismatched Collective \\ Operations \\ Resource Exhaustion \\ \end{tabular} & MPI & Works with single-level programming models. \\ \hline
[37; 38; 39] & Dynamic &
\begin{tabular}{c} Deadlocks \\ Data Races \\ Mismatches \\ Data Races/Race \\ Conditions \\ \end{tabular} & MPI & Works with single-level programming models. \\ \hline
[43] & Hybrid & Deadlocks & MPI & Works with single-level programming models. \\ \hline
[44] & Hybrid &
\begin{tabular}{c} Deadlocks \\ Mismatches \\ Livedocks \\ Data Races/Race \\ Conditions \\ \end{tabular} & MPI & Work with single-level programming models. \\ \hline
[57] & Hybrid & Data Races & OpenMP & Work with single-level programming models. \\ \hline \end{tabular}
\end{table} 
Table 1: A list of comparable extant studies. \begin{table}
\begin{tabular}{c c c c} \hline
**Programming Model** & **Tool Name** & **Run-Time Errors** & **Error Type** \\ \hline CUDA only & \multicolumn{2}{c}{GPUVerify [45]} & Data Races & Real \\ \hline MPI only & \multicolumn{2}{c}{MPI-Checker [34]} & Mismatches & Potential \\ \hline MPI only & \multicolumn{2}{c}{MUST [37; 38; 39]} & Deadlocks, Data Races, & \multirow{2}{*}{Real} \\  & & & and Mismatches & \\ \hline \multirow{2}{*}{OpenMP only} & \(\bullet\) &
\begin{tabular}{c} Intel® Thread Checker [51; 52] \\ Sun Studio® Thread Analyzer [51; 53] \\ \end{tabular} & Deadlocks and Data Races & Real \\ \hline CUDA only & \multicolumn{2}{c}{GUARD [60]} & Data Races & Real \\ \hline Dual: MPI + OpenMP & \multicolumn{2}{c}{Marmot [57; 58]} & Deadlocks, Race Conditions, & \multirow{2}{*}{Real} \\  & & & and Mismatches & \\ \hline Tri: MPI + OpenMP + CUDA & \multicolumn{2}{c}{Proposed Tool} & Deadlocks, Race Conditions, & \multirow{2}{*}{Both} \\  & & & Data Races, Mismatches, & \\ \end{tabular}
\end{table} 
Table 2: A comparison of the proposed tool and extant tools. After the first static testing phase, the developer is provided a list of actual and potential run-time errors (Figure 1), which can then be input into an assertion process to automatically detect and avoid these potential errors during the second dynamic testing phase. Furthermore, if any errors occur while the programme is operating, the developers are sent an immediate notification to efficiently resolve the issues. Apart from this, identifying these run-time errors and fixing them prior to the second dynamic testing phase decreases the testing time and improves performance. The first static testing phase of the proposed architecture includes the following. * A lexical analyser that reads the source code, which includes C++, MPI, OpenMP, and CUDA, line by line and then understands the source code before generating a token table containing at least two columns: the token name and token type. * A parser or syntax analyser that checks the syntax of each statement and detects syntax errors. More specifically, it analyses the syntactical structure of the inputs and determines whether they are in the correct syntax for the programming language used. * A generator that produces a dependable state transit graph for a code that comprises MPI, C++, OpenMP, and CUDA. An appropriate data structure is employed to build a suitable state graph.