# Can not use more than 1 core

**URL:** <https://discourse.pymc.io/t/can-not-use-more-than-1-core/7006>\
**Category:** Questions\
**Created:** [March 16, 2021, 4:35pm UTC](https://discourse.pymc.io/t/can-not-use-more-than-1-core/7006 "2021-03-16T16:35:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arsl](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@Arsl](https://discourse.pymc.io/u/Arsl)\
**Post date:** [March 16, 2021, 4:35pm UTC](https://discourse.pymc.io/t/can-not-use-more-than-1-core/7006/1 "2021-03-16T16:35:02Z")

</div>

For a simple model  
when use this code  
with pm.Model() as cs\_nh:  
μ = pm.Normal(‘μ’, mu=0, sd=10, shape=groups)  
σ = pm.HalfNormal(‘σ’, sd=10, shape=groups)  
y = pm.Normal(‘y’, mu=μ[idx], sd=σ[idx], observed=diff)  
**trace\_cs\_nh = pm.sample(1000)**

I get an error . See the picture attached.  
The code runs when i use only one core with  
**trace\_cs\_nh = pm.sample(1000,cores=1)**

The view of the error

 ![grafik](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/6/6b3577dc2c76360c9d071dda25e8deedc4b05697.png)

---

<div class="post-metadata">

**Author:** ![cluhmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cluhmann/32/3083_2.png) [@cluhmann](https://discourse.pymc.io/u/cluhmann)\
**Post date:** [March 16, 2021, 4:56pm UTC](https://discourse.pymc.io/t/can-not-use-more-than-1-core/7006/2 "2021-03-16T16:56:59Z")

</div>

OS? PyMC3/Aesara/python versions? There have been some multithreading issues on Windows, though I am unsure of the status.

> <https://github.com/pymc-devs/pymc3/issues/3140>
>
> Since PR #3011 I have been having troubles sampling multiple chains with multiple cores. In Jupyter notebook I get random kernel...

> <https://github.com/pymc-devs/pymc3/issues/3403>
>
> I’m not sure how to reproduce it, but oftentimes, depending on the type of model and random seed, pymc3’s NUTS sampler...

> <https://github.com/pymc-devs/pymc3/issues/4167>
>
> Description of your problem
> I am getting this exception whenever I try to sample with more than one core.
> Please provide a minimal,...
