This paper presents a technique for detecting control flow errors in parallel programs at compile time by applying a system of linear equations derived from a flow matrix. Unlike previous methods, this technique is efficient for large programs and can handle a wide range of language features without requiring modifications to the program source code. A prototype compiler was developed to implement this approach for a well-known parallel programming language, demonstrating its potential utility in automated error detection.