You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
40
44
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)
43
47
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.
45
49
46
-
Option 1: Build with GNU Make
47
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
+
Obtaining the Source Code
51
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
48
52
49
-
Navigate to the ``Exec/`` folder of ELEQTRONeX and execute:
53
+
Clone both AMReX and ELEQTRONeX from their respective GitHub repositories:
Ensure both repositories are placed at the same directory level for the build system to locate dependencies correctly.
56
61
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
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
64
59
-
Other flags are explained below, with their default values shown:
65
+
ELEQTRONeX supports both GNU Make and CMake build systems:
60
66
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
68
69
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
- ``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
+
^^^^^^^^^^^^^^^^^^^^^^^
76
77
77
-
Option 2: Build with CMake
78
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
+
For GNU Make builds:
79
79
80
-
ELEQTRONeX also supports building with CMake, which automatically downloads and builds dependencies.
80
+
.. code-block:: bash
81
81
82
-
**Basic CPU build (NOACC backend):**
82
+
cd ELEQTRONeX/Exec/
83
+
make -j4
84
+
85
+
For CMake builds:
83
86
84
87
.. code-block:: bash
85
88
89
+
cd ELEQTRONeX
86
90
cmake -S . -B build
87
91
cmake --build build -j 4
88
92
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.
Configure in GNUmakefile with the following options and their defaults:
143
158
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
- ``#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``.
0 commit comments