blob: fd0ac0e930c11a96d2b5d221417640719d4df53c [file] [log] [blame]
 Test which checks the parallel section private clause. 2.0 omp parallel section private omp critical INTEGER FUNCTION par_section_private() IMPLICIT NONE INTEGER sum, sum0, known_sum, i sum = 7 sum0 = 0 !\$omp parallel sectionsprivate(sum0,i)private(i) !\$omp section sum0 = 0 DO i=1, 399 sum0 = sum0 + i END DO !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp section sum0 = 0 DO i=400, 699 sum0 = sum0 + i END DO !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp section sum0 = 0 DO i=700, 999 sum0 = sum0 + i END DO !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp end parallel sections known_sum = (999*1000)/2+7 IF ( known_sum .eq. sum ) then = 1 ELSE = 0 END IF END integer function crschk_par_section_private() implicit none integer sum, sum0, known_sum, i sum = 7 sum0 = 0 !\$omp parallel sections private(i) !\$omp section sum0 = 0 do i=1, 399 sum0 = sum0 + i end do !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp section sum0 = 0 do i=400, 699 sum0 = sum0 + i end do !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp section sum0 = 0 do i=700, 999 sum0 = sum0 + i end do !\$omp critical sum = sum + sum0 !\$omp end critical !\$omp end parallel sections known_sum = (999*1000)/2+7 if ( known_sum .eq. sum ) then crschk_par_section_private = 1 else crschk_par_section_private = 0 end if end