Abstract
OpenMP is a popular API for the development of parallel, shared memory programs and allows programmers to easily ready their programs to utilize modern multi-core processors. However, OpenMP-compliant programs do not guarantee that the OpenMP parallelization is functionally equivalent to a sequential execution of the program. Therefore, several approaches analyze OpenMP programs. While some approaches check functional equivalence, they are either general purpose approaches, which ignore the structure of the program and the design pattern applied for parallelization, or they focus on parallelized for-loops. In this paper, we propose a verification approach that aims at pipeline parallelism. To show functional equivalence, our approach mainly computes the dependencies that a sequential execution imposes on the pipeline stages and checks whether these dependencies are incorporated in the OpenMP parallelzation. We implemented our verification approach in a prototype tool and evaluated it on some examples. Our evaluation shows that our approach soundly detects incorrect pipeline implementations.
This work was funded by the Hessian LOEWE initiative within the Software-Factory 4.0 project.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In iteration i, the second task reads memory location b[i] after it is written by the first task. Similarly, the first task reads memory location a[i-1] in iteration i after the second task writes to it in iteration \(i-1\).
- 2.
Note that we currently do not support taskwait directives with depend clauses.
- 3.
In general, the constraints apply to sibling tasks only. Due to the construction of tasks in parallel pipeline implementations that we support, all tasks are siblings.
- 4.
The OpenMP standard also allows other variants of the depend clause but we stick to these because they are the main ones used when realizing the pipeline pattern. Ignoring other types is sound but can lead to false positives.
- 5.
Currently, we support for and while loops.
- 6.
Note that Algorithm 1 assumes, but does not check that the checked code segment follows the pipeline structure described in the previous section. Therefore, its result is only reliable for those segments.
- 7.
In contrast, leaving out some of those edges only makes our approach imprecise.
- 8.
Note that Fig. 2b does not contain dependencies between tasks T2 and T1 and tasks T2 and T3 because T3 and T1 are generated before T1.
- 9.
The same holds for pairs of tasks and statements.
- 10.
While one can reflect RAW and WAR dependencies with OpenMP depend clauses, a RAW depend specification can prevent a WAR dependency and vice versa.
- 11.
Although read-only variables are excluded, this is sufficient because Algorithm 4 only checks live and modified variables.
References
Abadi, M., Keidar-Barner, S., Pidan, D., Veksler, T.: Verifying parallel code after refactoring using equivalence checking. Int. J. Parallel Program. 47(1), 59–73 (2018). https://doi.org/10.1007/s10766-017-0548-4
Atzeni, S., et al.: ARCHER: effectively spotting data races in large OpenMP applications. In: Proceedings IPDPS, pp. 53–62. IEEE (2016). https://doi.org/10.1109/IPDPS.2016.68
Basupalli, V., et al.: ompVerify: polyhedral analysis for the OpenMP programmer. In: Proceedings IWOMP, pp. 37–53. LNCS 6665, Springer (2011). https://doi.org/10.1007/978-3-642-21487-5_4
Bora, U., Das, S., Kukreja, P., Joshi, S., Upadrasta, R., Rajopadhye, S.: LLOV: a fast static data-race checker for openMP programs. TACO 17(4) (2020). https://doi.org/10.1145/3418597
Goncalves, R., Amaris, M., Okada, T.K., Bruel, P., Goldman, A.: OpenMP is not as easy as it appears. In: Proceedings HICSS, pp. 5742–5751. IEEE (2016). https://doi.org/10.1109/HICSS.2016.710
Jakobs, M.: PatEC: pattern-based equivalence checking. In: Laarman, A., Sokolova, A. (eds.) SPIN 2021, LNCS, vol. 12864, pp. 120–139 (2021). https://doi.org/10.1007/978-3-030-84629-9_7
Jakobs, M.C.: PEQcheck: localized and context-aware checking of functional equivalence. In: Proceedings FormaliSE, pp. 130–140. IEEE (2021), https://doi.org/10.1109/FormaliSE52586.2021.00019
Leviathan, R., Pnueli, A.: Validating software pipelining optimizations. In: Proceedings CASES, pp. 280–287. ACM (2002). https://doi.org/10.1145/581630.581676
Li, J., Hei, D., Yan, L.: Correctness analysis based on testing and checking for OpenMP Programs. In: Proceedings ChinaGrid, pp. 210–215. IEEE (2009). https://doi.org/10.1109/ChinaGrid.2009.12
Li, Z., Atre, R., Huda, Z.U., Jannesari, A., Wolf, F.: Unveiling parallelization opportunities in sequential programs. J. Syst. Softw. 282–295 (2016). https://doi.org/10.1016/j.jss.2016.03.045
Liao, C., Lin, P.H., Asplund, J., Schordan, M., Karlin, I.: DataRaceBench: a benchmark suite for systematic evaluation of data race detection tools. Proc. SC. ACM (2017). https://doi.org/10.1145/3126908.3126958
Liao, C., Quinlan, D.J., Willcock, J., Panas, T.: Extending automatic parallelization to optimize high-level abstractions for multicore. In: Proceedings IWOMP, pp. 28–41. LNCS 5568, Springer (2009). https://doi.org/10.1007/978-3-642-02303-3_3
Lin, Y.: Static Nonconcurrency analysis of OpenMP programs. In: Proceedings IWOMP, pp. 36–50. LNCS 4315, Springer (2005). https://doi.org/10.1007/978-3-540-68555-5_4
Ma, H., Diersen, S., Wang, L., Liao, C., Quinlan, D., Yang, Z.: Symbolic analysis of concurrency errors in OpenMP programs. In: Proceedings ICPP. pp. 510–516. IEEE (2013). https://doi.org/10.1109/ICPP.2013.63
Mattson, T.G., Sanders, B.A., Massingill, B.L.: Patterns for parallel programming. Addison-Wesley Professional (2013)
McCool, M., Reinders, J., Robison, A.: Structured Parallel Programming: Patterns for Efficient Computation. Morgan Kaufmann Publishers Inc., Burlington (2012)
OpenMP: OpenMP application programming interface (version 5.1). Technical report OpenMP Architecture Review Board (2020). https://www.openmp.org/specifications/
Quinlan, D., Liao, C.: The ROSE source-to-source compiler infrastructure. In: Cetus users and compiler infrastructure workshop, in conjunction with PACT, vol. 2011, p. 1. Citeseer (2011)
Royuela, S., Ferrer, R., Caballero, D., Martorell, X.: Compiler analysis for OpenMP tasks correctness. In: Proceedings CF, pp. 11–19. ACM (2015). https://doi.org/10.1145/2742854.2742882
Saillard, E., Carribault, P., Barthou, D.: Static Validation of barriers and worksharing constructs in openmp applications. In: Proceedings IWOMP, pp. 73–86. LNCS 8766, Springer (2014). https://doi.org/10.1007/978-3-319-11454-5_6
Salamanca, J., Mattos, L., Araujo, G.: Loop-carried dependence verification in OpenMP. In: Proceedin IWOMP, pp. 87–102. LNCS 8766, Springer (2014). https://doi.org/10.1007/978-3-319-11454-5_7
Siegel, S.F., et al.: CIVL: the concurrency intermediate verification language. In: Proceedings SC, pp. 61:1–61:12. ACM (2015). https://doi.org/10.1145/2807591.2807635
Swain, B., Li, Y., Liu, P., Laguna, I., Georgakoudis, G., Huang, J.: OMPRacer: a scalable and precise static race detector for OpenMP programs. In: Proceedings SC. IEEE (2020). https://doi.org/10.1109/SC41405.2020.00058
Tristan, J., Leroy, X.: A simple, verified validator for software pipelining. In: Proceedings POPL, pp. 83–92. ACM (2010). https://doi.org/10.1145/1706299.1706311
Virouleau, P., Brunet, P., Broquedis, F., Furmento, N., Thibault, S., Aumage, O., Gautier, T.: Evaluation of OpenMP dependent tasks with the KASTORS benchmark suite. In: Proceedings IWOMP, pp. 16–29. LNCS 8766, Springer (2014). https://doi.org/10.1007/978-3-319-11454-5_2
Ye, F., Schordan, M., Liao, C., Lin, P., Karlin, I., Sarkar, V.: Using polyhedral analysis to verify openmp applications are data race free. In: Proceedings CORRECTNESS@SC, pp. 42–50. IEEE (2018). https://doi.org/10.1109/Correctness.2018.00010
Yu, F., Yang, S., Wang, F., Chen, G., Chan, C.: Symbolic consistency checking of openmp parallel programs. In: Proceedings LCTES, pp. 139–148. ACM (2012). https://doi.org/10.1145/2248418.2248438
Zhang, Y., Duesterwald, E., Gao, G.R.: Concurrency analysis for shared memory programs with textually unaligned barriers. In: Proceedings LCPC, pp. 95–109. LNCS 5234, Springer (2007). https://doi.org/10.1007/978-3-540-85261-2_7
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Wiesner, M., Jakobs, MC. (2021). Verifying Pipeline Implementations in OpenMP. In: Laarman, A., Sokolova, A. (eds) Model Checking Software. SPIN 2021. Lecture Notes in Computer Science(), vol 12864. Springer, Cham. https://doi.org/10.1007/978-3-030-84629-9_5
Download citation
DOI: https://doi.org/10.1007/978-3-030-84629-9_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-84628-2
Online ISBN: 978-3-030-84629-9
eBook Packages: Computer ScienceComputer Science (R0)