Skip to content

Commit

Permalink
Merge pull request #250 from vaerksted/master
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
andreasnoack authored Jul 29, 2024
2 parents 0451d00 + 46fb065 commit 3272d42
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ equal the number of processes.
* `localpart(d::DArray)` obtains the locally-stored portion
of a `DArray`.

* Localparts can be retrived and set via the indexing syntax too.
* Localparts can be retrieved and set via the indexing syntax too.
Indexing via symbols is used for this, specifically symbols `:L`,`:LP`,`:l`,`:lp` which
are all equivalent. For example, `d[:L]` returns the localpart of `d`
while `d[:L]=v` sets `v` as the localpart of `d`.
Expand Down Expand Up @@ -314,7 +314,7 @@ The following primitives can be used in SPMD mode.

- `recvfrom_any(; tag=nothing)` - receives data from any `pid`

- `barrier(;pids=procs(), tag=nothing)` - all tasks wait and then proceeed
- `barrier(;pids=procs(), tag=nothing)` - all tasks wait and then proceed

- `bcast(data, pid; tag=nothing, pids=procs())` - broadcasts the same data over `pids` from `pid`

Expand Down
2 changes: 1 addition & 1 deletion src/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
# We purposefully only specialise `copyto!`,
# Broadcast implementation that defers to the underlying BroadcastStyle. We can't
# assume that `getindex` is fast, furthermore we can't assume that the distribution of
# DArray accross workers is equal or that the underlying array type is consistent.
# DArray across workers is equal or that the underlying array type is consistent.
#
# Implementation:
# - first distribute all arguments
Expand Down
2 changes: 1 addition & 1 deletion src/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ import Base: checkbounds_indices
# from all other arrays, wherein we simply iterate over the source array’s
# elements. You need to *both* know which elements in `J` were skipped
# (`indexin_mask`) and which dimensions should match up (`restrict_indices`)
# 4. If `K` doesnt correspond to an entire chunk, reinterpret `K` in terms of
# 4. If `K` doesn't correspond to an entire chunk, reinterpret `K` in terms of
# the local portion of the source array
function Base.setindex!(a::Array, s::SubDArray,
I::Union{UnitRange{Int},Colon,Vector{Int},StepRange{Int,Int}}...)
Expand Down
2 changes: 1 addition & 1 deletion src/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function mapreducedim_within(f, op, A::DArray, region)
tuple(arraysize...), procs(A), indx, cuts)
end

# Compute mapreducedim accros the processes. This should be done after mapreducedim
# Compute mapreducedim across the processes. This should be done after mapreducedim
# has been run on each localpart with mapreducedim_within. Eventually, we might
# want to write mapreducedim_between! as a binary reduction.
function mapreducedim_between!(f, op, R::DArray, A::DArray, region)
Expand Down
2 changes: 1 addition & 1 deletion src/serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end

DestinationSerializer(f::Function, pids::Array) = DestinationSerializer(f, pids, nothing)

# contructs a DestinationSerializer after verifying that the shape of pids.
# constructs a DestinationSerializer after verifying that the shape of pids.
function verified_destination_serializer(f::Function, pids::Array, verify_size)
@assert size(pids) == verify_size
return DestinationSerializer(f, pids)
Expand Down
8 changes: 4 additions & 4 deletions test/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using Random
close(DA)
end

@testset "Create darray with unconventional distribution and distibute like it" begin
@testset "Create darray with unconventional distribution and distribute like it" begin
block = 10
Y = nworkers() * block
X = nworkers() * block
Expand Down Expand Up @@ -66,7 +66,7 @@ using Random
@test DistributedArrays.defaultdist(50,4) == [1,14,27,39,51]
end

@testset "Inhomogenous typeof(localpart)" begin
@testset "Inhomogeneous typeof(localpart)" begin
block = 10
Y = nworkers() * block
X = nworkers() * block
Expand Down Expand Up @@ -531,7 +531,7 @@ check_leaks()
close(A)
end

@testset "2D dzeros default element type, Dims constuctor" begin
@testset "2D dzeros default element type, Dims constructor" begin
A = dzeros((10,10))
@test A == zeros((10,10))
@test eltype(A) == Float64
Expand Down Expand Up @@ -582,7 +582,7 @@ check_leaks()
close(A)
end

@testset "2D dones default element type, Dims constuctor" begin
@testset "2D dones default element type, Dims constructor" begin
A = dones((10,10))
@test A == ones((10,10))
@test eltype(A) == Float64
Expand Down
4 changes: 2 additions & 2 deletions test/spmd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spmd(spmd_test1)
d_out[:L] = localsum
end

# run foo_spmd on all workers, many of them, all concurrently using implictly different contexts.
# run foo_spmd on all workers, many of them, all concurrently using implicitly different contexts.
in_arrays = map(x->DArray(I->fill(myid(), (map(length,I)...,)), (nworkers(), 2), workers(), [nworkers(),1]), 1:8)
out_arrays = map(x->ddata(), 1:8)

Expand All @@ -117,7 +117,7 @@ end

println("SPMD: Passed testing of spmd function run concurrently")

# run concurrently with explictly different contexts
# run concurrently with explicitly different contexts

# define the function everywhere
@everywhere function foo_spmd2(d_in, d_out, n)
Expand Down

0 comments on commit 3272d42

Please sign in to comment.