Skip to content

Commit 1d9a54b

Browse files
committed
Update strucutre
1 parent 8e2b7be commit 1d9a54b

1 file changed

Lines changed: 152 additions & 80 deletions

File tree

Docs/source/install/eleqtroneX.rst

Lines changed: 152 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -19,137 +19,188 @@ ELEQTRONeX
1919
Our community is here to help.
2020
Please `report installation problems <https://github.com/AMReX-Microelectronics/ELEQTRONeX/issues/new>`_ in case you are stuck.
2121

22-
Follow these instructions for compilation.
22+
Installation
23+
------------
2324

24-
1. Download
25-
-----------
25+
Quick Start
26+
~~~~~~~~~~~
2627

27-
To download the codes in your local linux system or on a specific high-performance computing (HPC) system:
28-
29-
Download AMReX Repository as
28+
AMReX and ELEQTRONeX must be cloned in the same directory. Configure preprocessor flags in ``Source/Code_Definitions.H`` before building.
3029

3130
.. code-block:: bash
32-
31+
3332
git clone https://github.com/AMReX-Codes/amrex.git
33+
git clone https://github.com/AMReX-Microelectronics/ELEQTRONeX.git
34+
cd ELEQTRONeX/Exec/
35+
make -j4
3436
35-
Download ELEQTRONeX Repository in the folder hierarchy level as AMReX as
37+
Detailed Installation Process
38+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3639

37-
.. code-block:: bash
40+
Prerequisites and Dependencies
41+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3842

39-
git clone https://github.com/AMReX-Microelectronics/ELEQTRONeX.git
43+
ELEQTRONeX requires AMReX as its core dependency for adaptive mesh refinement capabilities. The software also requires appropriate preprocessor flag configuration in ``Source/Code_Definitions.H`` before compilation:
4044

41-
2. Build Parameters
42-
-------------------
45+
- ``#define NUM_MODES 1`` - Sets matrix block size for NEGF (1 for single mode, higher for multi-mode systems)
46+
- ``#define NUM_CONTACTS 2`` - Sets number of metal leads (currently verified for 2 contacts: source and drain)
4347

44-
ELEQTRONeX supports both GNU Make and CMake build systems with various configuration options.
48+
For GPU builds, CUDA support is needed, and for parallel execution, MPI libraries (MPICH or OpenMPI) are required.
4549

46-
Option 1: Build with GNU Make
47-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
Obtaining the Source Code
51+
^^^^^^^^^^^^^^^^^^^^^^^^^^
4852

49-
Navigate to the ``Exec/`` folder of ELEQTRONeX and execute:
53+
Clone both AMReX and ELEQTRONeX from their respective GitHub repositories:
5054

5155
.. code-block:: bash
5256
53-
make -j4
57+
git clone https://github.com/AMReX-Codes/amrex.git
58+
git clone https://github.com/AMReX-Microelectronics/ELEQTRONeX.git
5459
55-
**Basic GNU Make configuration:**
60+
Ensure both repositories are placed at the same directory level for the build system to locate dependencies correctly.
5661

57-
To build with MPI and CUDA, ensure that either MPICH or OpenMPI, along with the appropriate CUDA modules, are installed and loaded. In the ``GNUmakefile`` located in the ``Exec/`` directory, set ``USE_MPI=TRUE`` to enable MPI support, ``USE_OMP=FALSE`` to disable OpenMP, and ``USE_CUDA=TRUE`` to activate CUDA support for GPU utilization.
62+
Understanding the Build System
63+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5864

59-
Other flags are explained below, with their default values shown:
65+
ELEQTRONeX supports both GNU Make and CMake build systems:
6066

61-
- ``AMREX_HOME ?= ../../amrex`` specifies the location of the AMReX library.
62-
- ``DEBUG=FALSE`` sets the debug mode.
63-
- ``USE_HYPRE=FALSE`` can be used to set ``hypre`` for the multigrid bottom solver. Installation instructions for ``hypre`` are provided `here <https://amrex-codes.github.io/amrex/tutorials_html/Hypre_Install.html>`_.
64-
- ``COMP=gnu`` sets the GNU compiler.
65-
- ``DIM=3`` builds the code for 3D domain.
66-
- ``CXXSTD=c++17`` sets C++17 for compilation.
67-
- ``TINY_PROFILE=FALSE`` is used to enable the AMReX profiler.
67+
- **GNU Make**: Uses GNUmakefile in the Exec/ directory with various USE_* flags
68+
- **CMake**: Provides automatic dependency management and modern build configuration
6869

