Skip to content

Commit 2f04e52

Browse files
committed
Disable threadsafe evaluation
1 parent 0cf3440 commit 2f04e52

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/model.jl

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -866,48 +866,9 @@ Returns a tuple of the model's return value, plus the updated `varinfo`
866866
(unwrapped if necessary).
867867
"""
868868
function AbstractPPL.evaluate!!(model::Model, varinfo::AbstractVarInfo)
869-
return if use_threadsafe_eval(model.context, varinfo)
870-
evaluate_threadsafe!!(model, varinfo)
871-
else
872-
evaluate_threadunsafe!!(model, varinfo)
873-
end
874-
end
875-
876-
"""
877-
evaluate_threadunsafe!!(model, varinfo)
878-
879-
Evaluate the `model` without wrapping `varinfo` inside a `ThreadSafeVarInfo`.
880-
881-
If the `model` makes use of Julia's multithreading this will lead to undefined behaviour.
882-
This method is not exposed and supposed to be used only internally in DynamicPPL.
883-
884-
See also: [`evaluate_threadsafe!!`](@ref)
885-
"""
886-
function evaluate_threadunsafe!!(model, varinfo)
887869
return _evaluate!!(model, resetaccs!!(varinfo))
888870
end
889871

890-
"""
891-
evaluate_threadsafe!!(model, varinfo, context)
892-
893-
Evaluate the `model` with `varinfo` wrapped inside a `ThreadSafeVarInfo`.
894-
895-
With the wrapper, Julia's multithreading can be used for observe statements in the `model`
896-
but parallel sampling will lead to undefined behaviour.
897-
This method is not exposed and supposed to be used only internally in DynamicPPL.
898-
899-
See also: [`evaluate_threadunsafe!!`](@ref)
900-
"""
901-
function evaluate_threadsafe!!(model, varinfo)
902-
wrapper = ThreadSafeVarInfo(resetaccs!!(varinfo))
903-
result, wrapper_new = _evaluate!!(model, wrapper)
904-
# TODO(penelopeysm): If seems that if you pass a TSVI to this method, it
905-
# will return the underlying VI, which is a bit counterintuitive (because
906-
# calling TSVI(::TSVI) returns the original TSVI, instead of wrapping it
907-
# again).
908-
return result, setaccs!!(wrapper_new.varinfo, getaccs(wrapper_new))
909-
end
910-
911872
"""
912873
_evaluate!!(model::Model, varinfo)
913874

0 commit comments

Comments
 (0)