Pm.sample gets stuck after init with cores > 1

Almost what you said. When I did this, I was running on an sge managed cluster, so I submitted a job array where a called my python script and passed the job’s id as a command line argument: python my_script.py $job_id
Then, in my python script I grabbed the job id from sys.argvand used that to set the random_seed I passed to pm.sample. This approach will deploy as many independent processes as chains, and they will run in parallel, managed by the cluster’s manager or by your computers operating system.
You would also have to write a separate script for post processing, where you merge the multiple chains together and use them for whatever it is you actually want.

2 Likes