69-
Set the following flags based on your configuration needs:
70+
Key configuration areas include:
71+
- **Compute Backend**: CPU (NOACC), OpenMP (OMP), CUDA, or HIP
72+
- **Physics Modules**: Embedded boundaries, transport solver (NEGF), time-dependent simulations
73+
- **Performance Options**: MPI support, HYPRE integration, Broyden parallelization
7074

71-
- ``USE_EB=TRUE`` if the input file sets embedded boundaries.
72-
- ``USE_TRANSPORT=TRUE`` for enabling the transport solver, which uses the nonequilibrium Green's function (NEGF) method.
73-
- ``COMPUTE_GREENS_FUNCTION_OFFDIAG_ELEMS=FALSE`` and ``COMPUTE_SPECTRAL_FUNCTION_OFFDIAG_ELEMS=FALSE`` to switch off computations and storage of off-diagonal elements of Green's and spectral functions in the NEGF solver.
74-
- ``BROYDEN_PARALLEL=TRUE`` uses an efficient parallel version of the Broyden's algorithm for self-consistency between electrostatics and NEGF modules.
75-
- ``TIME_DEPENDENT=TRUE`` builds the code for accepting voltages on the embedded boundaries with varying values, for example setting a range of values to obtain full current-voltage characteristics.
75+
Standard Build Process
76+
^^^^^^^^^^^^^^^^^^^^^^^
7677

77-
Option 2: Build with CMake
78-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
For GNU Make builds:
7979

80-
ELEQTRONeX also supports building with CMake, which automatically downloads and builds dependencies.
80+
.. code-block:: bash
8181
82-
**Basic CPU build (NOACC backend):**
82+
cd ELEQTRONeX/Exec/
83+
make -j4
84+
85+
For CMake builds:
8386

8487
.. code-block:: bash
8588
89+
cd ELEQTRONeX
8690
cmake -S . -B build
8791
cmake --build build -j 4
8892
89-
**OpenMP build:**
93+
Build Verification
94+
^^^^^^^^^^^^^^^^^^
95+
96+
After successful compilation, verify the build by checking that the executable was created and can display help information. Also ensure any required preprocessor flags in ``Source/Code_Definitions.H`` are properly configured for your simulation needs.
97+
98+
Advanced Build Options
99+
-----------------------
100+
101+
Alternative Build Systems
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
104+
**GNU Make with Custom Flags:**
105+
106+
To build with MPI and CUDA, ensure that either MPICH or OpenMPI, along with the appropriate CUDA modules, are installed and loaded. Configure in the GNUmakefile located in the Exec/ directory by setting the appropriate USE_* flags as described in the Compile-Time Configuration Options section.
107+
108+
**CMake with Specific Backends:**
109+
110+
OpenMP build:
90111

91112
.. code-block:: bash
92113
93114
cmake -S . -B build -DELEQTRONeX_COMPUTE=OMP
94115
cmake --build build -j 4
95116
96-
**CUDA build:**
117+
CUDA build:
97118

98119
.. code-block:: bash
99120
100121
cmake -S . -B build -DELEQTRONeX_COMPUTE=CUDA
101122
cmake --build build -j 4
102123
103-
**Core CMake Configuration Options:**
104-
105-
- ``-DELEQTRONeX_COMPUTE=NOACC/OMP/CUDA/HIP`` - Computing backend (default: NOACC)
106-
- ``-DELEQTRONeX_MPI=ON/OFF`` - Multi-node support (default: ON)
107-
- ``-DELEQTRONeX_EB=ON/OFF`` - Embedded boundary support (default: ON)
108-
- ``-DELEQTRONeX_TRANSPORT=ON/OFF`` - Transport support (default: ON)
109-
- ``-DELEQTRONeX_TIME_DEPENDENT=ON/OFF`` - Time-dependent support (default: ON)
110-
- ``-DELEQTRONeX_BROYDEN_PARALLEL=ON/OFF`` - Broyden parallel support (default: ON)
111-
- ``-DELEQTRONeX_HYPRE=ON/OFF`` - HYPRE support (default: OFF)
124+
Performance Optimizations
125+
~~~~~~~~~~~~~~~~~~~~~~~~~~
112126

113-
**Print Debug Options:**
127+
**CPU build with embedded boundaries and transport:**
114128

