<p dir="auto">We have <code class="notranslate">in</code> with <code class="notranslate">∈</code>, but not an non-ascii alias for  ∉. I suggest   <code class="notranslate">!in</code> or <code class="notranslate">notin</code>.</p>
<p dir="auto">The problem is I don't want to use <code class="notranslate">∉</code> when I wouldn't use <code class="notranslate">∈</code>. In other words, if my code is using <code class="notranslate">in</code>, it then kinda forces you to change these to <code class="notranslate">∈</code> so they match with  <code class="notranslate">∉</code>.</p>
<p dir="auto">I encountered a possible MKL threading bug in Julia 1.7.0 on macOS but don't know if it is the same as the OpenBLAS threading issue (e.g. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1069687332" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/43301" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/43301/hovercard" href="https://github.com/JuliaLang/julia/issues/43301">#43301</a> ), so please close if this is a duplicate.</p>
<p dir="auto">The following code is a simplified version of code that generates impulse response functions from a state-space model. It works with 1 BLAS thread but the matrix based iteration x2 explodes with any higher thread number, even though the relevant row of the matrix only has one non-zero entry of 0.9 and should give the same path as x1, which is essentially an AR1. On Linux, the code runs for any number of threads and x1 and x2 follow the same impulse response.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using Plots, MKL, LinearAlgebra
BLAS.set_num_threads(2)

var_index = 150 # index of variable of interest
LOMstate = randn(300, 300) # law of motion
LOMstate[var_index, :] .= 0.0 # set the law of motion for the variable of interest to an AR with coefficient 0.9
LOMstate[var_index, var_index] = 0.9

x0 = zeros(size(LOMstate, 1), 1)
x0[var_index] = 1.0 # shock to the variable of interest

irf_horizon = 40
x1 = x0 * ones(1, irf_horizon + 1)
x2 = x0 * ones(1, irf_horizon + 1)

for t = 1:irf_horizon
    x1[var_index, t+1] = LOMstate[var_index, var_index] * x1[var_index, t] # just iterate over AR1
    x2[:, t+1] = LOMstate * x2[:, t] # iterate full system but variable of interest should be unaffected by rest of system
end

plt1 = plot(x1[var_index, :], label = &quot;IRF AR1 based&quot;)
plt1 = plot!(x2[var_index, :], label = &quot;IRF matrix based&quot;)"><pre class="notranslate"><span class="pl-k">using</span> Plots, MKL, LinearAlgebra
BLAS<span class="pl-k">.</span><span class="pl-c1">set_num_threads</span>(<span class="pl-c1">2</span>)

var_index <span class="pl-k">=</span> <span class="pl-c1">150</span> <span class="pl-c"><span class="pl-c">#</span> index of variable of interest</span>
LOMstate <span class="pl-k">=</span> <span class="pl-c1">randn</span>(<span class="pl-c1">300</span>, <span class="pl-c1">300</span>) <span class="pl-c"><span class="pl-c">#</span> law of motion</span>
LOMstate[var_index, :] <span class="pl-k">.=</span> <span class="pl-c1">0.0</span> <span class="pl-c"><span class="pl-c">#</span> set the law of motion for the variable of interest to an AR with coefficient 0.9</span>
LOMstate[var_index, var_index] <span class="pl-k">=</span> <span class="pl-c1">0.9</span>

x0 <span class="pl-k">=</span> <span class="pl-c1">zeros</span>(<span class="pl-c1">size</span>(LOMstate, <span class="pl-c1">1</span>), <span class="pl-c1">1</span>)
x0[var_index] <span class="pl-k">=</span> <span class="pl-c1">1.0</span> <span class="pl-c"><span class="pl-c">#</span> shock to the variable of interest</span>

irf_horizon <span class="pl-k">=</span> <span class="pl-c1">40</span>
x1 <span class="pl-k">=</span> x0 <span class="pl-k">*</span> <span class="pl-c1">ones</span>(<span class="pl-c1">1</span>, irf_horizon <span class="pl-k">+</span> <span class="pl-c1">1</span>)
x2 <span class="pl-k">=</span> x0 <span class="pl-k">*</span> <span class="pl-c1">ones</span>(<span class="pl-c1">1</span>, irf_horizon <span class="pl-k">+</span> <span class="pl-c1">1</span>)

<span class="pl-k">for</span> t <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span>irf_horizon
    x1[var_index, t<span class="pl-k">+</span><span class="pl-c1">1</span>] <span class="pl-k">=</span> LOMstate[var_index, var_index] <span class="pl-k">*</span> x1[var_index, t] <span class="pl-c"><span class="pl-c">#</span> just iterate over AR1</span>
    x2[:, t<span class="pl-k">+</span><span class="pl-c1">1</span>] <span class="pl-k">=</span> LOMstate <span class="pl-k">*</span> x2[:, t] <span class="pl-c"><span class="pl-c">#</span> iterate full system but variable of interest should be unaffected by rest of system</span>
<span class="pl-k">end</span>

plt1 <span class="pl-k">=</span> <span class="pl-c1">plot</span>(x1[var_index, :], label <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>IRF AR1 based<span class="pl-pds">"</span></span>)
plt1 <span class="pl-k">=</span> <span class="pl-c1">plot!</span>(x2[var_index, :], label <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>IRF matrix based<span class="pl-pds">"</span></span>)</pre></div>
<p dir="auto">With 1 thread<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12073629/146387732-518a7e85-935c-4bbb-8586-a8e243a1b30c.png"><img width="487" alt="image" src="https://user-images.githubusercontent.com/12073629/146387732-518a7e85-935c-4bbb-8586-a8e243a1b30c.png" style="max-width: 100%;"></a></p>
<p dir="auto">With 2 or more threads (might look different due to random<code class="notranslate">LOMstate</code> matrix)<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12073629/146387872-b9b34506-4a83-431b-a07a-6b8ba4ba604b.png"><img width="495" alt="image" src="https://user-images.githubusercontent.com/12073629/146387872-b9b34506-4a83-431b-a07a-6b8ba4ba604b.png" style="max-width: 100%;"></a></p>
<p dir="auto">My system:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Xeon(R) W-2191B CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 1 "><pre class="notranslate"><code class="notranslate">Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Xeon(R) W-2191B CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 1 
</code></pre></div>
<p dir="auto">I'm happy to provide more information.</p>