SQRT instruction hangs freeAXP
- Bruce Claremont
- Topic Author
- Visitor
-
4 years 4 months ago #5733
by Bruce Claremont
Replied by Bruce Claremont on topic RE: SQRT instruction hangs freeAXP
A simple test run on a genuine AlphaServer 400 under OpenVMS 7.3-2. FreeAXP emulates an AlphaServer 400. The test demonstrated things are working properly on the real hardware.
Using Digital Fortran 77 V7.1-107-3313
$ ty sqrt.for
WRITE (6,*) 'Enter X:'
READ (5,*) X
1 WRITE (6,*) X,'->',SQRT(X)
C GOTO 1
END
$
$ for sqrt
$ link sqrt
$ r sqrt
Enter X:
2.0
2.000000 -> 1.414214
$
$ for/arch=host sqrt
$ link sqrt
$ r sqrt
Enter X:
2.0
2.000000 -> 1.414214
$<hr>
Using Digital Fortran 77 V7.1-107-3313
$ ty sqrt.for
WRITE (6,*) 'Enter X:'
READ (5,*) X
1 WRITE (6,*) X,'->',SQRT(X)
C GOTO 1
END
$
$ for sqrt
$ link sqrt
$ r sqrt
Enter X:
2.0
2.000000 -> 1.414214
$
$ for/arch=host sqrt
$ link sqrt
$ r sqrt
Enter X:
2.0
2.000000 -> 1.414214
$<hr>
Please Log in or Create an account to join the conversation.
- Bruce Claremont
- Topic Author
- Visitor
-
4 years 4 months ago #5734
by Bruce Claremont
Replied by Bruce Claremont on topic RE: SQRT instruction hangs freeAXP
Prime program tested on genuine AlphaServer 400. Everything works as expected.
Using Digital Fortran 77 V7.1-107-3313.
$ ty prime.for
INTEGER PRIME
READ (5,*) N
C3 FORMAT (I10)
PRIME=1
DO 1 I=1, N
7 IF (PRIME .GE. 2 147 483 647) GO TO 999
PRIME= PRIME+ 1
J = IFIX( SQRT( FLOAT (PRIME))+ 0.999 )
J = MIN( J, PRIME-1)
IF (J .LT. 2) GOTO 7
DO 6 K= 2, J
IF ((PRIME - (( PRIME/ K )* K)) .EQ. 0) GO TO 7
6 CONTINUE
WRITE (6, *) PRIME
1 CONTINUE
C14 FORMAT (1X, I10)
999 STOP
END
$
$ for prime
$ link prime
$ r prime
10
3
5
7
11
13
17
19
23
29
31
$
$ for/arch=host prime
$ link prime
$ r prime
10
3
5
7
11
13
17
19
23
29
31
$<hr>
Using Digital Fortran 77 V7.1-107-3313.
$ ty prime.for
INTEGER PRIME
READ (5,*) N
C3 FORMAT (I10)
PRIME=1
DO 1 I=1, N
7 IF (PRIME .GE. 2 147 483 647) GO TO 999
PRIME= PRIME+ 1
J = IFIX( SQRT( FLOAT (PRIME))+ 0.999 )
J = MIN( J, PRIME-1)
IF (J .LT. 2) GOTO 7
DO 6 K= 2, J
IF ((PRIME - (( PRIME/ K )* K)) .EQ. 0) GO TO 7
6 CONTINUE
WRITE (6, *) PRIME
1 CONTINUE
C14 FORMAT (1X, I10)
999 STOP
END
$
$ for prime
$ link prime
$ r prime
10
3
5
7
11
13
17
19
23
29
31
$
$ for/arch=host prime
$ link prime
$ r prime
10
3
5
7
11
13
17
19
23
29
31
$<hr>
Please Log in or Create an account to join the conversation.
- Bruce Claremont
- Topic Author
- Visitor
-
4 years 4 months ago #5735
by Bruce Claremont
Replied by Bruce Claremont on topic RE: SQRT instruction hangs freeAXP
Which FORTRAN compiler are you using? Under Digital Fortran 77 V7.1-107-3313, everything works as it should under FreeAXP. Under HP Fortran V8.0-104655-48F7C and HP Fortran V8.0-1-104669, we reproduce the reported problems.<hr>
Please Log in or Create an account to join the conversation.
- Bruce Claremont
- Topic Author
- Visitor
-
4 years 4 months ago #5736
by Bruce Claremont
Replied by Bruce Claremont on topic RE: SQRT instruction hangs freeAXP
The problem occurs when EV6 elements are included in the /ARCH compiler qualifier. I'm guessing the inclusion of EV5 and EV6 instructions in Avanti are leading /ARCH=HOST to default to EV67. This is causing a problem when using the HP V8.n compilers.
The work-around is to avoid using /ARCH=HOST, EV6, or EV67 with the HP V8.n compilers. The compile and run samples below demonstrate the issue. All compiles were run under VMS 7.3-2 and HP Fortran V8.2-104679.
BURN34> for sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=host sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=ev4 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev5 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev56 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev6 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=ev67 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=pca56 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
The work-around is to avoid using /ARCH=HOST, EV6, or EV67 with the HP V8.n compilers. The compile and run samples below demonstrate the issue. All compiles were run under VMS 7.3-2 and HP Fortran V8.2-104679.
BURN34> for sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=host sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=ev4 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev5 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev56 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
BURN34> for/arch=ev6 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=ev67 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 2.750000
BURN34>
BURN34> for/arch=pca56 sqrt
BURN34> link sqrt
BURN34> r sqrt
Enter X:
2.0
2.000000 -> 1.414214
BURN34>
Please Log in or Create an account to join the conversation.
Moderators: iamcamiel
Time to create page: 0.191 seconds