Skip to content

Commit

Permalink
Hide the numa warning for now
Browse files Browse the repository at this point in the history
  • Loading branch information
smillerc committed Sep 23, 2022
1 parent 739120f commit 8bcc509
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/Manifest.toml
*.csv
*.csv
.vscode
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BlockHaloArrays"
uuid = "8029ca6b-11ad-4a59-88a2-2e6eee4ef8a2"
authors = ["Sam Miller <[email protected]> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
Expand Down
18 changes: 9 additions & 9 deletions src/BlockHaloArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for shared-memory applications. Each thread operates on it's own block of data.
scaling than multi-threaded loops
# Fields
- `blocks::Vector{AA}`:
- `blocks::Vector{AA}`:
- `block_layout::NTuple{D,Int}`: number of blocks along each dimension
- `global_blockranges::Array{NTuple{D,UnitRange{Int}},D}`: Indexing/ranges of each block from the global perspective
- `nhalo::Int`: Number of halo regions, e.g. 2 entries along each dimension
Expand Down Expand Up @@ -51,7 +51,7 @@ plain `BlockHaloArray` is the addition of send/receive buffers that help
MPI communication.
# Fields
- `blocks::Vector{AA}`:
- `blocks::Vector{AA}`:
- `block_layout::NTuple{D,Int}`: number of blocks along each dimension
- `global_blockranges::Array{NTuple{D,UnitRange{Int}},D}`: Indexing/ranges of each block from the global perspective
- `nhalo::Int`: Number of halo regions, e.g. 2 entries along each dimension
Expand Down Expand Up @@ -87,7 +87,7 @@ Construct a BlockHaloArray
# Keyword Arguments
- `nblocks::Integer`: Number of blocks to divide the array into; default is nthreads()
- `T`:: Array number type; default is Float64
- `T`:: Array number type; default is Float64
"""
function BlockHaloArray(dims::NTuple{N,Int}, halodims::NTuple{N2,Int}, nhalo::Integer, nblocks=nthreads(); T=Float64, use_numa=true) where {N,N2}

Expand Down Expand Up @@ -133,7 +133,7 @@ function BlockHaloArray(dims::NTuple{N,Int}, halodims::NTuple{N2,Int}, nhalo::In

# this is the cumulative block size along each dimension, indexed via [tile_dimension][1:blocks_in_tile_dim]
cummulative_blocksize_per_dim = OffsetArray(
cumsum.(collect(split_count.(dims[[i for i in halodims]], tile_dims))),
cumsum.(collect(split_count.(dims[[i for i in halodims]], tile_dims))),
UnitRange(first(halodims), last(halodims))
)

Expand All @@ -156,9 +156,9 @@ function BlockHaloArray(dims::NTuple{N,Int}, halodims::NTuple{N2,Int}, nhalo::In
numa_id = threadid_to_numa_mapping[threadid]
blocks[threadid] = Array{T}(numa(numa_id), block_sizes[threadid]...)
catch
if threadid == firstindex(blocks)
@warn "Unable to allocate blocks on the thread-local NUMA node"
end
# if threadid == firstindex(blocks)
# @warn "Unable to allocate blocks on the thread-local NUMA node"
# end
blocks[threadid] = Array{T}(undef, block_sizes[threadid]...)
end
else
Expand Down Expand Up @@ -257,7 +257,7 @@ Determine if the block is on the boundary
# Arguments
- `A::AbstractBlockHaloArray`: The array in question
- `blockid::Integer`: The id of the block. This is normally associated with the thread id
- `boundary::Symbol`: Which boundary are we checking for? Examples include :ilo, :jhi, etc...
- `boundary::Symbol`: Which boundary are we checking for? Examples include :ilo, :jhi, etc...
"""
function onboundary(A::AbstractBlockHaloArray, blockid::Integer, boundary::Symbol)
try
Expand Down Expand Up @@ -290,4 +290,4 @@ function domainview(A::BlockHaloArray, blockid::Integer)
return @views A.blocks[blockid][.., Tuple(idx_range_vec)...]
end

end # module
end # module

2 comments on commit 8bcc509

@smillerc
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/68855

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 8bcc5098e9dd5e8d022d758ceb6ef26df409710a
git push origin v0.2.1

Please sign in to comment.