-$ JULIA_NUM_THREADS=4 julia</code></pre><p>In addition, we have found that it is best to disable <code>BLAS</code> and <code>Strided</code> multithreading when using block sparse multithreading. You can do that with the commands <code>using LinearAlgebra; BLAS.set_num_threads(1)</code> and <code>ITensors.Strided.disable_threads()</code>.</p><p>See also: <code>ITensors.enable_threaded_blocksparse</code>, <code>ITensors.disable_threaded_blocksparse</code>, <code>ITensors.using_threaded_blocksparse</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/ITensors.jl/blob/ca0c020dcca2eae3f426e0352bf5135feb8adcc7/src/global_variables.jl#L141-L168">source</a></section><section><div><pre><code class="language-julia hljs">enable_threaded_blocksparse(enable::Bool)</code></pre><p><code>enable_threaded_blocksparse(true)</code> enables threaded block sparse operations (equivalent to <code>enable_threaded_blocksparse()</code>).</p><p><code>enable_threaded_blocksparse(false)</code> disables threaded block sparse operations (equivalent to <code>enable_threaded_blocksparse()</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/ITensors.jl/blob/ca0c020dcca2eae3f426e0352bf5135feb8adcc7/src/global_variables.jl#L146-L154">source</a></section></article><p>Here is a simple example of using block sparse multithreading to speed up a sparse tensor contraction:</p><pre><code class="language-julia hljs">using BenchmarkTools
0 commit comments