Skip to content
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

Set CMAKE_BUILD_PARALLEL_LEVEL to speed up SUNDIALS and IDAKLU compilation #3646

Closed
agriyakhetarpal opened this issue Dec 20, 2023 · 0 comments · Fixed by #3569
Closed

Set CMAKE_BUILD_PARALLEL_LEVEL to speed up SUNDIALS and IDAKLU compilation #3646

agriyakhetarpal opened this issue Dec 20, 2023 · 0 comments · Fixed by #3569
Assignees
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours priority: medium To be resolved if time allows

Comments

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Dec 20, 2023

THE CMAKE_BUILD_PARALLEL_LEVEL (CMake 3.12+) environment variable provides immense speedups (in the order of ~3x in my case) in the compilation of SuiteSparse and SUNDIALS if set, with the use of multithreaded builds – we can use this environment variable in install_KLU_Sundials.py, and for the IDAKLU extension module compilation in the build_ext command classes in setup.py.

The value of the environment variable should be set to the number of CPU cores present on the machine (computed through the value of multiprocessing.cpu_count() or similar).

Addendum: it can also be set accordingly in pybamm/install_odes.py to speed up the compilation of SUNDIALS for user installations.

@agriyakhetarpal agriyakhetarpal added difficulty: easy A good issue for someone new. Can be done in a few hours priority: medium To be resolved if time allows labels Dec 20, 2023
@agriyakhetarpal agriyakhetarpal changed the title Set CMAKE_BUILD_PARALLEL_LEVEL to speed up SUNDIALS and IDAKLU compilation Set CMAKE_BUILD_PARALLEL_LEVEL to speed up SUNDIALS and IDAKLU compilation Dec 20, 2023
@agriyakhetarpal agriyakhetarpal self-assigned this Dec 21, 2023
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Dec 21, 2023
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Dec 21, 2023
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Dec 23, 2023
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Dec 23, 2023
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Jan 6, 2024
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Jan 6, 2024
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Jan 6, 2024
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Jan 6, 2024
agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this issue Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours priority: medium To be resolved if time allows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant