[CP2K:9158] Re: LIBXSMM (cp2kflags?)

Hans Pabst hf.p... at gmail.com
Fri Jun 30 08:29:21 UTC 2017


Hello Dominik,

I just wanted to add to Nico's nice explanation, and give some details 
about what the various libraries are meant for:

   - *libxsmm*: LIBXSMM's main library, and typically sufficient to link 
   with. *CP2K+LIBXSMM needs to link against libxsmm.a*.
   - *libxsmmf*: only needed for FORTRAN code, which uses the libxsmm.mod 
   file. *CP2K+LIBXSMM needs to link against libxsmmf.a*.
   - libxsmmext: contains functions with internal OpenMP-based threading. 
   CP2K+LIBXSMM uses OpenMP-threads by itself (xSMP builds), and there is *no 
   need* to link against libxsmmext.a.
   - libxsmmgen: contains LIBXSMM's code generator (backend), and the 
   library can be used if only the low-level code generator is used. This 
   library is also used to organize LIBXSMM's code, and is actually contained 
   by libxsmm.a. There is *no need* for CP2K+LIBXSMM to link against 
   libxsmmgen.a.
   - libxsmmnoblas: dummy library to deliver BLAS symbols if it is certain 
   that LIBXSMM does not fallback to BLAS. CP2K+LIBXSMM should not link 
   against libxsmmnoblas.a, and there is *no need*.

Btw, in case of using Intel Compiler the Linux-x86-64-intel.* ARCH file(s) 
can be used even with non-Intel branch of CP2K by copying these files into 
the arch-folder (I think Nico pointed to Linux-x86-64-intel.x). In case of 
these "special" arch files there is the choice to intercept *all* xGEMM 
calls with LIBXSMM, and filter-out some (minor) additional performance 
opportunity. On BigCore this is definitely negligible, but perhaps 
beneficial on KNL. However this "choice" is sort of experimental, and can 
be enabled with LIBXSMM=2. For example:

$ make ARCH=Linux-x86-64-intel VERSION=psmp LIBXSMM=2

To also rely on LIBXSMM's transpose routine in some cases, one may use 
LIBXSMM=3. However, the latter requires also the Intel-branch of CP2K. 


Hans


Am Dienstag, 27. Juni 2017 14:25:51 UTC+2 schrieb Dominik Mierzejewski:
>
> Hello, 
>
> On Monday, 26 June 2017 at 07:27, Nico Holmberg wrote: 
> > Hi, 
> > 
> > You seem to be missing the library flags for LIBXSMM. I have set the 
> > following flags (gfortran) 
> > 
> > LIBXSMM_LIB=/homeappl/home/nholmber/appl_sisu/lib/libxsmm-1.7.1/lib 
> > LIBXSMM_INC=/homeappl/home/nholmber/appl_sisu/lib/libxsmm-1.7.1/include 
> > 
> > DFLAGS  += -D__LIBXSMM 
> > FCFLAGS += -I$(LIBXSMM_INC) 
> > LDFLAGS  = $(FCFLAGS) 
> > LIBS     += -L$(LIBXSMM_LIB) -lxsmm -lxsmmext -lxsmmgen -lxsmmf 
>
> Out of curiosity, why are you adding -lxsmmext and -lxsmmgen? They don't 
> seem to be required by libxsmm or libxsmmf. 
>
> Regards, 
> Dominik 
>
> -- 
> Fedora http://fedoraproject.org/wiki/User:Rathann 
> RPMFusion http://rpmfusion.org 
> "Faith manages." 
>         -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations" 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20170630/e68dd8f4/attachment.htm>


More information about the CP2K-user mailing list