SUBROUTINE R8D(N,K,T,ITER,MYPE,NUMPES,B,Z,ZZ,ALLTIMES,IER) c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c CVS Info c $Date: 2005/01/10 21:55:52 $ c $Revision: 1.2 $ c $RCSfile: r8dp.f,v $ c $Name: rel_5 $ c c This is the output routine for the large sparse matrix version c of Benchmark 8. c c This will need to be modified to contain the particular c configuration information requested. c c Parameters: c c Provided by calling routine: c N = Size of the A matrices c K = Number of A matrices c T = Length of B array - 1 for last iteration c ITER = The number of iterations of this benchmark c B = Sequences of steps on a maximal path c Z = Probability of this best path c ZZ = Expected probability of the best path c CSET = Total setup time for all iterations (CPU) c WSET = Total setup time for all iterations (Wall Clock) c CRUN = Total run time for all iterations (CPU) c WRUN = Total run time for all iterations (Wall Clock) c IER = Error flag array c IER(1) = Iteration on which error occurred c IER(2) = Flag indicating type of error c IER(3) = Step on which error type 2 occurred c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc IMPLICIT INTEGER (A-Z) include 'mpif.h' C--CVS variable declaration TYPE CVS sequence character( 160 ) string integer stringend END TYPE CVS C--CVS initilaize variables TYPE( CVS ),save :: CVS_INFO = $ CVS("BMARKGRP $Date: 2005/01/10 21:55:52 $ $Revision: 1.2 $" // $ "$RCSfile: r8dp.f,v $ $Name: rel_5 $", 0) INTEGER B(0:T) INTEGER IER(3) INTEGER IERR INTEGER N,K,T,ITER INTEGER MYPE,NUMPES REAL Z,ZZ REAL ALLTIMES(14) REAL AVETIMES(14),MAXTIMES(14),MINTIMES(14) INTEGER dat(8) CHARACTER(LEN=10) dtime(3) CALL MPI_REDUCE(ALLTIMES,MAXTIMES,14,MPI_REAL8, $ MPI_MAX,0,MPI_COMM_WORLD,IERR); CALL MPI_REDUCE(ALLTIMES,MINTIMES,14,MPI_REAL8, $ MPI_MIN,0,MPI_COMM_WORLD,IERR); CALL MPI_REDUCE(ALLTIMES,AVETIMES,14,MPI_REAL8, $ MPI_SUM,0,MPI_COMM_WORLD,IERR); IF (MYPE .EQ. 0) THEN PRINT 5 5 FORMAT(///,'Benchmark #8 -- Dynamic Program ',/, $ 'Small Dense Matrices',/) CALL DATE_AND_TIME(dtime(1),dtime(2),dtime(3),dat) PRINT 10,dat(2),dat(3),dat(1) 10 FORMAT('Date: ',I4,I3,',',I5) PRINT 12,dat(5),dat(6),dat(7) 12 FORMAT('Time: ',I4,':',I2,':',I2/) PRINT 15,N,K,ITER 15 FORMAT('Matrix size = ',I15,/, $ 'Number of matrices = ',I5,/, $ 'Number of iterations = ',I5,/) PRINT *,'******TOTAL TIMES FOR SET UP AND RUN******' PRINT 20, MINTIMES(1),MAXTIMES(1),AVETIMES(1)/NUMPES, $ MINTIMES(2),MAXTIMES(2),AVETIMES(2)/NUMPES 20 FORMAT(/,'Total time for set up: ',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT 25, MINTIMES(3),MAXTIMES(3),AVETIMES(3)/NUMPES, $ MINTIMES(4),MAXTIMES(4),AVETIMES(4)/NUMPES 25 FORMAT(/,'Total time to run: ',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT *,'******DETAILED TIMES FROM RUN******' PRINT 30, MINTIMES(5),MAXTIMES(5),AVETIMES(5)/NUMPES, $ MINTIMES(6),MAXTIMES(6),AVETIMES(6)/NUMPES 30 FORMAT(/,'Time to set up three-stepping tables',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT 35, MINTIMES(7),MAXTIMES(7),AVETIMES(7)/NUMPES, $ MINTIMES(8),MAXTIMES(8),AVETIMES(8)/NUMPES 35 FORMAT(/,'Time to do three-stepping operations',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT 40, MINTIMES(9),MAXTIMES(9),AVETIMES(9)/NUMPES, $ MINTIMES(10),MAXTIMES(10),AVETIMES(10)/NUMPES 40 FORMAT(/,'Time to gather three-stepping results',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT 45, MINTIMES(11),MAXTIMES(11),AVETIMES(11)/NUMPES, $ MINTIMES(12),MAXTIMES(12),AVETIMES(12)/NUMPES 45 FORMAT(/,'Time to do sequential operations',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) PRINT 50, MINTIMES(13),MAXTIMES(13),AVETIMES(13)/NUMPES, $ MINTIMES(14),MAXTIMES(14),AVETIMES(14)/NUMPES 50 FORMAT(/,'Time to do backtracking',/, $ ' MIN CPU = ',F12.4,' seconds',/, $ ' MAX CPU = ',F12.4,' seconds',/, $ ' AVG CPU = ',F12.4,' seconds',/,/, $ ' MIN WALL = ',F12.4,' seconds',/, $ ' MAX WALL = ',F12.4,' seconds',/, $ ' AVG WALL = ',F12.4,' seconds',/) c If no errors then print out stats from final iteration IF (IER(2) .EQ. 0) THEN PRINT 55, T,Z 55 FORMAT('Statistics on final iteration: ',/, $ ' Length of solution on last iteration = ',I10,/, $ ' Lg probability of path = ',F16.4,/) PRINT 60 60 FORMAT('A few of the steps are:') PRINT 65,(B(I),I=0,19) 65 FORMAT('Steps 0 through 19',/,20I4,/) J=T/2 JJ=J+19 PRINT 70,J,JJ,(B(I),I=J,JJ) 70 FORMAT('Steps ',I7,' through ',I7,/,20I4,/) J=T-19 JJ=T PRINT 70,J,JJ,(B(I),I=J,JJ) PRINT 75 75 FORMAT(//' *** NO ERRORS DETECTED *** ',//) RETURN ENDIF c Error occurred IF (IER(2) .GT. 0) THEN PRINT 80, IER(1) 80 FORMAT(/,' *** Error detected on iteration ',I5, ' *** ',/) IF (IER(2) .EQ. 1) THEN PRINT 85, Z, ZZ, ABS(Z/ZZ-1) 85 FORMAT(' Error: Path probability = ',E16.6,/, $ ' Expected ',E16.6,' Difference = ',E16.6,//) RETURN ELSE PRINT 90, IER(3) 90 FORMAT(' Error in described path.',/, $ ' Invalid transition on step ',I7,//) RETURN ENDIF ENDIF ENDIF END