atomic-solvers / featom

Finite Element Solvers for Atomic Structure Calculations
https://atomic-solvers.github.io/featom/
MIT License
12 stars 2 forks source link

Coulomb benchmark #22

Open certik opened 11 months ago

certik commented 11 months ago
$ fpm test --profile=release --flag "-ffast-math -march=native" --verbose test_coulomb_dirac
$ time build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac
  Z  rmax   Ne       a  p Nq DOFs
 92  50.0    7   100.0 18 19  252   -16817.941478305813

 Comparison of calculated and reference energies

 Total energy:
                   E               E_ref     error
 -16817.941478305813 -16817.941478425906  1.20E-07
 Eigenvalues:
   n                   E               E_ref     error
   1  -4861.198022999884  -4861.198023119372  1.19E-07
   2  -1257.395890258143  -1257.395890257889  2.55E-10
   3  -1089.611420919908  -1089.611420919875  3.27E-11
   4  -1257.395890258282  -1257.395890257889  3.93E-10
   5   -539.093341793825   -539.093341793890  6.55E-11
   6   -489.037087678193   -489.037087678200  7.28E-12
   7   -539.093341793501   -539.093341793890  3.89E-10
   8   -476.261595160984   -476.261595161155  1.71E-10
   9   -489.037087678142   -489.037087678200  5.82E-11
  10   -295.257844100390   -295.257844100397  7.28E-12
  11   -274.407758840061   -274.407758840065  3.64E-12
  12   -295.257844100288   -295.257844100397  1.09E-10
  13   -268.965877827046   -268.965877827130  8.37E-11
  14   -274.407758840072   -274.407758840065  7.28E-12
  15   -266.389447187878   -266.389447187816  6.18E-11
  16   -268.965877827126   -268.965877827130  3.64E-12
  17   -185.485191678483   -185.485191678552  6.91E-11
  18   -174.944613583466   -174.944613583462  3.64E-12
  19   -185.485191678566   -185.485191678552  1.46E-11
  20   -172.155252323671   -172.155252323737  6.55E-11
  21   -174.944613583462   -174.944613583462  0.00E+00
  22   -170.828937049922   -170.828937049879  4.37E-11
  23   -172.155252323715   -172.155252323737  2.18E-11
  24   -170.049934288523   -170.049934288552  2.91E-11
  25   -170.828937049890   -170.828937049879  1.09E-11
  26   -127.093638842303   -127.093638842631  3.27E-10
  27   -121.057538029563   -121.057538029549  1.46E-11
  28   -127.093638842616   -127.093638842631  1.46E-11
  29   -119.445271987104   -119.445271987141  3.64E-11
  30   -121.057538029552   -121.057538029549  3.64E-12
  31   -118.676410324380   -118.676410324351  2.91E-11
  32   -119.445271987133   -119.445271987141  7.28E-12
  33   -118.224144624899   -118.224144624903  3.64E-12
  34   -118.676410324337   -118.676410324351  1.46E-11
  35   -117.925825597333   -117.925825597293  4.00E-11
  36   -118.224144624906   -118.224144624903  3.64E-12
  37    -92.440787600921    -92.440787600943  2.18E-11
  38    -88.671749052020    -88.671749052017  3.64E-12
  39    -92.440787600932    -92.440787600943  1.09E-11
  40    -87.658287631864    -87.658287631893  2.91E-11
  41    -88.671749052017    -88.671749052017  0.00E+00
  42    -87.173966671970    -87.173966671948  2.18E-11
  43    -87.658287631886    -87.658287631893  7.28E-12
  44    -86.888766390930    -86.888766390941  1.09E-11
  45    -87.173966671948    -87.173966671948  0.00E+00
  46    -86.700519572834    -86.700519572809  2.55E-11
  47    -86.888766390941    -86.888766390941  0.00E+00
build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac  0.06s user 0.00s system 97% cpu 0.068 total
certik commented 11 months ago

Now it is:

