Hi @marouane1994. You haven’t included enough information to be able to tell why you’re getting that particular error. You might want to have a look at the following post for some tips that will help you update your post in a way that will help us narrow down the source of your problem:
Having said that, here are a few thoughts that might be helpful. First, I could be wrong but it seems like you’re trying your first experiments with threading in julia on a complex example. It would be a good idea to try out threading on some self-contained very simple toy examples so you understand the basics of how threading works before trying to apply it to your existing mcmc code. The examples in the following blog post on threading in julia are a good place to start:
Along with the parallel computing section of the julia manual. Reading through the whole parallel computing manual section is probably a good idea.
Secondly, are you trying to combine distributed memory parallelism and threading? The @everywhere call is used for distributed memory computing. The call
julia> @everywhere include("parallel_mcmc.jl")
will run julia> include("parallel_mcmc.jl")
on all of the julia worker processes attached to your current julia instance. Worker processes are separate julia processes with their own memory address spaces that communicate with the master julia process by passing messages. They are completely separate from threading. So unless you’re mixing distributed memory parallel computing and threading, you’ll want to get rid of the @everywhere statement