From 4f2f39e7756293741d9b65d153ca910e08aff69f Mon Sep 17 00:00:00 2001 From: Jutho Haegeman Date: Thu, 4 Jun 2020 00:51:51 +0200 Subject: [PATCH] Disable Strided threading in favor of block threading for permuting abelian tensors --- src/tensors/tensoroperations.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tensors/tensoroperations.jl b/src/tensors/tensoroperations.jl index 7ca56705..1f90965a 100644 --- a/src/tensors/tensoroperations.jl +++ b/src/tensors/tensoroperations.jl @@ -67,9 +67,12 @@ function add!(α, tsrc::AbstractTensorMap{S}, β, tdst::AbstractTensorMap{S,N₁ axpby!(α, permutedims(tsrc[], pdata), β, tdst[]) elseif FusionStyle(G) isa Abelian && BraidingStyle(G) isa SymmetricBraiding if Threads.nthreads() > 1 + nstridedthreads = Strided.get_num_threads() + Strided.set_num_threads(1) Threads.@sync for (f1,f2) in fusiontrees(tsrc) Threads.@spawn _addabelianblock!(α, tsrc, β, tdst, p1, p2, f1, f2) end + Strided.set_num_threads(nstridedthreads) else # debugging is easier this way for (f1,f2) in fusiontrees(tsrc) _addabelianblock!(α, tsrc, β, tdst, p1, p2, f1, f2)