Skip to content

Diagonalizer multi gpu.v2 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 55 commits into
base: master.v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5faeace
Added cuda routine to diagonalizer
glaurung24 Jan 25, 2023
1256e4b
Fixed bad memory access bug
glaurung24 Jan 26, 2023
c6b53df
Fixed bug in Diagonalizer.cpp causing wrong result
glaurung24 Jan 26, 2023
34c5ca3
Switched to CUDA unified memory for buffer
glaurung24 Jan 27, 2023
e1d4251
Added test cases+support for nocuda install
glaurung24 Feb 7, 2023
c957862
Tended to compiler warnings including updated json
glaurung24 Feb 7, 2023
7fb1adc
Fixed CMake template to include cusolver library
glaurung24 Feb 7, 2023
2acf5b0
Added GPU specific basis transformation
glaurung24 Feb 9, 2023
25556a0
Added tests for GPU Diagonalizer
glaurung24 Feb 13, 2023
e88a872
Removed compiler warning
glaurung24 Feb 13, 2023
3b08c8b
Set default for gpu acceleration to false
glaurung24 Feb 13, 2023
f00e445
Changed device allocation to unified memory
glaurung24 Feb 13, 2023
cf310e8
Added device memory prefetch prevening page faults
glaurung24 Feb 20, 2023
85c7d1f
Added python 3.10
glaurung24 Feb 21, 2023
28ec73f
Added changable number of significant digits
glaurung24 Apr 26, 2023
7ef8af9
Added GPU support to BlockDiagonalizer, untested
glaurung24 Jul 17, 2023
11ad6ef
Removed uneccesary use of CArray hamiltonian
glaurung24 Jul 17, 2023
57e1bf0
Added test for gpu implementation
glaurung24 Sep 20, 2023
9a00863
Fixed bug caused by wrong block offsets
glaurung24 Sep 20, 2023
542f046
Changed to using device memory exclusively
glaurung24 Sep 20, 2023
915e938
Fixed error in memory calculation
glaurung24 Sep 20, 2023
7d3673b
Fixed exessive memory use of buffer
glaurung24 Sep 20, 2023
5ec475e
Fixed exessive memory use of buffer
glaurung24 Sep 20, 2023
9a5628d
Fixed unnecessary output
glaurung24 Sep 21, 2023
892134d
Enabled parallel execution while using gpu
glaurung24 Sep 21, 2023
de4be07
Allow to run several instances on one gpu
glaurung24 Sep 21, 2023
ba03e48
Fixed bug by reseting ssin
glaurung24 Sep 27, 2023
2a70e2d
Added multiGPU support to Diagonalizer (experimental)
Jan 22, 2024
2de1fc0
Implemented tests for MultiGPU diagonalizer and blockDiagonalizer
glaurung24 Jan 23, 2024
687f2f1
Fixed compilation issues
glaurung24 Jan 23, 2024
dda3c60
Removed bug where only lower part of mat was filled
glaurung24 Jan 23, 2024
1d35727
Moved NVIDIA *util.h files to External and adjusted build
glaurung24 Jan 23, 2024
0c140fa
Added CalculationMode to diagonalizer
glaurung24 Jan 24, 2024
1f6aed5
Put repeated blas calls into one function
glaurung24 Jan 26, 2024
6242ebc
Added safeguard in case only eigenvalues are calculated
glaurung24 Jan 26, 2024
d7891a6
Moving to use lower triangular matrix, test fails
glaurung24 Jan 30, 2024
309ff78
Changed Solver::Diagonalizer to use lower triangular matrix, tests pa…
glaurung24 Jan 30, 2024
03bb68e
Switched to use Solver::Diagonalizers solveCPU instead of Blas zhpev_
glaurung24 Jan 30, 2024
04a237d
Fixed bug that would cause crash in cuSolverMg library
glaurung24 Jan 30, 2024
285d648
Added GPU tests
glaurung24 Jan 30, 2024
702ff9d
Improved error handling
glaurung24 Jan 31, 2024
0e9bbb1
Temporary fix for memory leak in suSolverMg library
glaurung24 Jan 31, 2024
088b6da
Changed to async cudamemcpy for sligthly better performance
glaurung24 Jan 31, 2024
0542232
Added gpu tests
glaurung24 Jan 31, 2024
a10209b
Matrix descriptor not static anymore, allowing to solve different pro…
glaurung24 Feb 5, 2024
7dd92df
Changed to lower triangle
glaurung24 Feb 7, 2024
d6c2cdd
Implemented more robust check to see if eigenvectors are available
glaurung24 Feb 9, 2024
fc8317c
Remove installation problem with cusolverMg
glaurung24 Feb 23, 2024
a2df55b
Made changes that allows copying solver data to new solver
glaurung24 Feb 23, 2024
0962706
Clean up and extra comments
glaurung24 Feb 27, 2024
2dedaaa
Fixed bug were plotter would use arguments not recognized by matplotlib.
glaurung24 Jun 12, 2024
f9164ca
Added check to test if the input hamiltonian is hermitian
glaurung24 Jun 12, 2024
21c4558
Added a recovery option for out of device memory problems
glaurung24 Sep 6, 2024
5cc5759
Cached some calculation results in calculateGreensFunctionCallback() …
glaurung24 Jul 10, 2025
b372f97
Fixed a bug as elements in the precalcuated values were saved in the …
glaurung24 Jul 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMake/Modules/FindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ UNSET(PYTHON_LIBRARIES CACHE)
FIND_PATH(
PYTHON_INCLUDES
NAMES Python.h
PATH_SUFFIXES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
PATH_SUFFIXES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.10 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
)
FIND_LIBRARY(
PYTHON_LIBRARIES
NAMES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
NAMES python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 python3.9 python3.10 python3.0m python3.1m python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m python3.8m python3.9m python3.0d python3.1d python3.2d python3.3d python3.4d python3.5d python3.6d python3.7d python3.8d python3.9d python3.0u python3.1u python3.2u python3.3u python3.4u python3.5u python3.6u python3.7u python3.8u python3.9u
PATH_SUFFIXES lib lib32 lib64
)
IF(("${PYTHON_INCLUDES}" MATCHES "PYTHON_INCLUDES-NOTFOUND") OR ("${PYTHON_LIBRARIES}" MATCHES "PYTHON_LIBRARIES-NOTFOUND"))
Expand Down
3 changes: 3 additions & 0 deletions CMake/TBTKConfigTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ IF(CUDA_FOUND)
TBTK_MESSAGE("[X] CUDA")
LIST(APPEND TBTK_LIBRARIES ${CUDA_LIBRARIES})
LIST(APPEND TBTK_LIBRARIES ${CUDA_cusparse_LIBRARY})
LIST(APPEND TBTK_LIBRARIES ${CUDA_cusolver_LIBRARY})
Find_package(CUDAToolkit QUIET)
LIST(APPEND TBTK_LIBRARIES "${CUDAToolkit_LIBRARY_DIR}/libcusolverMg.so")
ADD_DEFINITIONS(-DTBTK_CUDA_ENABLED)
ELSE(CUDA_FOUND)
TBTK_MESSAGE("[ ] CUDA")
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ ENDIF(ARPACK_FOUND)
IF(CUDA_FOUND)
MESSAGE("[X] CUDA")
ADD_DEFINITIONS(-DTBTK_CUDA_ENABLED)
Find_package(CUDAToolkit QUIET)
LIST(APPEND TBTK_LINK_LIBRARIES "${CUDAToolkit_LIBRARY_DIR}/libcusolverMg.so")
ADD_DEFINITIONS(-DTBTK_CUDA_ENABLED)
ELSE(CUDA_FOUND)
MESSAGE("[ ] CUDA")
ENDIF(CUDA_FOUND)
Expand Down Expand Up @@ -306,7 +309,7 @@ ENDIF(TBTK_ENABLE_ALL_OPTIONS)
MESSAGE("================================================================================")

#C++ flags
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -O3")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -O3")
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand Down Expand Up @@ -387,6 +390,10 @@ IF(${COMPILE_RAY_TRACER})
INCLUDE_DIRECTORIES(Lib/include/RayTracer/)
ENDIF(${COMPILE_RAY_TRACER})

IF(${COMPILE_CUDA})
INCLUDE_DIRECTORIES(External/TBTK/External/NVIDIACuda)
ENDIF(${COMPILE_CUDA})

#Add subdirectory.
ADD_SUBDIRECTORY(Lib/include/)
ADD_SUBDIRECTORY(Lib/src/)
Expand Down
8 changes: 8 additions & 0 deletions External/TBTK/External/NVIDIACuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
IF(CUDA_FOUND)
INSTALL(
DIRECTORY .
DESTINATION include/TBTK/External/NVIDIACuda
FILES_MATCHING PATTERN cusolver_utils.h
FILES_MATCHING PATTERN cusolverMg_utils.h
)
ENDIF(CUDA_FOUND)
Loading