9. A method for compiling a parallel program having variables in parallel regions divided by barriers, wherein the parallel program having a base language and a parallel programming language, the method comprising: automatically assigning scopes to variables, utilizing at least one processing unit, based on functions performed on the variables; automatically identifying a variable in a parallel region that has one or more functions performed on the variable in the parallel region, utilizing the at least one processing unit, such that the variable in the parallel region has not been automatically assigned a scope; automatically partitioning the parallel region into plural phases, utilizing the at least one processing unit, the variable in the parallel region associated with one or more of the phases; automatically performing a non-concurrency analysis on the variable in the parallel region, utilizing the at least one processing unit, to confirm the variable in the parallel region is free of data race, wherein performing the non-concurrency analysis further comprises: modeling a program control flow of the parallel program in a control flow graph having plural phases, wherein each phase having plural nodes; modeling a program hierarchical loop structure of a subroutine of the base language and a parallel programming language constructs in a region tree of the subroutine, utilizing the at least one processing unit, wherein the region tree comprises at least one construct edge defining a cycle between at least one end construct directive node and at least one begin construct directive node, wherein the at least one construct edge does not reflect control transfer of the subroutine; and automatically assigning a shared scope to the variable in the parallel region, utilizing the at least one processing unit, if the variable in the parallel region is free of data race.
10. The method of claim 9 further comprising: determining that the non-concurrency analysis fails to confirm that the variable is free of data race; and serializing the parallel region to assign a scope to the variable.