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

Add a preference option for DFTK threading #972

Merged
merged 14 commits into from
May 31, 2024
Merged

Add a preference option for DFTK threading #972

merged 14 commits into from
May 31, 2024

Conversation

antoine-levitt
Copy link
Member

Draft because untested so there's probably typos, I'll put it through its paces sometime later, but should be complete.

antoine-levitt and others added 8 commits May 16, 2024 09:40
Bumps [julia-actions/cache](https://github.com/julia-actions/cache) from 1 to 2.
- [Release notes](https://github.com/julia-actions/cache/releases)
- [Commits](julia-actions/cache@v1...v2)

---
updated-dependencies:
- dependency-name: julia-actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@antoine-levitt antoine-levitt marked this pull request as ready for review May 23, 2024 12:58
@antoine-levitt
Copy link
Member Author

This works fine locally, so let's merge?

@epolack
Copy link
Collaborator

epolack commented May 23, 2024

Does this allow to enable and disable it without launching again DFTK? For some computations, it makes sense to have multiple/single thread DFTK in the same script.

@antoine-levitt
Copy link
Member Author

Nope, I figured let's do the simple thing and require a reboot...

src/common/threading.jl Outdated Show resolved Hide resolved
@antoine-levitt
Copy link
Member Author

Thanks! @mfherbst OK to merge?

FFTW.set_num_threads(n_fft)
BLAS.set_num_threads(n_blas)
mpi_master() && @info "Threading setup:" n_fft n_blas n_julia
mpi_master() && @info "Threading setup: $(Threads.nthreads()) Julia threads, $n_DFTK DFTK threads, $n_fft FFT threads, $n_blas BLAS threads"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? The other option gave a nice table?
Also line too long :-P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't know this, pretty nice

src/common/threading.jl Show resolved Hide resolved
src/common/threading.jl Show resolved Hide resolved
docs/src/tricks/parallelization.md Show resolved Hide resolved
@antoine-levitt
Copy link
Member Author

Review done

@mfherbst mfherbst merged commit d17848c into master May 31, 2024
5 of 7 checks passed
@mfherbst mfherbst deleted the threading branch May 31, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants