Skip to content

Commit

Permalink
Merge pull request #914 from JuliaSymbolics/myb/deadlock_fix
Browse files Browse the repository at this point in the history
MultithreadedForm can cause deadlock
  • Loading branch information
YingboMa authored Jun 9, 2023
2 parents 962e2b4 + f65059b commit c0966fb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RecipesBase = "1.1"
Reexport = "0.2, 1"
ReferenceTests = "0.9"
Requires = "1.1"
RuntimeGeneratedFunctions = "=0.5.9"
RuntimeGeneratedFunctions = "0.5.9"
SciMLBase = "1.8"
Setfield = "0.7, 0.8, 1"
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0, 2"
Expand Down
5 changes: 2 additions & 3 deletions src/build_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ function _build_function(target::JuliaTarget, rhss::AbstractArray, args...;
iip_config = (true, true),
parallel=nothing, cse = false, kwargs...)

if parallel == nothing && _nnz(rhss) >= 1000
parallel = ShardedForm() # by default switch for arrays longer than 1000 exprs
end
# We cannot switch to ShardedForm because it deadlocks with
# RuntimeGeneratedFunctions
dargs = map((x) -> destructure_arg(x[2], !checkbounds,
Symbol("ˍ₋arg$(x[1])")), enumerate([args...]))
i = findfirst(x->x isa DestructuredArgs, dargs)
Expand Down
2 changes: 1 addition & 1 deletion test/latexify_refs/integral1.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\begin{equation}
\mathrm{Integral(dx, 0..1)}\left( x \right)
\int_{0}^{1)} dx x
\end{equation}
2 changes: 1 addition & 1 deletion test/latexify_refs/integral2.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\begin{equation}
\mathrm{Integral(dx, -Inf..Inf)}\left( \left( u\left( x \right) \right)^{2} \right)
\int_{-\infty}^{\infty)} dx \left( u\left( x \right) \right)^{2}
\end{equation}
2 changes: 1 addition & 1 deletion test/latexify_refs/integral3.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\begin{equation}
\mathrm{Integral(dx, -z..u(x))}\left( x^{2} \right)
\int_{ - z}^{u\left( x \right))} dx x^{2}
\end{equation}

0 comments on commit c0966fb

Please sign in to comment.