115-
- ``-DELEQTRONeX_PRINT_HIGH=ON/OFF`` - High level debug printing (default: OFF)
116-
- ``-DELEQTRONeX_PRINT_MEDIUM=ON/OFF`` - Medium level debug printing (default: OFF)
117-
- ``-DELEQTRONeX_PRINT_LOW=ON/OFF`` - Low level debug printing (default: OFF)
118-
- ``-DELEQTRONeX_PRINT_NAME=ON/OFF`` - Function name debug printing (default: OFF)
129+
.. code-block:: bash
119130
120-
**AMReX Configuration Options:**
131+
cmake -S . -B build \
132+
-DELEQTRONeX_COMPUTE=OMP \
133+
-DELEQTRONeX_EB=ON \
134+
-DELEQTRONeX_TRANSPORT=ON
121135
122-
Use external AMReX installation:
136+
**GPU build with HYPRE support:**
123137

124138
.. code-block:: bash
125139
126140
cmake -S . -B build \
127-
-DELEQTRONeX_amrex_internal=OFF \
128-
-DAMReX_DIR=/path/to/amrex/lib/cmake/AMReX
141+
-DELEQTRONeX_COMPUTE=CUDA \
142+
-DELEQTRONeX_HYPRE=ON
129143
130-
Use local AMReX source directory:
144+
**Debug build with printing enabled:**
131145

132146
.. code-block:: bash
133147
134-
cmake -S . -B build -DELEQTRONeX_amrex_src=/path/to/amrex/source
148+
cmake -S . -B build \
149+
-DCMAKE_BUILD_TYPE=Debug \
150+
-DELEQTRONeX_PRINT_HIGH=ON
135151
136-
Use custom AMReX repository/branch:
152+
Compile-Time Configuration Options
153+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137154

138-
.. code-block:: bash
155+
**GNU Make Configuration Flags:**
139156

140-
cmake -S . -B build \
141-
-DELEQTRONeX_amrex_repo=https://github.com/user/amrex.git \
142-
-DELEQTRONeX_amrex_branch=my_branch
157+
Configure in GNUmakefile with the following options and their defaults:
143158

144-
Test with specific AMReX pull request:
159+
- ``AMREX_HOME ?= ../../amrex`` - Specifies the location of the AMReX library
160+
- ``DEBUG=FALSE`` - Sets debug mode
161+
- ``USE_HYPRE=FALSE`` - Enable hypre for multigrid bottom solver
162+
- ``COMP=gnu`` - Sets GNU compiler
163+
- ``DIM=3`` - Builds code for 3D domain
164+
- ``CXXSTD=c++17`` - Sets C++17 for compilation
165+
- ``TINY_PROFILE=FALSE`` - Enable AMReX profiler
166+
- ``USE_MPI=TRUE`` - Enable MPI support
167+
- ``USE_OMP=FALSE`` - Disable OpenMP
168+
- ``USE_CUDA=TRUE`` - Activate CUDA support for GPU utilization
169+
- ``USE_EB=TRUE`` - Enable embedded boundaries
170+
- ``USE_TRANSPORT=TRUE`` - Enable transport solver (NEGF method)
171+
- ``COMPUTE_GREENS_FUNCTION_OFFDIAG_ELEMS=FALSE`` - Switch off computations and storage of off-diagonal elements of Green's functions in NEGF solver
172+
- ``COMPUTE_SPECTRAL_FUNCTION_OFFDIAG_ELEMS=FALSE`` - Switch off computations and storage of off-diagonal elements of spectral functions in NEGF solver
173+
- ``BROYDEN_PARALLEL=TRUE`` - Use efficient parallel version of Broyden's algorithm for self-consistency between electrostatics and NEGF modules
174+
- ``TIME_DEPENDENT=TRUE`` - Build code for accepting voltages on embedded boundaries with varying values
145175

146-
.. code-block:: bash
176+
**Common CMake Options:**
147177

148-
cmake -S . -B build -DELEQTRONeX_amrex_pr=1234
178+
- ``-DELEQTRONeX_COMPUTE=NOACC/OMP/CUDA/HIP`` - Computing backend (default: NOACC)
179+
- ``-DELEQTRONeX_MPI=ON/OFF`` - Multi-node support (default: ON)
180+
- ``-DELEQTRONeX_EB=ON/OFF`` - Embedded boundary support (default: ON)
181+
- ``-DELEQTRONeX_TRANSPORT=ON/OFF`` - Transport support (default: ON)
182+
- ``-DELEQTRONeX_TIME_DEPENDENT=ON/OFF`` - Time-dependent support (default: ON)
183+
- ``-DELEQTRONeX_BROYDEN_PARALLEL=ON/OFF`` - Broyden parallel support (default: ON)
184+
- ``-DELEQTRONeX_HYPRE=ON/OFF`` - HYPRE support (default: OFF)
185+
186+
**Print Debug Options:**
187+
188+
- ``-DELEQTRONeX_PRINT_HIGH=ON/OFF`` - High level debug printing (default: OFF)
189+
- ``-DELEQTRONeX_PRINT_MEDIUM=ON/OFF`` - Medium level debug printing (default: OFF)
190+
- ``-DELEQTRONeX_PRINT_LOW=ON/OFF`` - Low level debug printing (default: OFF)
191+
- ``-DELEQTRONeX_PRINT_NAME=ON/OFF`` - Function name debug printing (default: OFF)
192+
193+
**Preprocessor Configuration:**
194+
195+
Set flags in ``Source/Code_Definitions.H`` before compilation:
149196

