# JIT decorated function fails compiling with "parallel=True"

**URL:** <https://numba.discourse.group/t/jit-decorated-function-fails-compiling-with-parallel-true/793>\
**Category:** Support: What is this error message?\
**Created:** [July 7, 2021, 3:30pm UTC](https://numba.discourse.group/t/jit-decorated-function-fails-compiling-with-parallel-true/793 "2021-07-07T15:30:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krono86](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/krono86/32/352_2.png) [@krono86](https://numba.discourse.group/u/krono86)\
**Post date:** [July 7, 2021, 3:30pm UTC](https://numba.discourse.group/t/jit-decorated-function-fails-compiling-with-parallel-true/793/1 "2021-07-07T15:30:00Z")

</div>

I’m trying to accelerate my code using numba.  
I wrote a jit decorated function that is correctly compiled when “parallel=False”, but it doesn’t when “parallel=True”.

This is my function:

```auto
@jit(nopython=True, parallel=True, cache=True)
def I_obj_func(y_bar,ni,beta):
    I_func = np.empty((2,beta.shape[0]),dtype=np.float64)
    for k in prange(2):
        D_a_k_conj_diag = np.exp(-1j*2*np.pi/P*ni[k]*np.arange(P))
        Ryy_conj_cycl_tmp = np.zeros((P,P), dtype=np.complex128)
        for j in prange(J):
            for r in prange(-1,2):
                Ryy_conj_cycl_tmp += np.exp(1j*2*np.pi*ni[k]*r)*cycl_conj_corr(y_bar[j],2*ni[k],r)
        Phi_a_k = np.expand_dims(D_a_k_conj_diag,-1) * Ryy_conj_cycl_tmp * D_a_k_conj_diag
        phi_a_k = np.diag(W_p.conj().T @ Phi_a_k @ W_p.conj())
        tmp = phi_a_k[:P//2]*upsilon.conj()[:P//2]
        for idx in prange(beta.shape[0]):
            I_func[k,idx] = np.abs(np.sum(tmp*np.exp(1j*4*np.pi/Ts*beta[idx]*np.arange(P//2))))
    return I_func

```

and this is the compilation error:

```auto
LoweringError: '$push_global_to_block.74504'

```

Please, let me know If you need more information.  
Thanks a lot.

Ivan

---

<div class="post-metadata">

**Author:** ![stuartarchibald](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/stuartarchibald/32/10_2.png) [@stuartarchibald](https://numba.discourse.group/u/stuartarchibald)\
**Post date:** [July 16, 2021, 9:51am UTC](https://numba.discourse.group/t/jit-decorated-function-fails-compiling-with-parallel-true/793/2 "2021-07-16T09:51:04Z")

</div>

Hi @krono86,

Thanks for reporting this, looks like a bug. I’ve opened a ticket to track: [parfors lowering error from missing entry in varmap · Issue #7213 · numba/numba · GitHub](https://github.com/numba/numba/issues/7213)

---

<div class="post-metadata">

**Author:** ![DrTodd13](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/drtodd13/32/51_2.png) [@DrTodd13](https://numba.discourse.group/u/DrTodd13)\
**Post date:** [July 23, 2021, 7:55pm UTC](https://numba.discourse.group/t/jit-decorated-function-fails-compiling-with-parallel-true/793/3 "2021-07-23T19:55:06Z")

</div>

@krono86 I have fixed the error that you were seeing. However, even after that fix, your code is not going to work because currently, parallel=True does not support broadcasting, which your code uses. Right now, to use parallel=True you are going to have to write your code such that it does the broadcast manually as NumPy’s broadcast\_to function is also not supported by Numba.
