-
Notifications
You must be signed in to change notification settings - Fork 125
/
INSTALL
279 lines (190 loc) · 8.46 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
####################################################
High Performance Conjugate Gradient Benchmark (HPCG)
####################################################
:Author: Jack Dongarra and Michael Heroux and Piotr Luszczek
:Revision: 3.1
:Date: March 28, 2019
=================
Clone from GitHub
=================
The official HPCG repository is on GitHub.com. You may fork the
repository from here::
https://github.com/hpcg-benchmark/hpcg
===================
Download and Unpack (only if you did not clone from GitHub.com)
===================
Retrieve the tar-gzip file, from http://hpcg-benchmark.org
then uncompress it with::
gunzip hpcg.tar.gz; tar -xvf hpcg.tar
this will create an ``hpcg`` directory, that we call the top-level
directory in the text below.
=============
Configuration
=============
HPCG provides three methods of configuration: one based on make(1),
one based on CMake, and one based on Autoconf. They are discussed in
more details below.
---------------------------
Configuration based on Make
---------------------------
HPCG configuration with a make-compatible file for configuring the
compilers, linkers, and their command line flags starts with creating a
file ``Make.<arch>`` in the ``setup`` directory right under the
top-level directory. The suffix ``<arch>`` should be a name that you
choose for your system's configuration. There may be multiple
configuration, each with a different set of options and flags selected,
for example: ``setup/Make.mysys1``, ``setup/Make.mysys2``, and so on.
To make the process easier, you may want to re-use one of the example
files already provided in the ``setup`` directory. The ``Make.<arch>``
file contains the command names of the compilers and linkers together
with their options for using special directories and linking with
libraries as well as their paths that are to be used for building the
binary.
The most important variables that need to be set in ``Make.<arch>``
are::
* ``MPdir`` specifies the path to where the MPI installation resides.
For some MPI implementations, using the MPI-enabled compiler (such as
``mpicxx``) is sufficient and it is not required specified any MPI
installation paths. This variable can be used to setup the ``MPinc``
and ``MPlib`` variables.
* ``MPinc`` specifies the paths to include directories with MPI header
files. A common setting here would be ``MPinc = -I$(MPdir)/include``,
provided that the ``MPdir`` variable was set properly.
* ``MPlib`` specifies the path to directories with MPI library files. A
common setting here would be ``MPlib = $(MPdir)/lib``, provided that
the ``MPdir`` variable was set properly.
* ``HPCG_OPTS`` specifies additional compiler options for compiling the
HPCG source files. These options might include optimization,
debugging, or tuning flags.
* ``CXX`` specifies the name of the C++ compiler for compiling the code.
It should be a C++ that supports a subset of STL that is used in HPCG
as well as the subset of constructs used in the MPI standard.
* ``CXXFLAGS`` specifies the flags to be used when invoking the C++
compiler. These might include optimization and profiling options.
* ``LINKER`` specifies the linker capable of linking C++ programs that
include MPI calls.
* ``LINKERFLAGS`` specifies the flags passed to the linker that might
indicate directories where to look for standard C++ and MPI libraries.
HPCG supports in-source and out-of-source builds. In the case of the
former, the object files and the binary reside in the same directory
structure as the source files. There is no need for a separate
configuration step and the reader may skip the the Build section.
In the latter case, a separate directory is created to hold the object
and binary executable files. For example, create a custom directory,
``build`` in this example, for the results of compilation and linking::
mkdir build
Next, go this new directory and use the ``configure`` script to create
the build infrastructure::
cd build
/path/to/hpcg/configure <arch>
Notice that you have to give an absolute or relative path to the
``configure`` shell script so that the location of the source files can
be discovered automatically.
<arch> is the suffix of the setup file you created in the directory
hpcg/setup. Sample setup files are found in the hpcg/setup directory.
----------------------------
Configuration based on CMake
----------------------------
For configuration based on CMake, the compiler and linker are specified
with the CMake-specific flags. Additionally, HPCG-specific options of
interest include::
* ``HPCG_ENABLE_DEBUG`` option enables a build with debugging output
(``OFF`` by default).
* ``HPCG_ENABLE_DETAILED_DEBUG`` option enables a build with detailed
debugging output (``OFF`` by default).
* ``HPCG_ENABLE_MPI`` option enables a build with MPI enabled (``OFF``
by default).
* ``HPCG_ENABLE_LONG_LONG`` option enables a build with ``long long``
type used for global indices (``ON`` by default).
* ``HPCG_ENABLE_OPENMP`` option enables a build with OPENMP enabled
(``OFF`` by default).
There are more options available. Please see the ``CMakeLists.txt`` file
and the ``option()`` commands therein.
These options may be changed with ``ccmake`` command or given directly
to the ``cmake`` invocation with the ``-D`` prefix.
-------------------------------
Configuration based on Autoconf
-------------------------------
It is possible to configure HPCG using Autoconf and Automake (part of
the GNU Autotools collection). In order to generate the configuration
script, use the following command::
autoreconf -ivf
this will overwrite the `configure` script that ships with HPCG. The new
script can then be used through a standard invocation process and
command line options that correspond to the ones available to the CMake
configuration.
=====
Build
=====
For in-source builds, while in the top-level directory, simply type::
make path/to/setup/file
For the out-of-source builds, go to the ``build`` directory and type
``make``.
In both cases, the executable called ``xhpcg`` should be created in the
``bin`` directory.
Building after CMake-based configuration depends on which build tool was
selected with the ``-G`` option.
=============
Example Build
=============
As an example, let's use a Linux cluster and create a file called
``Make.Linux`` in the ``setup`` directory right under the top-level
directory.
For in-source build, we type ``make setup/Make.Linux`` which creates the
executable file called ``bin/xhpcg``.
For out-of-source build, we create the build directory called
``build_Linux`` and go to that directory::
mkdir build_Linux
cd build_Linux
Then, while in the ``build_Linux`` directory we type::
/path/to/hpcg/configure Linux
make
This creates the executable file ``bin/xhpcg``.
====
Test
====
For a quick check, go to the ``bin`` directory and run the HPCG
executable as follows::
mpirun -np 8 xhpcg
Note that this will use the default ``hpcg.dat`` file. If you'd like to
change the size of local dimensions of the problem to ``NX=32``,
``NY=24``, ``NZ=16`` then run the following::
mpirun -np 8 xhpcg 32 24 16
You can also specific size and runtime parameters using ``--nx``,
``--ny``, ``--nz``, ``--rt``. For example, for specifying the local
grid dimensions to be NX=NY=NZ=16, and the timed phase execution limit
of 30 minutes (1800 seconds) you can use
mpirun -np 4 xhpcg --nx=16 --rt=1800
======
Tuning
======
Most of the performance parameters can be tuned by modifying the input
file ``hpcg.dat``. See the file ``TUNING`` in the top-level directory.
====================
Compile Time Options
====================
At the end of the "model" ``Make.<arch>``, the user is given the
opportunity to compile the software with some specific compile options.
The list of this options and their meaning are::
* Compile with modest debugging turned on::
-DHPCG_DEBUG
* Compile with sparse matrix arrays allocated contiguously. This option
may be helpful on systems with pre-fetch::
-DHPCG_CONTIGUOUS_ARRAYS
* Compile with voluminous debugging information turned on::
-DHPCG_DETAILED_DEBUG
* Compile with MPI disabled::
-DHPCG_NO_MPI
* Compile without OpenMP enabled::
-DHPCG_NO_OPENMP
* Enable detail timers::
-DHPCG_DETAILED_TIMING
By default HPCG will::
* Turn on MPI support.
* Turn on OpenMP support.
* not display detailed timing information.
===================
Further information
===================
Check out the website http://hpcg-benchmark.org/ for the latest
information.