blob: 39a57d0b212986da93d03c092b1a23c9b71f8c85 (
plain) (
blame)
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
|
Installation
============
Downloading the code
~~~~~~~~~~~~~~~~~~~~
You should clone the source codes of AMReX, PICSAR and WarpX into one
single directory (e.g. ``warpx_directory``):
::
mkdir warpx_directory
cd warpx_directory
git clone https://bitbucket.org/berkeleylab/amrex.git
git clone https://bitbucket.org/berkeleylab/picsar.git
git clone https://github.com/AMReX-Codes/amrex.git
You should then switch to the branch ``development`` of AMReX
::
cd amrex/
git checkout development
cd ..
Compiling WarpX as an executable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``cd`` into the directory ``warpx`` and type
::
make -j 4
This will generate an executable file in the ``Bin`` directory.
.. note::
The compilation options are set in the file ``GNUmakefile``. The default
options correspond to an optimized code for 3D geometry. You can modify the
options in this file in order to (for instance):
* Use 2D geometry
* Disable OpenMP
* Profile or debug the code
* Choose a given compiler
For a description of these different options, see the `corresponding page
<https://amrex-codes.github.io/amrex/BuildingAMReX.html#building-with-gnu-make>`__ in
the AMReX documentation.
Alternatively, instead of modifying the file ``GNUmakefile``, you can
directly pass the options in command line ; for instance:
::
make -j 4 USE_OMP=FALSE
In order to clean a previously compiled version:
::
make realclean
In order to learn how to use the executable, see the section :doc:`running_cpp/running_cpp`.
Compiling WarpX as a Python package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``cd`` into the directory ``warpx/Python`` (instead of ``warpx``
in the previous section) and type
::
make -j 4
This will compile the code, and install the Python bindings as a package (named
``pywarpx``) in your standard Python installation (i.e. in your
``site-packages`` directory). The note on compiler options from the previous
section also hold when compiling the Python package.
In order to learn how to use the Python package, see the section :doc:`running_python/running_python`.
Compiling WarpX for Cori
~~~~~~~~~~~~~~~~~~~~~~~~
For the `Cori cluster
<http://www.nersc.gov/users/computational-systems/cori/>`__ at NERSC,
you need to type the following command when compiling:
In order to compile for the **Haswell architecture**:
* with the Intel compiler
::
make -j 16 COMP=intel
* with the GNU compiler
::
module swap PrgEnv-intel PrgEnv-gnu
make -j 16 COMP=gnu
In order to compile for the **Knight's Landing (KNL) architecture**:
* with the Intel compiler
::
module swap craype-haswell craype-mic-knl
make -j 16 COMP=intel
* with the GNU compiler
::
module swap craype-haswell craype-mic-knl
module swap PrgEnv-intel PrgEnv-gnu
make -j 16 COMP=gnu
|