Follow standard CMake layout#214
Conversation
|
@tpadioleau can you have a look at this please to see if it aligns with what you had in mind for linking to Gyselalib++? |
69ca3ed to
7392ea6
Compare
6a681a8 to
6e94e02
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 90.72% 90.72%
=======================================
Files 86 86
Lines 9473 9473
=======================================
Hits 8594 8594
Misses 879 879 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tpadioleau
left a comment
There was a problem hiding this comment.
I think this is an improvement, my main concern is whether we should install files related to InputFunctions ?
| target_include_directories(InputFunctions_BoundaryConditions PUBLIC | ||
| ${CMAKE_CURRENT_SOURCE_DIR} | ||
| ${CMAKE_SOURCE_DIR}/include/InputFunctions/BoundaryConditions | ||
| ${GMGPOLAR_INCLUDE_DIRS} | ||
| ) |
There was a problem hiding this comment.
Is it possible to replace by target_link_libraries(InputFunctions_BoundaryConditions PUBLIC GMGPolarLib) ? I think the target GMGPolarLib should be responsible to bring these headers.
There was a problem hiding this comment.
It is possible. This seemed more logical to me as the files in InputFunctions include files that are never used in GMGPolarLib (e.g. the associated .hpp files for these .cpp files) so GMGPolarLib is not needed to compile the InputFunctions for testing.
E.g. in theory we could use InputFunctions in https://github.com/gyselax/gysela-mini-app_poisson even when testing a different solver
There was a problem hiding this comment.
@tpadioleau Does the comment above change your opinion on how the include directory is included or do you still think we should link the library?
There was a problem hiding this comment.
Is this METIS from https://github.com/KarypisLab/METIS ? I see it is based on CMake, it does not generate its own Config files ?
Does not need to be handled in the PR.
There was a problem hiding this comment.
I didn't check, I just reorganised what was already in the existing CMake files. Probably a question for @mknaranja
There was a problem hiding this comment.
more a comment than a full answer: Yes, this is METIS from Karypis, it is used for mesh / graph partitioning which is used in direct solvers such as MUMPS. But: I couldn't tell you anything about the technical config file question, I never looked at it at that level.
There was a problem hiding this comment.
I never tested Mumps without Metis, but Mumps could be used without it by setting ICNTL(7)=7.
https://github.com/SciCompMod/GMGPolar/blob/main/src/LinearAlgebra/Solvers/coo_mumps_solver.cpp#L107
There was a problem hiding this comment.
I think MUMPS can also use other graph partitioners such as p4est but I think that does only yield other problems. Graph partitioning is used to reduce fill-in. I would suggest to keep METIS if MUMPS is used. From my point of view, METIS is a minimal dependency as it is used in millions of numerical linear algebra (+ HPC) applications.
| target_include_directories(InputFunctions INTERFACE | ||
| ${CMAKE_SOURCE_DIR}/include/InputFunctions | ||
| ) | ||
| ${GMGPOLAR_INCLUDE_DIRS} |
There was a problem hiding this comment.
Same question, is it possible to replace by target_link_libraries(InputFunctions_BoundaryConditions PUBLIC GMGPolarLib) ?
| install(TARGETS | ||
| InputFunctions | ||
| InputFunctions_BoundaryConditions | ||
| InputFunctions_DensityProfileCoefficients | ||
| InputFunctions_DomainGeometry | ||
| InputFunctions_ExactSolution | ||
| InputFunctions_SourceTerms | ||
| EXPORT GMGPolarTargets | ||
| ARCHIVE DESTINATION lib | ||
| ) |
There was a problem hiding this comment.
Do they actually need to be installed ?
There was a problem hiding this comment.
I'm not sure. This is a question for @mknaranja . It depends on what you see as being the main functionality of the library.
I would lean towards them not needing to be installed. But if they are I would probably use them for testing GMGPolar vs other solvers
| ${CMAKE_CURRENT_SOURCE_DIR} | ||
| ${CMAKE_SOURCE_DIR}/include/InputFunctions/DomainGeometry | ||
| ) No newline at end of file | ||
| ${GMGPOLAR_INCLUDE_DIRS} |
There was a problem hiding this comment.
Same question, is it possible to replace by target_link_libraries(InputFunctions_BoundaryConditions PUBLIC GMGPolarLib) ?
|
Compiles on my machine 👍🏼 |
Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
HenrZu
left a comment
There was a problem hiding this comment.
@mknaranja requested me to have a look at this. Looks great :) The structure is much cleaner. I left a few minor comments (most are questions as im not really familiar with the structure).
| target_link_libraries(convergence_order PRIVATE GMGPolarLib) | ||
| target_link_libraries(weak_scaling PRIVATE GMGPolarLib) | ||
| target_link_libraries(strong_scaling PRIVATE GMGPolarLib) | ||
| target_link_libraries(gmgpolar PRIVATE GMGPolarLib GMGPolarInterface) |
There was a problem hiding this comment.
im not really familiar with the structure. But these executables are built but not installed. Is this intentional? If yes, maybe add a comment :)
There was a problem hiding this comment.
This is where we need feedback from the GMGPolar team. It is related to the comment above : #214 (comment)
It depends on how you see GMGPolar.
Is it a library? I.e. something designed to provide tools to other bigger tools (e.g. simulations, gyselalib++, etc)
Or is it a tool in its own right? I.e. does it make sense to have access to the executables but not the code?
My impression was that it is more of a library so I have implemented it like this for now. But that also raises the question of whether GMGPolarInterface should be included in that library or not?
In any case I suspect that it does not make sense to install convergence_order, weak_scaling and strong_scaling as I'm not sure these are particularly useful if you can't modify the code to try different test cases?
There was a problem hiding this comment.
I think if you would export it as a library than you might need the sourceTerm.h concept definitions, but not all source term specific test case examples.
And the main.cpp etc are just for testing purposes and are probably also not part of a library.
There was a problem hiding this comment.
The current setup is:
- All include files are installed
- Everything except
src/ConfigParser/*andsrc/InputFunctions/*is compiled into theGMGPolarLibtarget src/ConfigParser/*andsrc/InputFunctions/*are compiled into aGMGPolarInterfacelibrary
As an example of end users:
- gyselalib++ would use
GMGPolarLibto provide a solver for the equation and would be happy to not have to compileGMGPolarInterface - gysela-mini-app_poisson (a mini-app designed to compare different solvers) would do the same but could also use
GMGPolarInterfaceto avoid having to write our own test cases.
Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
|
FYI, I started a draft of the Spack package, gyselax/spack@e4fbf54 You can test it with a Spack environment: # gmgpolar-spack.yaml
spack:
concretizer:
unify: true
specs:
- 'cmake'
- 'gmgpolar@git.ebourne_cleanup_cmake=main'
repos:
patches:
git: https://github.com/gyselax/spack.git
branch: releases/v2025.11
builtin:
branch: releases/v2025.11
view: trueOnce you have downloaded Spack and activated it, see https://spack.readthedocs.io/en/latest/getting_started.html#getting-started |
Clean up CMake files to follow standard practice. In particular:
find_packagecalls are moved to the rootCMakeLists.txtso dependencies are easy to locatecmake/FindX.cmakefiles so they can be located via a standardfind_packagecallInputFunctions(which is only required for testing and for the CLI) is removed from theGMGPolarLibtargetGMGPolarInterfaceis added to group example input functions and other tools required for the command line interface.if(OpenMP_CXX_FOUND)is removed as OpenMP is a required dependency so this should always be Trueinclude/folder is included via the compile commandfind_package(GMGPolar)Merge Request - GuideLine Checklist
Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.
Checks by code author:
Always to be checked:
If functions were changed or functionality was added:
If new functionality was added:
If new third party software is used:
If new mathematical methods or epidemiological terms are used:
Checks by code reviewer(s):