$ time build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac
  Z  rmax   Ne       a  p Nq DOFs
 92  50.0    7   100.0 18 19  252   -16817.941478294972

 Comparison of calculated and reference energies

 Total energy:
                   E               E_ref     error
 -16817.941478294972 -16817.941478425906  1.31E-07
 Eigenvalues:
   n                   E               E_ref     error
   1  -4861.198022999983  -4861.198023119372  1.19E-07
   2  -1257.395890265838  -1257.395890257889  7.95E-09
   3  -1089.611420927515  -1089.611420919875  7.64E-09
   4  -1257.395890249823  -1257.395890257889  8.07E-09
   5   -539.093341786913   -539.093341793890  6.98E-09
   6   -489.037087677327   -489.037087678200  8.73E-10
   7   -539.093341781507   -539.093341793890  1.24E-08
   8   -476.261595160264   -476.261595161155  8.91E-10
   9   -489.037087677425   -489.037087678200  7.75E-10
  10   -295.257844104093   -295.257844100397  3.70E-09
  11   -274.407758835881   -274.407758840065  4.18E-09
  12   -295.257844101881   -295.257844100397  1.48E-09
  13   -268.965877826377   -268.965877827130  7.53E-10
  14   -274.407758840222   -274.407758840065  1.56E-10
  15   -266.389447191017   -266.389447187816  3.20E-09
  16   -268.965877823732   -268.965877827130  3.40E-09
  17   -185.485191674648   -185.485191678552  3.90E-09
  18   -174.944613588166   -174.944613583462  4.70E-09
  19   -185.485191688342   -185.485191678552  9.79E-09
  20   -172.155252316799   -172.155252323737  6.94E-09
  21   -174.944613587231   -174.944613583462  3.77E-09
  22   -170.828937048194   -170.828937049879  1.68E-09
  23   -172.155252327335   -172.155252323737  3.60E-09
  24   -170.049934282280   -170.049934288552  6.27E-09
  25   -170.828937046092   -170.828937049879  3.79E-09
  26   -127.093638844566   -127.093638842631  1.94E-09
  27   -121.057538033740   -121.057538029549  4.19E-09
  28   -127.093638853490   -127.093638842631  1.09E-08
  29   -119.445271979213   -119.445271987141  7.93E-09
  30   -121.057538026485   -121.057538029549  3.06E-09
  31   -118.676410316264   -118.676410324351  8.09E-09
  32   -119.445271975383   -119.445271987141  1.18E-08
  33   -118.224144618838   -118.224144624903  6.06E-09
  34   -118.676410324482   -118.676410324351  1.31E-10
  35   -117.925825597980   -117.925825597293  6.88E-10
  36   -118.224144635129   -118.224144624903  1.02E-08
  37    -92.440787602878    -92.440787600943  1.94E-09
  38    -88.671749057474    -88.671749052017  5.46E-09
  39    -92.440787611693    -92.440787600943  1.08E-08
  40    -87.658287626869    -87.658287631893  5.02E-09
  41    -88.671749059467    -88.671749052017  7.45E-09
  42    -87.173966671293    -87.173966671948  6.55E-10
  43    -87.658287621020    -87.658287631893  1.09E-08
  44    -86.888766396889    -86.888766390941  5.95E-09
  45    -87.173966680304    -87.173966671948  8.36E-09
  46    -86.700519566570    -86.700519572809  6.24E-09
  47    -86.888766386059    -86.888766390941  4.88E-09
build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac  0.05s user 0.00s system 97% cpu 0.052 total
certik commented 11 months ago

Now I am getting:

