@@ -38,7 +38,7 @@ mutable struct WindowIO <: IO
3838 waiter
3939
4040 function WindowIO (comm= MPI. COMM_WORLD, bufsize= 1024 ^ 2 )
41- buffer = Array {UInt8,1} (bufsize)
41+ buffer = Array {UInt8,1} (undef, bufsize)
4242 header_win = MPI. Win ()
4343 header = BufferHeader (0 , MPI. Get_address (buffer), bufsize, bufsize)
4444 remote_header = BufferHeader (0 , MPI. Get_address (buffer), bufsize, bufsize)
@@ -140,7 +140,7 @@ mutable struct WindowWriter <: IO
140140 nb_written:: Int
141141
142142 function WindowWriter (w:: WindowIO , target:: Integer )
143- return new (w, target, Vector {UInt8} (1024 ^ 2 ), ReentrantLock (), 0 )
143+ return new (w, target, Vector {UInt8} (undef, 1024 ^ 2 ), ReentrantLock (), 0 )
144144 end
145145end
146146
@@ -164,7 +164,7 @@ Base.isreadable(::WindowWriter) = false
164164function Base. close (w:: WindowIO )
165165 w. is_open = false
166166 notify (w. read_requested)
167- wait (w. waiter) # Wait for the data notification loop to finish
167+ fetch (w. waiter) # Wait for the data notification loop to finish
168168 MPI. Win_lock (MPI. LOCK_EXCLUSIVE, w. myrank, 0 , w. header_win)
169169 w. header. count = 0
170170 w. ptr = 0
@@ -211,18 +211,18 @@ function Base.readbytes!(w::WindowIO, b::AbstractVector{UInt8}, nb=length(b); al
211211 if nb_read == 0
212212 return 0
213213 end
214- copy ! (b, 1 , w. buffer, w. ptr+ 1 , nb_read)
214+ copyto ! (b, 1 , w. buffer, w. ptr+ 1 , nb_read)
215215 w. ptr += nb_read
216216 complete_read (w)
217217 return nb_read
218218end
219219
220- Base. readavailable (w:: WindowIO ) = read! (w, Vector {UInt8} (nb_available (w)))
220+ Base. readavailable (w:: WindowIO ) = read! (w, Vector {UInt8} (undef, nb_available (w)))
221221
222222@inline function Base. unsafe_read (w:: WindowIO , p:: Ptr{UInt8} , nb:: UInt )
223223 nb_obtained = wait_nb_available (w,nb)
224224 nb_read = min (nb_obtained, nb)
225- unsafe_copy ! (p, pointer (w. buffer, w. ptr+ 1 ), nb_read)
225+ unsafe_copyto ! (p, pointer (w. buffer, w. ptr+ 1 ), nb_read)
226226 w. ptr += nb_read
227227 complete_read (w)
228228 if nb_read != nb
@@ -232,7 +232,7 @@ Base.readavailable(w::WindowIO) = read!(w, Vector{UInt8}(nb_available(w)))
232232end
233233
234234function Base. read (w:: WindowIO , nb:: Integer ; all:: Bool = true )
235- buf = Vector {UInt8} (nb)
235+ buf = Vector {UInt8} (undef, nb)
236236 readbytes! (w, buf, nb, all= all)
237237 return buf
238238end
@@ -253,7 +253,7 @@ function Base.unsafe_write(w::WindowWriter, p::Ptr{UInt8}, nb::UInt)
253253 offset = w. nb_written+ 1
254254 w. nb_written += nb
255255 ensureroom (w)
256- copy ! (w. write_buffer, offset, unsafe_wrap (Array{UInt8}, p, nb), 1 , nb)
256+ copyto ! (w. write_buffer, offset, unsafe_wrap (Array{UInt8}, p, nb), 1 , nb)
257257 return nb
258258end
259259
0 commit comments