12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

380 chapter 14/optimize:4/optimize:5Interprocedure analysis, inlining small proceduresActivate loop transformation optimizationsThe gnu compilers gcc, g77, g90 accept –O options as well as–malign–double–ffloat–store–fforce–mem, –fforce–addr–fno–inline–ffast–math–funsafe–math–optimizations–fno–trapping–math–fstrength–reduce–frerun–cse–after–loop–fexpensive–optimizations–fdelayed–branch–fschedule–insns–fschedule–insns2–fcaller–saves–funroll–loops–funroll–all–loopsAlign doubles on 64-bit boundariesFor codes using IEEE-854 extendedprecisionImproves loop optimizationDo not compile statement functions inlineTry non-IEEE handling of floatsSpeeds up float operations; incorrect resultspossibleAssume no floating-point traps generatedMakes some loops fasterUnrolls iterative DO loopsUnrolls DO WHILE loops14.14.4 Java versus Fortran/CThe various versions of the program tune solve the matrix eigenvalue problemHc = Ec (14.11)for the eigenvalues E and eigenvectors c of a Hamiltonian matrix H. Here theindividual Hamiltonian matrix elements are assigned the values⎡⎤1 0.3 0.14 0.027 ...{ i, for i = j,0.3 2 0.3 0.9 ...H i,j =0.3 |i−j| , for i ≠ j, = ⎢ 0.14 0.3 3 0.3 .... (14.12)⎥⎣⎦. ..Because the Hamiltonian is almost diagonal, the eigenvalues should be close tothe values of the diagonal elements and the eigenvectors should be close to N-dimensional unit vectors. For the present problem, the H matrix has dimensionN × N ≃ 2000 × 2000 = 4, 000, 000, which means that matrix manipulations should−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 380

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!