diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f53f890d..4d055fbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,10 @@ jobs: strategy: fail-fast: false matrix: - version: - - '1.6' - - '1' # Latest 1.X - os: - - ubuntu-latest - arch: - - x64 + include: + - {version: '1', os: ubuntu-latest, arch: x64} + - {version: '1.6', os: ubuntu-latest, arch: x64} + - {version: '1', os: macos-14, arch: aarch64} steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index bcad921d..0e60d69b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.5] - 2025-07-31 + +### Fixed + +- Bugfix: Use standard operations for reduce to be compatible with aarch64 architecture (see https://github.com/PartitionedArrays/PartitionedArrays.jl/pull/209) + ## [0.3.4] - 2023-09-06 ### Added diff --git a/Project.toml b/Project.toml index 35e5e577..1470fcf7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PartitionedArrays" uuid = "5a9dfac6-5c52-46f7-8278-5e2210713be9" authors = ["Francesc Verdugo and contributors"] -version = "0.3.4" +version = "0.3.5" [deps] CircularArrays = "7a955b69-7140-5f4e-a0ed-f168c5e2e749" diff --git a/src/p_vector.jl b/src/p_vector.jl index 8cebf37a..f32478c4 100644 --- a/src/p_vector.jl +++ b/src/p_vector.jl @@ -1,6 +1,30 @@ function local_values end +function reduce_for_distance(d, partials, init) + reduce((i, j) -> Distances.eval_reduce(d, i, j), partials; init) +end + +reduce_for_distance(::Distances.Chebyshev, partials, init) = + reduce(max, partials; init) + +for T in (Distances.Euclidean, + Distances.SqEuclidean, + Distances.PeriodicEuclidean, + Distances.Cityblock, + Distances.TotalVariation, + Distances.Minkowski, + Distances.Hamming, + Distances.ChiSqDist, + Distances.KLDivergence, + Distances.GenKLDivergence) + # all Distances.metrics except Jaccard, RogersTanimoto, CosineDist, + # RenyiDivergence, BrayCurtis, SpanNormDist, since these either operate with + # tuples or have a complex reduction logic. + @eval reduce_for_distance(::$(T), partials, init) = + reduce(+, partials; init) +end + function own_values end function ghost_values end @@ -834,9 +858,8 @@ for M in Distances.metrics return s end end - s = reduce((i,j)->Distances.eval_reduce(d,i,j), - partials, - init=Distances.eval_start(d, a, b)) + init_val = Distances.eval_start(d, a, b) + s = reduce_for_distance(d, partials, init_val) Distances.eval_end(d,s) end end diff --git a/src/primitives.jl b/src/primitives.jl index c0868867..349bd785 100644 --- a/src/primitives.jl +++ b/src/primitives.jl @@ -601,14 +601,11 @@ function ExchangeGraph_impl_with_neighbors(snd_ids,neighbors::ExchangeGraph) is_included_all=map(snd_ids_a, snd_ids_b) do snd_ids_a, snd_ids_b all(i->i in snd_ids_b,snd_ids_a) end - result=false - and(a,b)=a && b - is_included_all=reduction(and,is_included_all,destination=:all,init=one(eltype(is_included_all))) - map(is_included_all) do is_included_all - result = is_included_all - end - result - end + # perform a global AND using built-in & operator (static MPI-op) + is_included_all = reduction(&, is_included_all; destination=:all, init=one(eltype(is_included_all))) + # extract the single boolean result + collect(is_included_all)[1] + end @boundscheck is_included(snd_ids,neighbors.snd) || error("snd_ids must be a subset of neighbors.snd") rank = linear_indices(snd_ids) # Tell the neighbors whether I want to send to them