-
Notifications
You must be signed in to change notification settings - Fork 4
Refactoring GMGPolar #65
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
Merged
Merged
Changes from all commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
b05953f
Removed unnecessary files
6374ec3
Added scripts
58d31fe
Updated third-party folder
67ba907
Updated Google Tests
9fd06b9
Improved InputFunctions - TestCases
d11b14b
Updated Utilities
6ea3568
New GMGPolar class
8a2ec45
Linear Algebra & Solvers
bef5fd4
New PolarGrid class
ec142fc
New Level class
fe8dc7d
New Interpolation class
5b9c151
New DirectSolver class
d26435e
New Residual class
bf07e52
New Smoother class
7d7bbba
Performance Improvements
152bd6d
Small changes
7a1627e
Performance Improvements
670a77d
FMG Interplation
5536113
FMG Interpolation for anisotropic meshes
8c86b46
Added Take Implementation
0f7617c
Bug fixes
80e576a
Added README.md Documentation
198677f
Stop tracking .vscode folder
0d19552
Stopped tracking Output files
42499cb
Added Convergence Order Script
43cc7f5
Minor Updates
2b7e627
Test
1639964
Removed main2.cpp
48a4765
Readme improvements
e3c8bc7
Improvedscripts
12a5554
Adjusted run.sh
12178a6
Improved formatting
842c9bb
Improved Scripts
4b09beb
Add modified files and new untracked files
344d8bd
Update Images
a67bf00
Comparison to Version 1.0
bae3aaa
Removed unused file
9e2e521
Apply formatting to all files and delete 70 MB of example_data
aa75f0f
Update symmetricTridiagonalSolver.h
julianlitz dc0a7b6
Improved clang-format issues.
7274612
ABug fix and formatting improvements
e618a3c
Update README.md
julianlitz 883f416
Update README.md
julianlitz c7fb3c1
Update README.md
julianlitz 32ed9de
Update README.md
julianlitz 8a07d02
Update README.md
julianlitz bbd918b
Update README.md
julianlitz 0c06157
Update README.md
julianlitz babb85e
Update README.md
julianlitz 34f4b05
Update README.md
julianlitz 44d8a8e
Update README.md
julianlitz 7718842
Update README.md
julianlitz 0c9c3eb
Update README.md
julianlitz 2107722
Update README.md
julianlitz 70283a4
Update README.md
julianlitz ce5efde
StencilType: Implemented suggested changes from review (discussion_r1…
daac90e
Stencil Comment: Implemented suggested changes from review (discussio…
09ba718
Level depth: Implemented suggested changes from review (discussion_r1…
48392b9
InPlace Comment: Implemented suggested changes from review (discussio…
1d9f6aa
InPlace Comment: Implemented suggested changes from review (discussio…
12a6d06
Unreachable Statement: Implemented suggested changes from review (dis…
a64f91d
Constant definitions: Implemented suggested changes from review (disc…
2556633
Workflow Testing
8de6038
Workflow Testing
d368f19
Workflow Testing
633ad80
Update
41e2247
Level Comments
c8410ff
Norm Comment
65e1ca4
DirectSolver Comments
377bd5c
BitShiftOperators Removed
328c1a9
TridiagonalSolver comments
5314e92
TridiagonalSolver comments
891468c
TridiagonalSolver comments
4373411
PolarGrid Comments
58e2396
merge main, remove test cases in old location
50aa438
PolarGrid Comments
a2a34cb
FMG_Interpolation Comments
af588ed
FMG_Interpolation Comments
c4cd3fb
Stencil Comments
33eac0f
Update level.h
julianlitz bfe58f0
Test
f020a58
Smoothing Removed in-place name
0befa4d
Custom LU Solver
7e78133
Mumps Indexing Improved
8136511
Added comments
8c6e608
smoother improvements
2e74600
various code improvements and comments
4678965
Replaced Jacobian Macro by inlined Function
33db84b
Improved Macros
2f9b2bc
Independent of MUMPS
b672d47
Improved Readme
8e67740
Reduced Coce Rerepetition
7204c09
Header improvemenets
3688aed
Remove all images
6853f97
Code Formatting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mknaranja marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,121 +1,130 @@ | ||
| cmake_minimum_required(VERSION 3.16.3) | ||
|
|
||
| project(GMGPolar VERSION 1.0.0) | ||
| cmake_minimum_required(VERSION 3.12) | ||
| project(GMGPolar VERSION 2.0.0 LANGUAGES CXX) | ||
|
|
||
| option(GMGPOLAR_BUILD_TESTS "Build GMGPolar unit tests." ON) | ||
| option(GMGPOLAR_USE_MUMPS "Use MUMPS to compute matrix factorizations." OFF) | ||
| option(GMGPOLAR_USE_LIKWID "Use LIKWID to measure code (regions)." OFF) | ||
| option(GMGPOLAR_USE_MUMPS "Use MUMPS to solve linear systems." OFF) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
|
|
||
| set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
| set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
|
||
| set(CMAKE_CXX_FLAGS "") | ||
| set(CMAKE_LINKER_FLAGS "") | ||
|
|
||
| add_subdirectory(src) | ||
|
|
||
| # code coverage analysis | ||
| # Note: this only works under linux and with make | ||
| # Ninja creates different directory names which do not work together with this scrupt | ||
| # as STREQUAL is case-sensitive https://github.com/TriBITSPub/TriBITS/issues/131, also allow DEBUG as accepted input | ||
| option(GMGPOLAR_TEST_COVERAGE "Enable GCov coverage analysis (adds a 'coverage' target)" OFF) | ||
|
|
||
| if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG") | ||
| if(GMGPOLAR_TEST_COVERAGE) | ||
| message(STATUS "Coverage enabled") | ||
| include(CodeCoverage) | ||
| append_coverage_compiler_flags() | ||
| setup_target_for_coverage_lcov( | ||
| NAME coverage | ||
| EXECUTABLE tests/gmgpolar_tests | ||
| EXCLUDE "${CMAKE_SOURCE_DIR}/tests*" "${CMAKE_SOURCE_DIR}/src/test_cases*" "${CMAKE_BINARY_DIR}/*" "/usr*" | ||
| ) | ||
| endif() | ||
| if(NOT CMAKE_BUILD_TYPE) | ||
| set(CMAKE_BUILD_TYPE Release) | ||
| endif() | ||
|
|
||
|
|
||
| add_library(GMGPolar ${SOURCES_SRC}) | ||
|
|
||
| add_executable(gmgpolar_simulation ./src/main.cpp) | ||
|
|
||
| configure_file(${CMAKE_SOURCE_DIR}/include/config_internal.h.in ${CMAKE_SOURCE_DIR}/include/config_internal.h) | ||
|
|
||
| target_include_directories(gmgpolar_simulation PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases ) | ||
| target_include_directories(GMGPolar PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases ) | ||
|
|
||
| set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wno-unused") | ||
| set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -mtune=generic") | ||
|
|
||
| # # Mumps: Sparse Matrix Solver | ||
| # set(MUMPS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/mumps-5.6.2-m4xrhc4mshzrxmgptzbpult3nbf6qrzk") | ||
| # include_directories(${MUMPS_PREFIX_PATH}/include) | ||
| # link_directories(${MUMPS_PREFIX_PATH}/lib) | ||
|
|
||
| # # Metis: Matrix reordering for Mumps | ||
| # set(METIS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/metis-5.1.0-bgoncx22w55soviybggl5ydjakvkm34v") | ||
| # include_directories(${METIS_PREFIX_PATH}/include) | ||
| # link_directories(${METIS_PREFIX_PATH}/lib) | ||
|
|
||
| # # Likwid: Performance monitoring | ||
| # set(LIKWID_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/likwid-5.3.0-6mvx2snsqnamuyhaqspd6gxkfuaso36g") | ||
| # include_directories(${LIKWID_PREFIX_PATH}/include) | ||
| # link_directories(${LIKWID_PREFIX_PATH}/lib) | ||
|
|
||
| # Include directories for the project | ||
| include_directories(include) | ||
|
|
||
| # 1. Create a library target for the PolarGrid module | ||
| file(GLOB_RECURSE POLAR_GRID_SOURCES "src/PolarGrid/*.cpp") | ||
| add_library(PolarGrid STATIC ${POLAR_GRID_SOURCES}) | ||
| target_include_directories(PolarGrid PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/PolarGrid) | ||
|
|
||
| # 2. Create a library target for the InputFunctions module | ||
| file(GLOB_RECURSE INPUT_FUNCTIONS_SOURCES | ||
| "src/InputFunctions/DensityProfileCoefficients/*.cpp" | ||
| "src/InputFunctions/DomainGeometry/*.cpp" | ||
| "src/InputFunctions/ExactSolution/*.cpp" | ||
| "src/InputFunctions/BoundaryConditions/*.cpp" | ||
| "src/InputFunctions/SourceTerms/*.cpp" | ||
| ) | ||
| add_library(InputFunctions STATIC ${INPUT_FUNCTIONS_SOURCES}) | ||
| target_include_directories(InputFunctions PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/InputFunctions) | ||
|
|
||
| # 3. Collect all the common source files for GMGPolar into a library | ||
| file(GLOB_RECURSE GMG_POLAR_SOURCES "src/GMGPolar/*.cpp") | ||
| file(GLOB_RECURSE MULTIGRID_METHODS_SOURCES "src/GMGPolar/MultigridMethods/*.cpp") | ||
| file(GLOB_RECURSE LEVEL_SOURCES "src/Level/*.cpp") | ||
| file(GLOB_RECURSE STENCIL_SOURCES "src/Stencil/*.cpp") | ||
| file(GLOB_RECURSE INTERPOLATION_SOURCES "src/Interpolation/*.cpp") | ||
| file(GLOB_RECURSE DIRECT_SOLVER_SOURCES "src/DirectSolver/*.cpp" "src/DirectSolverGive/*.cpp" "src/DirectSolverTake/*.cpp" "src/DirectSolverGiveCustomLU/*.cpp" "src/DirectSolverTakeCustomLU/*.cpp") | ||
| file(GLOB_RECURSE RESIDUAL_SOURCES "src/Residual/*.cpp" "src/Residual/ResidualGive/*.cpp" "src/Residual/ResidualTake/*.cpp") | ||
| file(GLOB_RECURSE SMOOTHER_SOURCES "src/Smoother/*.cpp" "src/SmootherGive/*.cpp" "src/SmootherTake/*.cpp") | ||
| file(GLOB_RECURSE EXTRAPOLATED_SMOOTHER_SOURCES "src/ExtrapolatedSmoother/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/*.cpp") | ||
|
|
||
| # 4. Create the GMGPolarLib library and link PolarGrid and InputFunctions | ||
| add_library(GMGPolarLib STATIC | ||
| ${GMG_POLAR_SOURCES} | ||
| ${MULTIGRID_METHODS_SOURCES} | ||
| ${LEVEL_SOURCES} | ||
| ${STENCIL_SOURCES} | ||
| ${INTERPOLATION_SOURCES} | ||
| ${DIRECT_SOLVER_SOURCES} | ||
| ${RESIDUAL_SOURCES} | ||
| ${SMOOTHER_SOURCES} | ||
| ${EXTRAPOLATED_SMOOTHER_SOURCES} | ||
| ) | ||
| # Link PolarGrid and InputFunctions to GMGPolarLib | ||
| target_link_libraries(GMGPolarLib PUBLIC PolarGrid InputFunctions) | ||
|
|
||
| # Link Likwid to GMGPolarLib | ||
| if(GMGPOLAR_USE_LIKWID) | ||
|
|
||
| find_package(LIKWID REQUIRED) | ||
|
|
||
| target_include_directories(GMGPolar PUBLIC ${LIKWID_INCLUDE_DIRS}) | ||
| target_link_libraries(GMGPolar PUBLIC ${LIKWID_LIBRARIES}) | ||
| target_compile_definitions(GMGPolar PUBLIC "-DLIKWID_PERFMON") | ||
|
|
||
| target_link_libraries(GMGPolarLib PUBLIC likwid) | ||
| target_compile_definitions(GMGPolarLib PUBLIC "-DLIKWID_PERFMON") | ||
| add_compile_definitions(GMGPOLAR_USE_LIKWID) | ||
| endif() | ||
|
|
||
|
|
||
|
|
||
| # Link Mumps to GMGPolarLib | ||
| if(GMGPOLAR_USE_MUMPS) | ||
|
|
||
| set(INC_DIRS | ||
| /home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/include | ||
| /sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/include | ||
| ) | ||
|
|
||
| set(LIB_DIRS | ||
| /home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/lib | ||
| /sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/lib | ||
| ) | ||
|
|
||
| include_directories( | ||
| ${INC_DIRS} | ||
| ) | ||
|
|
||
| target_link_directories( | ||
| GMGPolar | ||
| PUBLIC | ||
| ${LIB_DIRS} | ||
| ) | ||
|
|
||
| set(LIBS | ||
| mpiseq | ||
| dmumps | ||
| set(MUMPS_LIBRARIES | ||
| mumps_common | ||
| smumps | ||
| dmumps | ||
| mpiseq | ||
| metis | ||
| ) | ||
|
|
||
| target_link_libraries( | ||
| GMGPolar | ||
| PUBLIC | ||
| ${LIBS} | ||
| ) | ||
| target_link_libraries(GMGPolarLib PUBLIC ${MUMPS_LIBRARIES}) | ||
| add_compile_definitions(GMGPOLAR_USE_MUMPS) | ||
| endif() | ||
|
|
||
|
|
||
| find_package(OpenMP) | ||
|
|
||
| #currently works on GNU compiler | ||
| if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7)) | ||
|
|
||
| string(APPEND CMAKE_CXX_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings") | ||
| string(APPEND CMAKE_LINKER_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings") | ||
|
|
||
| if(OPENMP_FOUND) | ||
| string(APPEND CMAKE_CXX_FLAGS " -fopenmp") | ||
| string(APPEND CMAKE_LINKER_FLAGS " -fopenmp") | ||
|
|
||
| else() | ||
| message(FATAL_ERROR "OpenMP needed") | ||
| endif() | ||
| else() | ||
| message(FATAL_ERROR "Please use GNU compiler or change CMakeLists manually") | ||
| # Add OpenMP flags if available and link to GMGPolarLib | ||
| find_package(OpenMP REQUIRED) | ||
| if(OpenMP_CXX_FOUND) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
| target_link_libraries(GMGPolarLib PUBLIC OpenMP::OpenMP_CXX) | ||
| endif() | ||
|
|
||
| # 5. Add the main executable target (gmgpolar) | ||
| set(MAIN_SOURCE "src/main.cpp") | ||
| add_executable(gmgpolar ${MAIN_SOURCE}) | ||
|
|
||
| # 6. Add another executable target (convergence_order) | ||
| set(CONVERGENCE_ORDER_SOURCE "src/convergence_order.cpp") | ||
| add_executable(convergence_order ${CONVERGENCE_ORDER_SOURCE}) | ||
|
|
||
| target_link_libraries(gmgpolar_simulation PRIVATE GMGPolar) | ||
| set(WEAK_SCALING_SOURCE "src/weak_scaling.cpp") | ||
| add_executable(weak_scaling ${WEAK_SCALING_SOURCE}) | ||
|
|
||
| set(STRONG_SCALING_SOURCE "src/strong_scaling.cpp") | ||
| add_executable(strong_scaling ${STRONG_SCALING_SOURCE}) | ||
|
|
||
| include(thirdparty/CMakeLists.txt) | ||
| add_subdirectory(tests) | ||
| # 7. Link GMGPolarLib (which now includes PolarGrid and InputFunctions) to both executables | ||
| target_link_libraries(gmgpolar PRIVATE GMGPolarLib) | ||
| target_link_libraries(convergence_order PRIVATE GMGPolarLib) | ||
| target_link_libraries(weak_scaling PRIVATE GMGPolarLib) | ||
| target_link_libraries(strong_scaling PRIVATE GMGPolarLib) | ||
|
|
||
| # 9. Enable testing and include other directories | ||
| if(GMGPOLAR_BUILD_TESTS) | ||
| enable_testing() | ||
| add_subdirectory(third-party) | ||
| add_subdirectory(tests) | ||
| endif() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.