Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PartitionedArrays"
uuid = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
authors = ["Francesc Verdugo <[email protected]> and contributors"]
version = "0.3.4"
version = "0.3.5"

[deps]
CircularArrays = "7a955b69-7140-5f4e-a0ed-f168c5e2e749"
Expand Down
29 changes: 26 additions & 3 deletions src/p_vector.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions src/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading