ELEQTRONeX
Our community is here to help. Please report installation problems in case you are stuck.
Installation
Quick Start
AMReX and ELEQTRONeX must be cloned in the same directory. Configure preprocessor flags in Source/Code_Definitions.H
before building.
git clone https://github.com/AMReX-Codes/amrex.git
git clone https://github.com/AMReX-Microelectronics/ELEQTRONeX.git
cd ELEQTRONeX/Exec/
make -j4
Detailed Installation Process
Prerequisites and Dependencies
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:
#define NUM_MODES 1
- Sets matrix block size for NEGF (1 for single mode, higher for multi-mode systems)#define NUM_CONTACTS 2
- Sets number of metal leads (currently verified for 2 contacts: source and drain)
For GPU builds, CUDA support is needed, and for parallel execution, MPI libraries (MPICH or OpenMPI) are required.
Obtaining the Source Code
Clone both AMReX and ELEQTRONeX from their respective GitHub repositories:
git clone https://github.com/AMReX-Codes/amrex.git
git clone https://github.com/AMReX-Microelectronics/ELEQTRONeX.git
Ensure both repositories are placed at the same directory level for the build system to locate dependencies correctly.
Understanding the Build System
ELEQTRONeX supports both GNU Make and CMake build systems:
GNU Make: Uses GNUmakefile in the Exec/ directory with various USE_* flags
CMake: Provides automatic dependency management and modern build configuration
Key configuration areas include: - Compute Backend: CPU (NOACC), OpenMP (OMP), CUDA, or HIP - Physics Modules: Embedded boundaries, transport solver (NEGF), time-dependent simulations - Performance Options: MPI support, HYPRE integration, Broyden parallelization
Standard Build Process
For GNU Make builds:
cd ELEQTRONeX/Exec/
make -j4
For CMake builds:
cd ELEQTRONeX
cmake -S . -B build
cmake --build build -j 4
Build Verification
After successful compilation, verify the build by running a test simulation. Also ensure any required preprocessor flags in Source/Code_Definitions.H
are properly configured for your simulation needs.
For detailed instructions on setting up and running ELEQTRONeX simulations, see Run ELEQTRONeX.
Advanced Build Options
Alternative Build Systems
GNU Make with Custom Flags:
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.
CMake with Specific Backends:
OpenMP build:
cmake -S . -B build -DELEQTRONeX_COMPUTE=OMP
cmake --build build -j 4
CUDA build:
cmake -S . -B build -DELEQTRONeX_COMPUTE=CUDA
cmake --build build -j 4
Performance Optimizations
CPU build with embedded boundaries and transport:
cmake -S . -B build \
-DELEQTRONeX_COMPUTE=OMP \
-DELEQTRONeX_EB=ON \
-DELEQTRONeX_TRANSPORT=ON
GPU build with HYPRE support:
cmake -S . -B build \
-DELEQTRONeX_COMPUTE=CUDA \
-DELEQTRONeX_HYPRE=ON
Debug build with printing enabled:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DELEQTRONeX_PRINT_HIGH=ON
Compile-Time Configuration Options
GNU Make Configuration Flags:
Configure in GNUmakefile with the following options and their defaults:
AMREX_HOME ?= ../../amrex
- Specifies the location of the AMReX libraryDEBUG=FALSE
- Sets debug modeUSE_HYPRE=FALSE
- Enable hypre for multigrid bottom solverCOMP=gnu
- Sets GNU compilerDIM=3
- Builds code for 3D domainCXXSTD=c++17
- Sets C++17 for compilationTINY_PROFILE=FALSE
- Enable AMReX profilerUSE_MPI=TRUE
- Enable MPI supportUSE_OMP=FALSE
- Disable OpenMPUSE_CUDA=TRUE
- Activate CUDA support for GPU utilizationUSE_EB=TRUE
- Enable embedded boundariesUSE_TRANSPORT=TRUE
- Enable transport solver (NEGF method)COMPUTE_GREENS_FUNCTION_OFFDIAG_ELEMS=FALSE
- Switch off computations and storage of off-diagonal elements of Green’s functions in NEGF solverCOMPUTE_SPECTRAL_FUNCTION_OFFDIAG_ELEMS=FALSE
- Switch off computations and storage of off-diagonal elements of spectral functions in NEGF solverBROYDEN_PARALLEL=TRUE
- Use efficient parallel version of Broyden’s algorithm for self-consistency between electrostatics and NEGF modulesTIME_DEPENDENT=TRUE
- Build code for accepting voltages on embedded boundaries with varying values
Common CMake Options:
-DELEQTRONeX_COMPUTE=NOACC/OMP/CUDA/HIP
- Computing backend (default: NOACC)-DELEQTRONeX_MPI=ON/OFF
- Multi-node support (default: ON)-DELEQTRONeX_EB=ON/OFF
- Embedded boundary support (default: ON)-DELEQTRONeX_TRANSPORT=ON/OFF
- Transport support (default: ON)-DELEQTRONeX_TIME_DEPENDENT=ON/OFF
- Time-dependent support (default: ON)-DELEQTRONeX_BROYDEN_PARALLEL=ON/OFF
- Broyden parallel support (default: ON)-DELEQTRONeX_HYPRE=ON/OFF
- HYPRE support (default: OFF)
Print Debug Options:
-DELEQTRONeX_PRINT_HIGH=ON/OFF
- High level debug printing (default: OFF)-DELEQTRONeX_PRINT_MEDIUM=ON/OFF
- Medium level debug printing (default: OFF)-DELEQTRONeX_PRINT_LOW=ON/OFF
- Low level debug printing (default: OFF)-DELEQTRONeX_PRINT_NAME=ON/OFF
- Function name debug printing (default: OFF)
Preprocessor Configuration:
Set flags in Source/Code_Definitions.H
before compilation:
#define NUM_MODES 1
- Sets matrix block size for NEGF (1 for single mode, higher for multi-mode systems)#define NUM_CONTACTS 2
- Sets number of metal leads (currently verified for 2 contacts: source and drain)
Advanced Build Examples
CPU build with embedded boundaries and transport:
cmake -S . -B build \
-DELEQTRONeX_COMPUTE=OMP \
-DELEQTRONeX_EB=ON \
-DELEQTRONeX_TRANSPORT=ON
GPU build with HYPRE support:
cmake -S . -B build \
-DELEQTRONeX_COMPUTE=CUDA \
-DELEQTRONeX_HYPRE=ON
Debug build with all print options enabled:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DELEQTRONeX_PRINT_HIGH=ON
Build with local AMReX source (recommended for development):
cmake -S . -B build -DELEQTRONeX_amrex_src=../amrex
cmake --build build -j 4
Build with external AMReX using CMAKE_PREFIX_PATH:
export CMAKE_PREFIX_PATH=/path/to/amrex/install:$CMAKE_PREFIX_PATH
cmake -S . -B build -DELEQTRONeX_amrex_internal=OFF
Platform-Specific Configurations
External AMReX Installation:
cmake -S . -B build \
-DELEQTRONeX_amrex_internal=OFF \
-DAMReX_DIR=/path/to/amrex/lib/cmake/AMReX
Local AMReX Source Directory:
cmake -S . -B build -DELEQTRONeX_amrex_src=/path/to/amrex/source
Custom AMReX Repository/Branch:
cmake -S . -B build \
-DELEQTRONeX_amrex_repo=https://github.com/user/amrex.git \
-DELEQTRONeX_amrex_branch=my_branch
Test with Specific AMReX Pull Request:
cmake -S . -B build -DELEQTRONeX_amrex_pr=1234