Skip to content

Commit

Permalink
fix share! of inputs
Browse files Browse the repository at this point in the history
check for null case before sharing
  • Loading branch information
tanmaykm committed Jan 24, 2016
1 parent e9d10a5 commit d10f362
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,25 @@ function localize!(inp::SharedMemoryInputs)
end

function share!(inp::SharedMemoryInputs)
R = get(inp.R)
isa(R, SharedRatingMatrix) || (inp.R = share(R))
if !isnull(inp.R)
R = get(inp.R)
isa(R, SharedRatingMatrix) || (inp.R = share(R))
end

RT = get(inp.RT)
isa(RT, SharedRatingMatrix) || (inp.RT = share(RT))
if !isnull(inp.RT)
RT = get(inp.RT)
isa(RT, SharedRatingMatrix) || (inp.RT = share(RT))
end

item_idmap = get(inp.item_idmap)
isa(item_idmap, SharedVector) || (inp.item_idmap = share(item_idmap))
if !isnull(inp.item_idmap)
item_idmap = get(inp.item_idmap)
isa(item_idmap, SharedVector) || (inp.item_idmap = share(item_idmap))
end

user_idmap = get(inp.user_idmap)
isa(user_idmap, SharedVector) || (inp.user_idmap = share(user_idmap))
if !isnull(inp.user_idmap)
user_idmap = get(inp.user_idmap)
isa(user_idmap, SharedVector) || (inp.user_idmap = share(user_idmap))
end

nothing
end
Expand Down

0 comments on commit d10f362

Please sign in to comment.