150-
**Advanced Build Examples:**
197+
- ``#define NUM_MODES 1`` - Sets matrix block size for NEGF (1 for single mode, higher for multi-mode systems)
198+
- ``#define NUM_CONTACTS 2`` - Sets number of metal leads (currently verified for 2 contacts: source and drain)
151199

152-
CPU build with embedded boundaries and transport:
200+
Advanced Build Examples
201+
~~~~~~~~~~~~~~~~~~~~~~~
202+
203+
**CPU build with embedded boundaries and transport:**
153204

154205
.. code-block:: bash
155206
@@ -158,43 +209,64 @@ CPU build with embedded boundaries and transport:
158209
-DELEQTRONeX_EB=ON \
159210
-DELEQTRONeX_TRANSPORT=ON
160211
161-
GPU build with HYPRE support:
212+
**GPU build with HYPRE support:**
162213

163214
.. code-block:: bash
164215
165216
cmake -S . -B build \
166217
-DELEQTRONeX_COMPUTE=CUDA \
167218
-DELEQTRONeX_HYPRE=ON
168219
169-
Debug build with all print options enabled:
220+
**Debug build with all print options enabled:**
170221

171222
.. code-block:: bash
172223
173224
cmake -S . -B build \
174225
-DCMAKE_BUILD_TYPE=Debug \
175226
-DELEQTRONeX_PRINT_HIGH=ON
176227
177-
Build with local AMReX source (recommended for development):
228+
**Build with local AMReX source (recommended for development):**
178229

179230
.. code-block:: bash
180231
181232
cmake -S . -B build -DELEQTRONeX_amrex_src=../amrex
182233
cmake --build build -j 4
183234
184-
Build with external AMReX using CMAKE_PREFIX_PATH:
235+
**Build with external AMReX using CMAKE_PREFIX_PATH:**
185236

186237
.. code-block:: bash
187238
188239
export CMAKE_PREFIX_PATH=/path/to/amrex/install:$CMAKE_PREFIX_PATH
189240
cmake -S . -B build -DELEQTRONeX_amrex_internal=OFF
190241
191-
3. Preprocessor Flags
192-
---------------------
193-
Set preprocessor flags in the ``../Source/Code_Definitions.H`` file before compiling the code, depending on your configuration needs.
242+
Platform-Specific Configurations
243+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
244+
245+
**External AMReX Installation:**
246+
247+
.. code-block:: bash
248+
249+
cmake -S . -B build \
250+
-DELEQTRONeX_amrex_internal=OFF \
251+
-DAMReX_DIR=/path/to/amrex/lib/cmake/AMReX
252+
253+
**Local AMReX Source Directory:**
194254

195-
The important ones are:
255+
.. code-block:: bash
256+
257+
cmake -S . -B build -DELEQTRONeX_amrex_src=/path/to/amrex/source
196258
197-
- ``#define NUM_MODES 1`` sets the size of block for each matrix element used in NEGF.
198-
For example, for modeling carbon nanotubes with single mode using mode-space approximation, NUM_MODES is set to 1, which implies each element of Hamiltonian matrix is a number. If it were 2, it would be an array of size 2. For other materials, this number may set the matrix block as a submatrix of size ``NUM_MODES x NUM_MODES``.
259+
**Custom AMReX Repository/Branch:**
260+
261+
.. code-block:: bash
262+
263+
cmake -S . -B build \
264+
-DELEQTRONeX_amrex_repo=https://github.com/user/amrex.git \
265+
-DELEQTRONeX_amrex_branch=my_branch
266+
267+
**Test with Specific AMReX Pull Request:**
268+
269+
.. code-block:: bash
270+
271+
cmake -S . -B build -DELEQTRONeX_amrex_pr=1234
199272
200-
- ``#define NUM_CONTACTS 2`` sets number of metal leads to 2 for source and drain. At present, the code is verified for 2 leads.

0 commit comments

Comments
 (0)