| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
| 2 |
|
| 3 |
<!--Converted with LaTeX2HTML 2019.2 (Released June 5, 2019) --> |
| 4 |
<HTML lang="EN"> |
| 5 |
<HEAD> |
| 6 |
<TITLE>2.4 Libraries</TITLE> |
| 7 |
<META NAME="description" CONTENT="2.4 Libraries"> |
| 8 |
<META NAME="keywords" CONTENT="user_guide"> |
| 9 |
<META NAME="resource-type" CONTENT="document"> |
| 10 |
<META NAME="distribution" CONTENT="global"> |
| 11 |
|
| 12 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> |
| 13 |
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> |
| 14 |
<META NAME="Generator" CONTENT="LaTeX2HTML v2019.2"> |
| 15 |
|
| 16 |
<LINK REL="STYLESHEET" HREF="user_guide.css"> |
| 17 |
|
| 18 |
<LINK REL="next" HREF="node12.html"> |
| 19 |
<LINK REL="previous" HREF="node10.html"> |
| 20 |
<LINK REL="next" HREF="node12.html"> |
| 21 |
</HEAD> |
| 22 |
|
| 23 |
<BODY > |
| 24 |
<!--Navigation Panel--> |
| 25 |
<A |
| 26 |
HREF="node12.html"> |
| 27 |
<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> |
| 28 |
<A |
| 29 |
HREF="node7.html"> |
| 30 |
<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> |
| 31 |
<A |
| 32 |
HREF="node10.html"> |
| 33 |
<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> |
| 34 |
<A ID="tex2html165" |
| 35 |
HREF="node1.html"> |
| 36 |
<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> |
| 37 |
<BR> |
| 38 |
<B> Next:</B> <A |
| 39 |
HREF="node12.html">2.5 Libxc library</A> |
| 40 |
<B> Up:</B> <A |
| 41 |
HREF="node7.html">2 Installation</A> |
| 42 |
<B> Previous:</B> <A |
| 43 |
HREF="node10.html">2.3 configure</A> |
| 44 |
<B> <A ID="tex2html166" |
| 45 |
HREF="node1.html">Contents</A></B> |
| 46 |
<BR> |
| 47 |
<BR> |
| 48 |
<!--End of Navigation Panel--> |
| 49 |
<!--Table of Child-Links--> |
| 50 |
<A ID="CHILD_LINKS"><STRONG>Subsections</STRONG></A> |
| 51 |
|
| 52 |
<UL> |
| 53 |
<LI><UL> |
| 54 |
<LI><A ID="tex2html167" |
| 55 |
HREF="node11.html#SECTION00034010000000000000">2.4.0.1 BLAS and LAPACK</A> |
| 56 |
<LI><A ID="tex2html168" |
| 57 |
HREF="node11.html#SECTION00034020000000000000">2.4.0.2 FFT</A> |
| 58 |
<LI><A ID="tex2html169" |
| 59 |
HREF="node11.html#SECTION00034030000000000000">2.4.0.3 MPI libraries</A> |
| 60 |
<LI><A ID="tex2html170" |
| 61 |
HREF="node11.html#SECTION00034040000000000000">2.4.0.4 Libraries for accelerators</A> |
| 62 |
<LI><A ID="tex2html171" |
| 63 |
HREF="node11.html#SECTION00034050000000000000">2.4.0.5 HDF5</A> |
| 64 |
<LI><A ID="tex2html172" |
| 65 |
HREF="node11.html#SECTION00034060000000000000">2.4.0.6 Other libraries</A> |
| 66 |
<LI><A ID="tex2html173" |
| 67 |
HREF="node11.html#SECTION00034070000000000000">2.4.0.7 If optimized libraries are not found</A> |
| 68 |
</UL></UL> |
| 69 |
<!--End of Table of Child-Links--> |
| 70 |
<HR> |
| 71 |
|
| 72 |
<H2><A ID="SECTION00034000000000000000"></A> |
| 73 |
<A ID="Sec:Libraries"></A> |
| 74 |
<BR> |
| 75 |
2.4 Libraries |
| 76 |
</H2> |
| 77 |
|
| 78 |
<P> |
| 79 |
Q<SMALL>UANTUM </SMALL>ESPRESSO contains a copy of some needed external libraries: |
| 80 |
|
| 81 |
<UL> |
| 82 |
<LI>iotk and FoX for reading and writing xml files; |
| 83 |
</LI> |
| 84 |
<LI>BLAS (<TT>http://www.netlib.org/blas/</TT>) and LAPACK |
| 85 |
(<TT>http://www.netlib.org/lapack/</TT>) for linear algebra; |
| 86 |
</LI> |
| 87 |
<LI>FFTW (<TT>http://www.fftw.org/</TT>) for Fast Fourier Transforms. |
| 88 |
</LI> |
| 89 |
</UL> |
| 90 |
Optimized vendor-specific libraries often yield huge performance gains |
| 91 |
with respect to compiled libraries and should be used whenever |
| 92 |
possible. <TT>configure</TT> always try to locate the best mathematical |
| 93 |
libraries. |
| 94 |
|
| 95 |
<BR> |
| 96 |
<P> |
| 97 |
|
| 98 |
<H4><A ID="SECTION00034010000000000000"> |
| 99 |
2.4.0.1 BLAS and LAPACK</A> |
| 100 |
</H4> |
| 101 |
Q<SMALL>UANTUM </SMALL>ESPRESSO can use any architecture-optimized BLAS and LAPACK replacements, |
| 102 |
like those contained e.g. in the MKL for Intel and AMD CPUs, or |
| 103 |
ESSL for IBM Power machines. |
| 104 |
|
| 105 |
<P> |
| 106 |
If no optimized libraries are available, one may try the ATLAS library: |
| 107 |
<TT>http://math-atlas.sourceforge.net/</TT>. Note that ATLAS is not |
| 108 |
a complete replacement for LAPACK: it contains all of the BLAS, plus the |
| 109 |
LU code, plus the full storage Cholesky code. Follow the instructions in the |
| 110 |
ATLAS distributions to produce a full LAPACK replacement. |
| 111 |
|
| 112 |
<P> |
| 113 |
Sergei Lisenkov reported success and good performances with optimized |
| 114 |
BLAS by Kazushige Goto. The library is now available under an |
| 115 |
open-source license: see the GotoBLAS2 page at |
| 116 |
<BR><TT>http://www.tacc.utexas.edu/tacc-software/gotoblas2/</TT>. |
| 117 |
|
| 118 |
<P> |
| 119 |
|
| 120 |
<H4><A ID="SECTION00034020000000000000"> |
| 121 |
2.4.0.2 FFT</A> |
| 122 |
</H4> |
| 123 |
The FFTXlib of Q<SMALL>UANTUM </SMALL>ESPRESSO contains a copy of an old FFTW library. |
| 124 |
It also supports |
| 125 |
the newer FFTW3 library and some vendor-specific FFT libraries. |
| 126 |
<TT>configure</TT> will first search for vendor-specific FFT libraries; |
| 127 |
if none is found, it will search for an external FFTW v.3 library; |
| 128 |
if none is found, it will fall back to the internal copy of FFTW. |
| 129 |
<TT>configure</TT> will add the appropriate preprocessing options: |
| 130 |
|
| 131 |
<UL> |
| 132 |
<LI><TT>-D__LINUX_ESSL</TT> for ESSL on IBM Linux machines, |
| 133 |
</LI> |
| 134 |
<LI><TT>-DASL</TT> for NEC ASL library on NEC machines (obsolete?), |
| 135 |
</LI> |
| 136 |
<LI><TT>-D__ARM_LIB</TT> for ARM Performance library, |
| 137 |
</LI> |
| 138 |
<LI><TT>-D__DFTI</TT> for DFTI (Intel MKL library), |
| 139 |
</LI> |
| 140 |
<LI><TT>-D__FFTW3</TT> for FFTW3 (external), |
| 141 |
</LI> |
| 142 |
<LI><TT>-D__FFTW</TT> for FFTW (internal library), |
| 143 |
</LI> |
| 144 |
</UL> |
| 145 |
to <TT>DFLAGS</TT> in the <TT>make.inc</TT> file. |
| 146 |
If you edit <TT>make.inc</TT> manually, please note that one and |
| 147 |
only one among the mentioned preprocessing option must be set. |
| 148 |
|
| 149 |
<P> |
| 150 |
If you have MKL libraries, you may either use the provided FFTW3 |
| 151 |
interface (v.10 and later), or directly link FFTW3 from MKL (v.12 |
| 152 |
and later) or use DFTI (recommended). |
| 153 |
|
| 154 |
<P> |
| 155 |
|
| 156 |
<H4><A ID="SECTION00034030000000000000"> |
| 157 |
2.4.0.3 MPI libraries</A> |
| 158 |
</H4> |
| 159 |
MPI libraries are usually needed for parallel execution, unless you are |
| 160 |
happy with OpenMP-only multicore parallelization. |
| 161 |
In well-configured machines, <TT>configure</TT> should find the appropriate |
| 162 |
parallel compiler for you, and this should find the appropriate |
| 163 |
libraries. Since often this doesn't |
| 164 |
happen, especially on PC clusters, see Sec.<A HREF="node15.html#SubSec:LinuxPCMPI">2.8.3</A>. |
| 165 |
|
| 166 |
<P> |
| 167 |
<EM>Note:</EM> since v.6.1, MPI libraries implementing v.3 of the standard |
| 168 |
(notably, non-blocking broadcast and gather operations) are required. |
| 169 |
|
| 170 |
<P> |
| 171 |
|
| 172 |
<H4><A ID="SECTION00034040000000000000"> |
| 173 |
2.4.0.4 Libraries for accelerators</A> |
| 174 |
</H4> |
| 175 |
The accelerated version of the code uses standard CUDA libraries such as |
| 176 |
<TT>cublas, cufft, cusolver</TT> and the eigensolver library explicitly |
| 177 |
developed for Q<SMALL>UANTUM </SMALL>ESPRESSO by NVidia and distributed at <TT>https://github.com/NVIDIA/Eigensolver_gpu</TT>. |
| 178 |
|
| 179 |
<P> |
| 180 |
|
| 181 |
<H4><A ID="SECTION00034050000000000000"> |
| 182 |
2.4.0.5 HDF5</A> |
| 183 |
</H4> |
| 184 |
The HDF5 library (<TT>https://www.hdfgroup.org/downloads/hdf5/</TT>), |
| 185 |
v.1.8.16 or later, can be used to perform binary I/O using the HDF5 |
| 186 |
format. |
| 187 |
|
| 188 |
<P> |
| 189 |
If compiling the HDF5 library from sources, attention must be paid |
| 190 |
to pass options <TT>–enable-fortran</TT>, |
| 191 |
<TT>–enable-fortran2003</TT>, and <TT>–enable-parallel</TT> (see below), |
| 192 |
to the <TT>configure</TT> script of <TT>HDF5</TT> (not of Q<SMALL>UANTUM </SMALL>ESPRESSO). |
| 193 |
|
| 194 |
<P> |
| 195 |
To use HDF5 is usually sufficient to specify the path to the fortran |
| 196 |
compiler wrapper for HDF5 (<TT>h5fc</TT> of <TT>h5pfc</TT> with the |
| 197 |
<TT>–with-hdf5=</TT> option of configure. If the wrapper is in the |
| 198 |
default path, just use <TT>–with-hdf5=yes</TT>. |
| 199 |
The configure script is usually able to extract the linker options |
| 200 |
and the include directory path from the output of the wrapper. If it |
| 201 |
fails, the user can provide configure options |
| 202 |
<TT>–with-hdf5-libs=<options></TT> and <TT>–with-hdf5-include=<path></TT> |
| 203 |
for the linker options and include path respectively. |
| 204 |
These options are often needed when using the HDF5 packages |
| 205 |
provided by many LINUX distributions. In this case you may first try |
| 206 |
the <TT>–with-hdf5=yes</TT> option. If it fails, just type command |
| 207 |
<TT>h5fc –show</TT> (or <TT>h5pfc</TT> if you are using parallel HDF5): |
| 208 |
the command will print out the linker and include options to be passed |
| 209 |
manually to the configure script. |
| 210 |
|
| 211 |
<P> |
| 212 |
The configure script is able to determine whether one is linking to a |
| 213 |
serial or parallel HDF5 library, and will set the flag |
| 214 |
<TT>-D__HDF5_SERIAL</TT> in the <TT>make.inc</TT> file accordingly. |
| 215 |
|
| 216 |
<P> |
| 217 |
|
| 218 |
<H4><A ID="SECTION00034060000000000000"> |
| 219 |
2.4.0.6 Other libraries</A> |
| 220 |
</H4> |
| 221 |
Q<SMALL>UANTUM </SMALL>ESPRESSO can use the MASS vector math |
| 222 |
library from IBM, if available (only on machines with XLF compiler: |
| 223 |
likely obsolete). |
| 224 |
|
| 225 |
<P> |
| 226 |
|
| 227 |
<H4><A ID="SECTION00034070000000000000"> |
| 228 |
2.4.0.7 If optimized libraries are not found</A> |
| 229 |
</H4> |
| 230 |
The <TT>configure</TT> script attempts to find optimized libraries, but may fail |
| 231 |
if they have been installed in non-standard places. You should examine |
| 232 |
the final value of <TT>BLAS_LIBS, LAPACK_LIBS, FFT_LIBS, MPI_LIBS</TT> (if needed), |
| 233 |
<TT>MASS_LIBS</TT> (IBM only), either in the output of <TT>configure</TT> or in the generated |
| 234 |
<TT>make.inc</TT>, to check whether it found all the libraries that you intend to use. |
| 235 |
|
| 236 |
<P> |
| 237 |
If some library was not found, you can specify a list of directories to search |
| 238 |
in the environment variable <TT>LIBDIRS</TT>, |
| 239 |
and rerun <TT>configure</TT>; directories in the |
| 240 |
list must be separated by spaces. For example: |
| 241 |
<PRE> |
| 242 |
./configure LIBDIRS="/opt/intel/mkl70/lib/32 /usr/lib/math" |
| 243 |
</PRE> |
| 244 |
If this still fails, you may set some or all of the <TT>*_LIBS</TT> variables manually |
| 245 |
and retry. For example: |
| 246 |
<PRE> |
| 247 |
./configure BLAS_LIBS="-L/usr/lib/math -lf77blas -latlas_sse" |
| 248 |
</PRE> |
| 249 |
Beware that in this case, <TT>configure</TT> will blindly accept the specified value, |
| 250 |
and won't do any extra search. |
| 251 |
|
| 252 |
<P> |
| 253 |
<HR> |
| 254 |
<!--Navigation Panel--> |
| 255 |
<A |
| 256 |
HREF="node12.html"> |
| 257 |
<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> |
| 258 |
<A |
| 259 |
HREF="node7.html"> |
| 260 |
<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> |
| 261 |
<A |
| 262 |
HREF="node10.html"> |
| 263 |
<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> |
| 264 |
<A ID="tex2html165" |
| 265 |
HREF="node1.html"> |
| 266 |
<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> |
| 267 |
<BR> |
| 268 |
<B> Next:</B> <A |
| 269 |
HREF="node12.html">2.5 Libxc library</A> |
| 270 |
<B> Up:</B> <A |
| 271 |
HREF="node7.html">2 Installation</A> |
| 272 |
<B> Previous:</B> <A |
| 273 |
HREF="node10.html">2.3 configure</A> |
| 274 |
<B> <A ID="tex2html166" |
| 275 |
HREF="node1.html">Contents</A></B> |
| 276 |
<!--End of Navigation Panel--> |
| 277 |
|
| 278 |
</BODY> |
| 279 |
</HTML> |