-
Notifications
You must be signed in to change notification settings - Fork 7
/
ompts_standaloneProc.f
68 lines (57 loc) · 2.14 KB
/
ompts_standaloneProc.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
!This is the main driver to invoke different test functions
PROGRAM <testfunctionname></testfunctionname>_main
IMPLICIT NONE
INTEGER failed, success !Number of failed/succeeded tests
INTEGER num_tests,crosschecked, crossfailed, j
INTEGER temp,temp1
INCLUDE "omp_testsuite.f"
INTEGER <testfunctionname></testfunctionname>
CHARACTER*50 logfilename !Pointer to logfile
INTEGER result
num_tests = 0
crosschecked = 0
crossfailed = 0
result = 1
failed = 0
!Open a new logfile or overwrite the existing one.
logfilename = "bin/fortran/<testfunctionname></testfunctionname>.log"
! WRITE (*,*) "Enter logFilename:"
! READ (*,*) logfilename
OPEN (1, FILE = logfilename)
WRITE (*,*) "######## OpenMP Validation Suite V 3.0a ######"
WRITE (*,*) "## Repetitions:", N
WRITE (*,*) "## Loop Count :", LOOPCOUNT
WRITE (*,*) "##############################################"
WRITE (*,*)
crossfailed=0
result=1
WRITE (1,*) "--------------------------------------------------"
WRITE (1,*) "Testing <directive></directive>"
WRITE (1,*) "--------------------------------------------------"
WRITE (1,*)
WRITE (1,*) "testname: <testfunctionname></testfunctionname>"
WRITE (1,*) "(Crosstests should fail)"
WRITE (1,*)
DO j = 1, N
temp = <testfunctionname></testfunctionname>()
IF (temp .EQ. 1) THEN
WRITE (1,*) j, ". test successfull."
success = success + 1
ELSE
WRITE (1,*) "Error: ",j, ". test failed."
failed = failed + 1
ENDIF
END DO
IF (failed .EQ. 0) THEN
WRITE (1,*) "Directive worked without errors."
WRITE (*,*) "Directive worked without errors."
result = 0
WRITE (*,*) "Result:",result
ELSE
WRITE (1,*) "Directive failed the test ", failed, " times."
WRITE (*,*) "Directive failed the test ", failed, " times."
result = failed * 100 / N
WRITE (*,*) "Result:",result
ENDIF
CALL EXIT (result)
END PROGRAM