[Wien] WIEN2k and gfortran II

Laurence Marks L-marks at northwestern.edu
Mon Dec 12 14:46:11 CET 2016


That is quite an extraordinary time difference! The KKK/OpenBlas comparison
is very clear, but I wonder if it is just the vectorization routines for
the rest.

One observation about ifort; it is really a very good optimizer, albeit
sometimes too aggressive. There are quite a few loops in Wien2k which are
technically not the fastest, with indices the wrong way around or redundant
variables. At various times I have rewritten some of these, and seen almost
no timing change. I think this is because ifort is itself doing the
reorganization as well as others such as cache and memory optimizations.

I doubt that gfortran is as good an optimizing compiler as ifort.

---
Professor Laurence Marks
"Research is to see what everybody else has seen, and to think what nobody
else has thought", Albert Szent-Gyorgi
http://www.numis.northwestern.edu
Corrosion in 4D http://MURI4D.numis.northwestern.edu
Partner of the CFW 100% gender equity project, www.cfw.org/100-percent
Co-Editor, Acta Cryst A


On Dec 12, 2016 04:04, "Peter Blaha" <pblaha at theochem.tuwien.ac.at> wrote:

Inspired by the recent posts about   gfortran and openblas, I made some
timing tests myself.

I was using the "Test-Case" (serial benchmark) from our website (a
complex case with NMAT=3481.

I tested it on an Intel I7-3939 (6 core) processor with either ifort+mkl
(2016.3.210)  or   gfortran+openblas.
I was using 1, 2, 4 or 6 cores (set via OMP_NUM_TRHEADS) of one PC:

1 core:
Intel     TIME HAMILT (WALL) =     5.2, HNS =     4.2, DIAG =    25.8
gfortran: TIME HAMILT (WALL) =    36.3, HNS =     4.0, DIAG =    25.0

2 cores:
Intel     TIME HAMILT (WALL) =     5.3, HNS =     2.5, DIAG =    14.4
gfortran: TIME HAMILT (WALL) =    36.3, HNS =     2.4, DIAG =    13.4

4 cores:
Intel     TIME HAMILT (WALL) =     5.3, HNS =     1.7, DIAG =     7.7
gfortran: TIME HAMILT (WALL) =    36.6, HNS =     1.7, DIAG =     7.9

6 cores:
Intel     TIME HAMILT (WALL) =     5.3, HNS =     1.5, DIAG =     6.4
gfortran: TIME HAMILT (WALL) =    36.4, HNS =     2.0, DIAG =     7.4

So obviously, the openblas is really VERY good and basically of the same
quality as the MKL (if not faster !!).

But: Setting up the eigenvalue problems (HAMILT) involves the
calculation of many cosines (exponentials) and we can use the
"vector-cosines" from the mkl. This makes ifort in this part 7 times
faster !!!!
This can also be seen from the partial timing in case.output1 of the
hamilt-times, where phase and us are significantly faster:

ifort
Time for al,bl    (hamilt, cpu/wall) :          0.3         0.3
Time for legendre (hamilt, cpu/wall) :          0.1         0.1
Time for phase    (hamilt, cpu/wall) :          1.1         1.3
Time for us       (hamilt, cpu/wall) :          1.2         1.2
Time for overlaps (hamilt, cpu/wall) :          2.0         1.9
Time for distrib  (hamilt, cpu/wall) :          0.1         0.0
gfortran
Time for al,bl    (hamilt, cpu/wall) :          0.2         0.3
Time for legendre (hamilt, cpu/wall) :          0.2         0.2
Time for phase    (hamilt, cpu/wall) :         25.9        25.3
Time for us       (hamilt, cpu/wall) :          6.3         6.8
Time for overlaps (hamilt, cpu/wall) :          2.8         3.0
Time for distrib  (hamilt, cpu/wall) :          0.0         0.0

This limits gfortan significantly, making it in these tests a factor of
two (or, when using 4 cores a factor of 3) slower.

Anyway, the openblas is really good, and if somebody would know how to
"vectorize" the cos, sin (exp) calls in gfortran this would be very
valuable.

Peter Blaha

On 12/08/2016 01:51 PM, John Rundgren wrote:
> Dear Arthur,
>
> "Linker Flags" and "R_LIB" are found by consulting google on
> "xianyi-openblas user manual".
>
> The "include" flag is necessary, otherwise there is a conflict with
> /usr/link/ld.
>
> Xianyi recommends -lopenblas and adds -lpthread -lgfortran with
> motivations understood by wise Linuxers. They have not done any harm.
>
> Could you improve calculation time ...? In a previous wien-bounces you
> find a test where gfortran+openblas is fully competitive with intel+mkl.
> A try is worthwhile.
>
> Best regards / John
>
>
> John Rundgren
> Department of Theoretical Physics, KTH Royal Institute of Technology
>
>
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> https://urldefense.proofpoint.com/v2/url?u=http-3A__zeus.
theochem.tuwien.ac.at_mailman_listinfo_wien&d=CwICAg&c=
yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_
T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=4ZF5koixKVtEe8uFZ3WxwMYft6mbBO
A_NeMfSH4_eyA&e=
> SEARCH the MAILING-LIST at:  https://urldefense.proofpoint.
com/v2/url?u=http-3A__www.mail-2Darchive.com_wien-
40zeus.theochem.tuwien.ac.at_index.html&d=CwICAg&c=
yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_
T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=PkWwLIVnknBQProsZ2RGefHAlq2CYo
v5A2ip53hpcqg&e=
>

--

                                       P.Blaha
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-165300             FAX: +43-1-58801-165982
Email: blaha at theochem.tuwien.ac.at    WIEN2k: https://urldefense.proofpoint.
com/v2/url?u=http-3A__www.wien2k.at&d=CwICAg&c=
yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_
T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=1xbt5lr-9fo0OyUhcIh_
lWOQfAW0G1JRzhMhq99AvNo&e=
WWW:   https://urldefense.proofpoint.com/v2/url?u=http-3A__www.imc.
tuwien.ac.at_TC-5FBlaha&d=CwICAg&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNX
t_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=TDhIh5Sq25APcF9q2jXtVUsF80Qcru
C4QDMuU77MdB8&e=
--------------------------------------------------------------------------
_______________________________________________
Wien mailing list
Wien at zeus.theochem.tuwien.ac.at
https://urldefense.proofpoint.com/v2/url?u=http-3A__zeus.
theochem.tuwien.ac.at_mailman_listinfo_wien&d=CwICAg&c=
yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_
T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=4ZF5koixKVtEe8uFZ3WxwMYft6mbBO
A_NeMfSH4_eyA&e=
SEARCH the MAILING-LIST at:  https://urldefense.proofpoint.
com/v2/url?u=http-3A__www.mail-2Darchive.com_wien-
40zeus.theochem.tuwien.ac.at_index.html&d=CwICAg&c=
yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_
T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=LEs97us_bzM_-
ekk7jHI23IDX5u8HNB0WsYy5TlAROU&s=PkWwLIVnknBQProsZ2RGefHAlq2CYo
v5A2ip53hpcqg&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20161212/e6a29d6e/attachment.html>


More information about the Wien mailing list