$ time build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac
  Z  rmax   Ne       a  p Nq DOFs
 92  50.0    7   100.0 18 19  252   -16991.208873006937

 Comparison of calculated and reference energies

 Total energy:
                   E               E_ref     error
 -16991.208873006937 -16991.208873101070  9.41E-08
 Eigenvalues:
   n                   E               E_ref     error
   1  -4861.198022999983  -4861.198023119372  1.19E-07
   2  -1257.395890265838  -1257.395890257889  7.95E-09
   3  -1089.611420915040  -1089.611420919875  4.83E-09
   4  -1257.395890263764  -1257.395890257889  5.88E-09
   5   -539.093341786913   -539.093341793890  6.98E-09
   6   -489.037087680459   -489.037087678200  2.26E-09
   7   -539.093341800057   -539.093341793890  6.17E-09
   8   -476.261595165561   -476.261595161155  4.41E-09
   9   -489.037087681536   -489.037087678200  3.34E-09
  10   -295.257844104093   -295.257844100397  3.70E-09
  11   -274.407758837770   -274.407758840065  2.30E-09
  12   -295.257844109172   -295.257844100397  8.77E-09
  13   -268.965877834155   -268.965877827130  7.02E-09
  14   -274.407758848054   -274.407758840065  7.99E-09
  15   -266.389447182391   -266.389447187816  5.42E-09
  16   -268.965877828283   -268.965877827130  1.15E-09
  17   -185.485191674648   -185.485191678552  3.90E-09
  18   -174.944613590429   -174.944613583462  6.97E-09
  19   -185.485191678468   -185.485191678552  8.37E-11
  20   -172.155252319335   -172.155252323737  4.40E-09
  21   -174.944613576867   -174.944613583462  6.60E-09
  22   -170.828937051167   -170.828937049879  1.29E-09
  23   -172.155252320415   -172.155252323737  3.32E-09
  24   -170.049934294355   -170.049934288552  5.80E-09
  25   -170.828937060371   -170.828937049879  1.05E-08
  26   -127.093638844566   -127.093638842631  1.94E-09
  27   -121.057538026940   -121.057538029549  2.61E-09
  28   -127.093638852788   -127.093638842631  1.02E-08
  29   -119.445271994689   -119.445271987141  7.55E-09
  30   -121.057538024008   -121.057538029549  5.54E-09
  31   -118.676410313972   -118.676410324351  1.04E-08
  32   -119.445271981574   -119.445271987141  5.57E-09
  33   -118.224144629690   -118.224144624903  4.79E-09
  34   -118.676410318752   -118.676410324351  5.60E-09
  35   -117.925825594612   -117.925825597293  2.68E-09
  36   -118.224144626794   -118.224144624903  1.89E-09
  37    -92.440787602878    -92.440787600943  1.94E-09
  38    -88.671749046935    -88.671749052017  5.08E-09
  39    -92.440787593991    -92.440787600943  6.95E-09
  40    -87.658287634076    -87.658287631893  2.18E-09
  41    -88.671749047953    -88.671749052017  4.06E-09
  42    -87.173966674007    -87.173966671948  2.06E-09
  43    -87.658287636532    -87.658287631893  4.64E-09
  44    -86.888766384705    -86.888766390941  6.24E-09
  45    -87.173966676677    -87.173966671948  4.73E-09
  46    -86.700519572474    -86.700519572809  3.35E-10
  47    -86.888766392029    -86.888766390941  1.09E-09
  48    -86.566875103392    -86.566875102359  1.03E-09
  49    -86.700519563779    -86.700519572809  9.03E-09
build/gfortran_565E65E7876A06C6/test/test_coulomb_dirac  0.04s user 0.00s system 95% cpu 0.049 total
HaoZeke commented 11 months ago

For featom and ifort I get:

FC=$(which ifort) FFLAGS="-O3 -xHost -ipo -no-prec-div -fp-model fast=2" meson setup bbdir -Dwith_tests=True --buildtype="release"
meson compile -C bbdir
Benchmark 1: ./bbdir/testCoulombDirac
  Time (mean ± σ):      37.0 ms ±   1.4 ms    [User: 33.0 ms, System: 3.8 ms]
  Range (min … max):    35.5 ms …  44.6 ms    77 runs
# Plain time
./bbdir/testCoulombDirac  0.03s user 0.00s system 99% cpu 0.038 total