Jim Cownie | 18d8473 | 2014-05-10 17:02:09 +0000 | [diff] [blame] | 1 | <ompts:test> |
| 2 | <ompts:testdescription></ompts:testdescription> |
| 3 | <ompts:ompversion>2.0</ompts:ompversion> |
| 4 | <ompts:directive>omp single nowait</ompts:directive> |
| 5 | <ompts:dependences>omp critical,omp atomic</ompts:dependences> |
| 6 | <ompts:testcode> |
| 7 | INTEGER FUNCTION <ompts:testcode:functionname>single_nowait</ompts:testcode:functionname>() |
| 8 | IMPLICIT NONE |
| 9 | INTEGER result, total_iterations, my_iterations,i |
| 10 | INCLUDE "omp_testsuite.f" |
| 11 | <ompts:orphan:vars> |
| 12 | INTEGER nr_iterations |
| 13 | COMMON /orphvars/ nr_iterations |
| 14 | </ompts:orphan:vars> |
| 15 | |
| 16 | result=0 |
| 17 | nr_iterations=0 |
| 18 | total_iterations=0 |
| 19 | my_iterations=0 |
| 20 | |
| 21 | !$omp parallel private(i) |
| 22 | DO i=0, LOOPCOUNT -1 |
| 23 | <ompts:orphan> |
| 24 | <ompts:check>!$omp single</ompts:check> |
| 25 | !$omp atomic |
| 26 | nr_iterations = nr_iterations + 1 |
| 27 | <ompts:check>!$omp end single nowait</ompts:check> |
| 28 | </ompts:orphan> |
| 29 | END DO |
| 30 | !$omp end parallel |
| 31 | !$omp parallel private(i,my_iterations) |
| 32 | my_iterations = 0 |
| 33 | DO i=0, LOOPCOUNT -1 |
| 34 | <ompts:check>!$omp single</ompts:check> |
| 35 | my_iterations = my_iterations + 1 |
| 36 | <ompts:check>!$omp end single nowait</ompts:check> |
| 37 | END DO |
| 38 | !$omp critical |
| 39 | total_iterations = total_iterations + my_iterations |
| 40 | !$omp end critical |
| 41 | !$omp end parallel |
| 42 | IF ( nr_iterations .EQ. LOOPCOUNT .AND. |
| 43 | & total_iterations .EQ. LOOPCOUNT ) THEN |
| 44 | <testfunctionname></testfunctionname> = 1 |
| 45 | ELSE |
| 46 | <testfunctionname></testfunctionname> = 0 |
| 47 | END IF |
| 48 | END FUNCTION |
| 49 | </ompts:testcode> |
| 50 | </ompts:test> |