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

[BREAKING] Multi-threading of CommonSolve functions #17

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9a027c0
initial revamp specialization and add executors
lxvm Jan 2, 2025
077c5a7
Merge branch 'main' into thread
lxvm Jan 3, 2025
0463610
add CommonSolveFourier executor
lxvm Jan 3, 2025
4e7f77a
add executor docs and missing variable
lxvm Jan 3, 2025
5ef5d2f
refactor of nestedquad with reversed initialization
lxvm Jan 16, 2025
81e17d4
remove unused keywords
lxvm Jan 17, 2025
05ea9db
composable refactor
lxvm Jan 30, 2025
6f67698
Breaking: replace (up!, post) with solve!
lxvm Feb 11, 2025
6a82beb
multithreading fix
lxvm Feb 11, 2025
031f049
pass interface tests
lxvm Feb 13, 2025
f1cde42
some fourier fixes, not yet autosymptr
lxvm Feb 14, 2025
b036773
bump polyhedra compat
lxvm Feb 14, 2025
d9a2ab4
quick fix for autosymptr
lxvm Feb 15, 2025
ffe4c9c
refactor algorithms to init integrand consistently
lxvm Feb 16, 2025
33eb572
update auxquadgk to refactor
lxvm Feb 16, 2025
b1a975a
refactor quadgk_integrand and fix fourier
lxvm Feb 16, 2025
6137eb1
remove nthreads keyword from autosymptr algorithms
lxvm Feb 16, 2025
1baa966
fix how tolerances are passed from AutoBZProblem to IntegralProblem a…
lxvm Feb 16, 2025
8653bd4
parallelize ptr no syms
lxvm Feb 17, 2025
4508bd9
restore previous symptr fourier evaluation
lxvm Feb 17, 2025
96b2152
ci version fix
lxvm Feb 17, 2025
1f494b6
docs updates
lxvm Feb 17, 2025
bea0b8a
dos fixes
lxvm Feb 17, 2025
3ea50fc
update version in docs CI
lxvm Feb 17, 2025
1a44480
fix in fourier nested quad
lxvm Feb 17, 2025
98fe48c
important autobzproblem fixes
lxvm Feb 17, 2025
30ed98b
fix unitful ptr bug
lxvm Feb 18, 2025
5073026
consolidate autoptr
lxvm Mar 12, 2025
d6e664d
create logger alg
lxvm Mar 12, 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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.9'
- '1.10'
- '1'
# - 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1.9'
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
7 changes: 4 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AutoSymPTR = "78a0c066-08f1-49a8-82f0-b29cd485e1d3"
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
FourierSeriesEvaluators = "2a892dea-6eef-4bb5-9d1c-de966c9f6db5"
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49"
IteratedIntegration = "3ecdc4d6-ee34-4049-885a-a4e3631db98b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -17,6 +16,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[weakdeps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
ImplicitIntegration = "bc256489-3a69-4a66-afc4-127cc87e6182"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
SymmetryReduceBZ = "49a35663-c880-4242-bebb-1ec8c0fa8046"
Expand All @@ -25,6 +25,7 @@ WannierIO = "cb1bc77f-5443-4951-af9f-05b616a3e422"

[extensions]
AtomsBaseExt = "AtomsBase"
AutoBZCoreFunctionWrappersExt = "FunctionWrappers"
AutoBZCoreImplicitIntegrationExt = "ImplicitIntegration"
SymmetryReduceBZExt = ["SymmetryReduceBZ", "Polyhedra"]
UnitfulExt = "Unitful"
Expand All @@ -45,15 +46,15 @@ ImplicitIntegration = "0.1.1"
IteratedIntegration = "0.5"
LinearAlgebra = "1.9"
OffsetArrays = "1"
Polyhedra = "0.6,0.7"
Polyhedra = "0.6,0.7,0.8"
QuadGK = "2.6"
StaticArrays = "1"
SymmetryReduceBZ = "0.2"
Test = "1.9"
Unitful = "1"
UnitfulAtomic = "1"
WannierIO = "0.1,0.2"
julia = "1.9"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ makedocs(
"Algorithms" => "algorithms.md",
"Reference" => "reference.md",
"Extensions" => "extensions.md",
"Performance Tips" => "performance.md",
],
)

Expand Down
2 changes: 0 additions & 2 deletions docs/src/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ AutoBZCore.IntegralAlgorithm
AutoBZCore.QuadratureFunction
AutoBZCore.QuadGKJL
AutoBZCore.AuxQuadGKJL
AutoBZCore.ContQuadGKJL
AutoBZCore.MeroQuadGKJL
```

### Cubature
Expand Down
19 changes: 19 additions & 0 deletions docs/src/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Performance Tips

## `executor` interface

```@docs
AutoBZCore.AbstractExecutor
AutoBZCore.SerialExecutor
AutoBZCore.ThreadedExecutor
```

## `specialization` interface

```@docs
AutoBZCore.AbstractSpecialization
AutoBZCore.DefaultSpecialize
AutoBZCore.NoSpecialize
AutoBZCore.FullSpecialize
AutoBZCore.FunctionWrapperSpecialize
```
11 changes: 11 additions & 0 deletions ext/AutoBZCoreFunctionWrappersExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module AutoBZCoreFunctionWrappersExt

using AutoBZCore
using FunctionWrappers: FunctionWrapper

function AutoBZCore.init_specialized_integrand(::FunctionWrapperSpecialize, solver, f, x, p, prototype)
func = AutoBZCore.init_specialized_integrand(DefaultSpecialize(), solver, f, x, p, prototype)
FunctionWrapper{typeof(prototype), typeof((solver, f, x, p))}(func)
end

end
11 changes: 6 additions & 5 deletions src/AutoBZCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,35 @@ module AutoBZCore
using LinearAlgebra: I, norm, det, checksquare, isdiag, Diagonal, tr, diag, eigen, Hermitian

using StaticArrays: SVector, SMatrix, sacollect
using FunctionWrappers: FunctionWrapper
using ChunkSplitters: chunks, getchunk
using AutoSymPTR
using FourierSeriesEvaluators
using IteratedIntegration
using QuadGK: quadgk, quadgk!, BatchIntegrand
using QuadGK: quadgk, quadgk!, BatchIntegrand, InplaceIntegrand
using HCubature: hcubature
using FourierSeriesEvaluators: workspace_allocate, workspace_contract!, workspace_evaluate!, workspace_evaluate, period
using IteratedIntegration: limit_iterate, interior_point
using HCubature: hcubature, hquadrature
using CommonSolve: solve
import CommonSolve: init, solve!
import CommonSolve: init, solve!, step!
export init, solve!, solve

include("domains.jl")

export IntegralFunction, InplaceIntegralFunction, InplaceBatchIntegralFunction
export CommonSolveIntegralFunction
export IntegralProblem
export AbstractSpecialization, DefaultSpecialize, NoSpecialize, FullSpecialize, FunctionWrapperSpecialize
export AbstractExecutor, SerialExecutor, ThreadedExecutor
include("interfaces.jl")

export QuadGKJL, HCubatureJL, QuadratureFunction
include("algorithms.jl")
export AuxQuadGKJL, ContQuadGKJL, MeroQuadGKJL
export AuxQuadGKJL
include("algorithms_iterated.jl")
export MonkhorstPack, AutoSymPTRJL
include("algorithms_autosymptr.jl")
export NestedQuad, EvalCounter#, AbsoluteEstimate
export NestedQuad, EvalCounter
include("algorithms_meta.jl")

export SymmetricBZ, nsyms
Expand Down
Loading
Loading