CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C Machine/Architecture Specific file CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC c c c This is the module file that needs to be modified based upon the c specific machine. These parameters depend upon memory size and c other factors. See epecific benchamarks for more detailed descriptions c of what they mean. -- john.c 5/99 c MODULE LIMITS c c Bench 1: c ---------------- c Change this parameter to be the maximum N that memory can handle. c 4000 is the default, With only 128 MB ram, 2000 is a good maximum. PARAMETER(B1_MAXN = 4000) CKRB PARAMETER(B1_MAXN = 2000) c c Change this to be the maximum number of iterative refinements. c Default = 10 PARAMETER(B1_MAXK = 10) c c This is the maximum number of times to repeat the test, c Default = 50 PARAMETER(B1_NLOOPSMX = 50) c c c Bench 2: c ---------------- c This parameter is the maximum number of records that can be sorted. c adjust to fit memory requirements. Default is 50000000 PARAMETER(B2_MAXSIZE = 22000000) Ckrb PARAMETER(B2_MAXSIZE = 50000000) c c Change this tothe number of bits in a word for this program c (if comilper defaults to 64, leave untouched). Default = 64. PARAMETER(B2_WORDSIZ = 64) c c c Bench 2d: c This is a RUNSIZE parameter. Should be largest value that can c still run, approximately 1/3 system memory. Default = 10000000 PARAMETER(B2D_RUNSIZE = 10000000) CKRB PARAMETER(B2D_RUNSIZE = 100000) c c This is the number of initial runs to perform. Default = 10 PARAMETER(B2D_INITIALRUNS=10) c c c Bench 3: c ---------------- c This is the maximum N you can input, Default is 3000000, adjust c to fit memory size.. PARAMETER(B3_MAXN = 3000000) CKRB PARAMETER(B3_MAXN = 300000) c c c Bench 4: c ---------------- c Maximum length of stream for benchmark 4. Default = 10000000 PARAMETER ( B4_MAXLEN = 10000000 ) CKRB PARAMETER ( B4_MAXLEN = 100000 ) c c Number of bits in a word. This code assumes that this c is 64. Wordsize must be at least 64 for code to work properly. PARAMETER(B4_WS = 64) c c Maximum number of words needed to store an N-bit integer c Assumes N <= 1024 ckrb PARAMETER(B4_MAXWRDS=16) PARAMETER(B4_MAXWRDS=1) c c c Bench 5 : c ---------------- c Maximum length of Bitstreeam to choose integers from that will c fit in memory. Default = 100000000 PARAMETER ( B5_MAXLEN = 25000000 ) CKRB PARAMETER ( B5_MAXLEN = 100000000 ) CKRB PARAMETER ( B5_MAXLEN = 1 000 000 ) c c c Bench 6 : c ---------------- c Maximum number of loops. Default = 100. PARAMETER(B6_NLOOPSMX = 400 ) c c Maximum length of S stream. Default = 10000000 PARAMETER(B6_LMAX = 10 000 000 ) c c Array size (# of equations to solve). Default = 700 PARAMETER(B6_MSIZE = 700 ) c c Number of bits per word. Default = 64 PARAMETER(B6_NBPW = 64 ) c c Log base 2 of NBPW. Default = 6 PARAMETER(B6_LBPW = 6 ) c c c Bench 7 : c ---------------- c Maximum length of the A stream buffer in 64 bit words c NOTE: Changing this buffer size may result in errors in c the check routine C7 as the answers may not be in expected c locations with a different buffer size. Default = 11264000 c PARAMETER ( B7_MLW = 11264000) CKRB PARAMETER ( B7_MLW = 1126400) c c c Bench 8d: c ---------------- c Maximum 'T' allowed. Default = 1000000 PARAMETER (B8_MT = 1000000) CKRB PARAMETER (B8_MT = 100000) c c Minimum floating point value architecture can support PARAMETER(B8_FPMIN = 1.0E-307) c c The maximum size of the matrices and vectors. Default = 30 PARAMETER (B8_MN=30) c c The maximum number of matrices. Default = 50 PARAMETER (B8_MK=50) c c Bench 8s: c ---------------- c Maximum 'N' allowed, default = 1000000 PARAMETER (B8S_MN = 500000) CKRB PARAMETER (B8S_MN = 1000000) c c The maximum number of matrices. Default = 5 PARAMETER (B8S_MK=5) c c The number of non-zero entries per row and column. Default = 5 PARAMETER (B8S_ML = 5) c c The maximum length of the D stream. Default = 2000 PARAMETER (B8S_MT = 2000) CKRB PARAMETER (B8S_MT = 200) c c c Bench 9 : c ---------------- c Maximum length of bit stream. Default = 1 000 000 000 PARAMETER ( B9_MAXL = 1000000000 ) c c Maximum # of bits to extract per integer from the stream. Default=46. PARAMETER ( B9_MAXN = 46 ) c Maximum buffer size, ajust to fit memory.. default = 1048576 PARAMETER( B9_LBUF = 1 048 576 ) c c c Bench 10: c ---------------- c This is the max number of complete solutions found by each processor. c Default = 23000000 c PARAMETER (B10_MAXTS = 23 000 000) CKRB PARAMETER (B10_MAXTS = 23 000 0) c c This is the Maximum number of solutions possible). c Default = 15000000 (little more than needed for N=16) c PARAMETER (B10_MAXSOL = 15000000) CKRB PARAMETER (B10_MAXSOL = 150000) c c c Bench 11: c ----------------- c This is the maximum size of the matrix, Default = max = 512, c Most probably should fill in with 5,25,100,225, or 512. c CRAF PARAMETER(B11_MAXMATSIZE = 225) PARAMETER(B11_MAXMATSIZE = 100) c c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc END MODULE LIMITS cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c This module is to pass the POPCNT and LEADZ arrays around without common c blocks. Uncomment this if the archetecture doesn't support the POPCNT c and LEADZ instructions. Also, uncomment the routines below. cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc MODULE POP_N_LEADZ c REAL(KIND=8), DIMENSON(65535) :: POPS, LZCNT END MODULE POP_N_LEADZ c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Following are software versions of the leading zero and popcount C functions needed for those architectures without these features. C It also contains versions of the timing routines. The timing C routines most likely will need to be modified for each C architecture. C C Contents: C INITPC - Popcount table initialization C POPCNT - Popcount function C INITLZ - Leading zero table initialization C LEADZ - Leading zero function C WALL - Wall Clock timer function C CPUTIME - CPU timer function C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C SUBROUTINE INITPC_COM c USE POP_N_LEADZ c Uncomment this routine for machines without popcnt hardware. c This routine initializes a 2^16 array to contain the popcount c of each index. Then the popcount of a 64 bit number can be c performed with four table look-ups. c IMPLICIT INTEGER (A-Z) cc COMMON /POPS/POPS(0:65535) c INTEGER POPS2(0:255) c INTEGER POPS3(0:15) c cc POPS3 contains the popcount of 4 bit indices c DATA POPS3/0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4/ c cc Generate array POPS2 to contain the popcount of 8 bit indices c DO 10 I = 0,15 c DO 10 J = 0,15C c POPS2(I*16+J) = POPS3(I) + POPS3(J) c 10 CONTINUE c cc Finally, generate array POPS to contain the popcount of 16 bit indices c DO 20 I = 0,255 c DO 20 J = 0,255 c POPS(I*256+J) = POPS2(I) + POPS2(J) c 20 CONTINUE RETURN END C C c FUNCTION POPCNT(IVAL) c Uncomment this routine for machines without popcnt hardware. c This routine uses the array initialized in INITPC to find the c popcount of a 64-bit number. c USE POP_N_LEADZ c c IMPLICIT INTEGER (A-Z) c Version for 64-bit words cc COMMON /POPS/POPS(0:65535) c c POPCNT = POPS(IAND(65535_8,IVAL)) + c & POPS(IAND(65535_8,ISHFT(IVAL,16_8))) + c & POPS(IAND(65535_8,ISHFT(IVAL,32_8))) + c & POPS(IAND(65535_8,ISHFT(IVAL,48_8))) c c RETURN c END C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C SUBROUTINE INITLZ_COM c Uncomment this routine for machines without leadz hardware. c This routine initializes a 2^16 array to contain the position of c the leading zero of each index. This is used in the LEADZ c subroutine which follows. c USE POP_N_LEADZ c c IMPLICIT INTEGER(KIND=8) (A-Z) cc COMMON /LZCNT/LZCNT(0:65535) c c LZCNT(0) = 16 c LZCNT(1) = 15 c DO 20 I = 2,16 c DO 10 J = 2**(i-1),2**I-1 c LZCNT(J) = 16-I c 10 CONTINUE c 20 CONTINUE RETURN END c C c FUNCTION LEADZ(IVAL) c Uncomment this routine for machines without leadz hardware. c This routine uses the array initialized in INITLZ to find the c leading zero in the first non-zero double byte. c USE POP_N_LEADZ c IMPLICIT INTEGER (A-Z) Cc Version for 64-bit words Cc COMMON /LZCNT/LZCNT(0:65535) C IF (IVAL .GE. ISHFT(1_8,49_8)) THEN C LEADZ = LZCNT(ISHFT(IVAL,-48_8)) C ELSE IF (IVAL .GE. ISHFT(1_8,33_8)) THEN C LEADZ = 16_8 + LZCNT(IAND(65535_8,ISHFT(IVAL,-32_8))) C ELSE IF (IVAL .GT. 65535_8) THEN C LEADZ = 32_8 + LZCNT(IAND(65535_8,ISHFT(IVAL,-16_8))) C ELSE C LEADZ = 48_8 + LZCNT(IAND(65535_8,IVAL)) C END IF c RETURN c END FUNCTION WALL() cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Computes the amount of wall clock time that has elapsed. c c Make suitable changes to provide access to wall clock time c on architecture being used. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Uncomment this for DEC WALL = SECNDS(0.0) c Uncomment this doe Unicos/Irix c WALL = SECONDR() RETURN END FUNCTION CPUTIME() cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Computes the amount of cpu time that has elapsed. c c Make suitable changes to provide access to cpu time on c architecture being used. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Uncomment this if compile supports Fortran95 CPU_TIME() (DEC) CALL CPU_TIME(CPUTIME) c Uncomment this for Unicos/Irix c CPUTIME = SECOND() RETURN END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c This is a GETARG wrapper implimented as a function c c Make sure you uncomment the getarg part that is correct for the c compiler or archetecture, or write your own. ARGNUM is the c arguement number, outbuffer is where the arguement is returned. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc FUNCTION GETARG_COM(ARGNUM, OUTBUFFER) INTEGER GETARG_COM c CHARACTER, INTENT(OUT), DIMENSION(80) :: OUTBUFFER CHARACTER(LEN=*) OUTBUFFER INTEGER ARGNUM 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 20:45:00 $ $Revision: 1.2 $" // $ "$RCSfile: util.f,v $ $Name: rel_5 $", 0) c If GETARG is a subroutine call (DEC Alpha), uncomment this EXTERNAL GETARG CALL GETARG(ARGNUM, OUTBUFFER) GETARG_COM=LEN_TRIM(OUTBUFFER) c if GETARG is a POSIX compliant function call (Irix/UNICOS), uncomment this c GETARG_COM = GETARG(ARGNUM, OUTBUFFER) RETURN END