Source codes and the explanations of N.Tajima's fortran benchmark tests (ver.2)

Japanese page

    Real number operations

  1. matvec.f

    #lines : 58 , Arrays : real*8 h(1023,1023) (8.0MB)

    This program repeats 6,000 times a multiplication of a double-precision real matrix of dimension 1023 x 1023 to a double-precision real vector of dimension 1023.

    The number of repetitions of 6,000 is determined as 6000 = NSOL x ITER, where NSOL is defined to be 3 in line No. 9 and ITER is defined to be 2000 in line No. 10 of the source code. If you find the CPU time to be too long or too short for measurement purpose, change the value of ITER. The CPU time changed in proportion to ITER.

    The matrix is symmetric. The program shows the largest three eigenvalues of the matrix. The precision is not guaranteed because this is a program for a bench-mark test.

  2. matvecz.f

    #lines : 66 , Arrays : complex*16 h(723,723) (8.0MB)

    This program is a Complex*16 version of matvec.f. The dimension of the matrix is reduced to 723 x 723 so that the size of array is roughly unchanged. The number of multiplications of a matrix to a vector is also reduced to 3000.

    The matrix is hermite. The program shows the largest three eigenvalues of the matrix. The precision is not guaranteed.

  3. leqs1k.f

    #lines : 102 , Arrays :real*8 h(1001,1001) (7.6MB)

    This program solves 1001-variable linear equations with the method of Gauss 5 times.

    In the 7th line of the source code: "CALL LEQS2(1.0D0, 1.0D0, 1.0D0, 5)", the last argument "5" is the number of repetitions. The CPU time changed proportionally to the number.

  4. leqs4h.f

    #lines : 102 , Arrays : real*8 h(401,401) (1.2MB)

    This program solves 401-variable linear equations with the method of Gauss 78 times. Note that 78 = 5*(1001/401)^3.

  5. jacobi1h.f

    #lines : 168 , Arrays : 2 x real*8 h(101,101), v(101,101) (159KB), NB: h0(101,101) is rarely accessed

    This program calculates 200 times all the eigenvalues of eigenvectors of 101 x 101 dimensional double-precision real symmetric matrix with the Jacobi method. The precision in not guaranteed. More specifically, it repeats a period of cyclic Jacobi transformation 1000 times (= NCYCLE x LMAX = 5 x 200).

    Incidentally, according to a measurement for a system with "Pentium-Pro 200MHz cache 256KB, linux, g77", about 15% of the total CPU time was spent by the other parts than the Jacobi transformations.

  6. jacobi11.f

    #lines : 168 , Arrays : 2 x real*8 h(11,11),v(11,11) (1.9KB), NB:h0(11,11) is rarely accessed.

    This program calculates 200,000 times all the eigenvalues of eigenvectors of 11 x 11 dimensional double-precision real symmetric matrix with the Jacobi method. The precision in not guaranteed. More specifically, it repeats a period of cyclic Jacobi transformation 1,000,000 times (= NCYCLE x LMAX = 5 x 200,000).

  7. runge.f

    #lines : 78 , Arrays : none

    This program solves 4-variable first-order ordinary differential equations with the 4th order Runge-Kutta (1/6)-formula approximation up to 200,000,000 steps. The number of steps is given in the 16th lines of the source code as "N=200000000". The CPU time is proportional to N.

    The equation expresses the Newtonian motion of a point object under potential energy of LOG_E(R), R=SQRT(X**2+Y**2). The equation of motion needs not the potential but its gradient, which does not require either LOG or SQRT.

  8. intgl4.f

    #lines : 38 , Arrays : none

    This program runs 4-fold loop, where the length of each loop is 200, to calculate an integral. The line No. 12 defines the loop length as "N=200". The CPU time changes as N^4.

    Internal functions

  9. mathfnc1.f

    #lines : 23 , Arrays : none

    This program evaluates SIN(X)+SQRT(COS(X)) 100,000,000 times.

    What you will see on the screen is the integral of the above function for x from 0.1 to 0.9.

    For your information, I show in the following table the necessary CPU time for evaluation of each Fortran internal function 10,000,000 times for two systems: system A is "Pentium Pro 200MHz, Linux, g77", system B is "Pentium II 300MHz, Linux, g77".

           (system A)        (system B)
                (sec)             (sec)
      TANH      16.80    SINH     10.51
      SINH      16.73    TANH     10.48
      ACOS      15.01    ACOS      9.96
      ASIN      13.61    ASIN      8.87
      COSH      13.11    COSH      8.34
      EXP       10.53    EXP       7.22
      ATAN2      9.31    ATAN2     6.26
      TAN        8.96    TAN       6.13
      ATAN       8.42    ATAN      5.84
      LOG10      7.62    LOG10     5.19
      LOG        6.58    LOG       4.49
      COS        5.90    COS       3.99
      SIN        5.38    SIN       3.89
      SQRT       3.47    SQRT      3.04
      NO FUNC    0.52    NO FUNC   0.77  <-- time necessary to run the loop
    

  10. mathfnc2.f

    #lines : 23 , Arrays : none

    This program evaluates ATAN2(EXP(X),LOG(X+1.0D0)) 100,000,000 times.

    What you will see on the screen is the integral of the above function for x from 0.1 to 0.9.

    Integer operations

  11. intpi3.f

    #lines : 52 , Arrays : none

    This program uses only 4-byte integers and executes an algorithm which is not extremely simple.

    The displayed result is an approximate number for the mathematical constant "pi". It was obtained by integrating "N**2 - R**2" inside a sphere of radius N.

  12. intosc.f

    #lines : 21 , Arrays : none.

    This program repeats "K=(205*J)/103-I ; I=J ; J=K" 1,000,000,000 times.

    Random access to memory

  13. permute1.f

    #lines : 51 , Arrays : integer*4 p(1024) (4KB)

    This program swaps repeatedly the values of two elements of an array of 4-byte integers with dimension 1024. The number of repetitions is 1024*262144 = 268435456 = 2^28. The two elements to be swapped are chosen quasi-randomly.

  14. permute2.f

    #lines : 51 , Arrays : integer*4 p(32768) (128KB)

    This program swaps repeatedly the values of two elements of an array of 4-byte integers with dimension 32768. The number of repetitions is 32768*8192 = 268435456 = 2^28. The two elements to be swapped are chosen quasi-randomly.

  15. permute3.f

    #lines : 51 , Arrays : integer*4 p(1048576) (4MB)

    This program swaps repeatedly the values of two elements of an array of 4-byte integers with dimension 1048576. The number of repetitions is 1048576*256 = 268435456 = 2^28. The two elements to be swapped are chosen quasi-randomly.


Last modified: August 22, 2007
Return to Top page of the benchmark tests