home *** CD-ROM | disk | FTP | other *** search
- PROGRAM PROB02
- C
- C PROBLEM 2
- C
- C REFERENCE: PROBLEMS TO TEST PARALLEL AND VECTOR LANGUAGES
- C CSD-TR 516, COMPUTER SCIENCE, PURDUE UNIVERSITY
- C JOHN R. RICE, MAY 1, 1985
- C
- C REVISED BY JOHN R. RICE AND J. JING, OCT. 1, 1990
- C
- C
- C *************************************************
- C * Adapted for FORTRAN D benchmarking *
- C * by T. HAUPT (haupt@sccs.npac.syr.edu) *
- C * *
- C * Northeast Parallel Architectures Center *
- C * at Syracuse University, Syracuse, NY, USA *
- C *************************************************
- C
- C
- C VERSION SIMD/CM2-1.00
- C ==================================================
- C
- INCLUDE '/usr/include/cm/paris-configuration-fort.h'
- INTEGER KASES,NK,MK
- PARAMETER (KASES=4)
- INTEGER N(KASES),M(KASES)
- cmf$ layout m (:serial)
- cmf$ layout n (:serial)
- DATA N / 128,1024,1024,1024 /
- DATA M / 128,64,512,1024 /
-
- DO 50 K = 1, KASES
-
- CALL CM_TIMER_CLEAR(0)
- CALL CM_TIMER_START(0)
-
- DO MANY=1,25
-
- NK=N(K)
- MK=M(K)
- CALL DOIT(NK,MK,ESTAR)
-
-
- ENDDO
-
- CALL CM_TIMER_STOP(0)
-
- PRINT 60, N(K),M(K)
- 60 FORMAT ('PROBLEM 2 WITH N,M =',I6,2X,I6)
- PRINT *,'GIVES ESTAR =',ESTAR
-
- CALL CM_TIMER_PRINT(0)
-
- 50 CONTINUE
- END
-
-
- SUBROUTINE DOIT(NK,MK,ESTAR)
- INTEGER NK,MK
- REAL ESTAR
- c REAL, ARRAY(NK,MK) :: TEMP
- REAL, ARRAY(MK,NK) :: TEMP
- REAL, ARRAY(NK) :: H
-
- TEMP=1.+0.5/(REAL(-IABS(SPREAD([1:MK],2,NK)
- * -SPREAD([1:NK],1,MK)))+0.001)
- !HPF$ independent, local_access
- do i = 1, nk
- h(i) = 1.0
- do j = 1, mk
- h(i) = h(i) * temp(j,i)
- end do
- end do
- ESTAR=SUM(h)
-
- END
-
-
-
-