Skip to content

Commit

Permalink
Avoid race conditions on mkpath
Browse files Browse the repository at this point in the history
  • Loading branch information
zjwegert committed May 24, 2024
1 parent df59677 commit a0fa593
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ a set of JLD2 files corresponding to each part.
function psave(dir::AbstractString, x)
ranks = get_parts(x)
i_am_main(ranks) && mkpath(dir)
fetch(ranks)
arr = to_local_storage(x)
map(ranks,arr) do id, arr
filename = joinpath(dir,basename(dir)*"_$id.jdl2")
Expand Down

0 comments on commit a0fa593

Please sign in to comment.