I recently installed PyStan from conda-forge in a fresh conda environment on MacOS Mojave 10.14.5. I’m having trouble running multiple chains in parallel (i.e. with
n_jobs > 1). Stan seems to not be able to find the compiled model when
n_jobs > 1, but it has no such problems when
n_jobs = 1. The error is as follows:
Process SpawnPoolWorker-4: Traceback (most recent call last): File "/Users/pbhambhani/misc/ljmu/summer_project/pystan_env/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/Users/pbhambhani/misc/ljmu/summer_project/pystan_env/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/pbhambhani/misc/ljmu/summer_project/pystan_env/lib/python3.8/multiprocessing/pool.py", line 114, in worker task = get() File "/Users/pbhambhani/misc/ljmu/summer_project/pystan_env/lib/python3.8/multiprocessing/queues.py", line 358, in get return _ForkingPickler.loads(res) ModuleNotFoundError: No module named 'stanfit4anon_model_482f7e78a7c2d6f09648bba041f6f372_1939374203243207487'
Python version: 3.8.5
PyStan version: 18.104.22.168
Compiler: clang 9.0.1 - I think this is installed by PyStan, and is different from the default clang version on my system. The latter reads
Apple LLVM version 10.0.1 (clang-1001.0.46.4).
I noticed a couple of warnings related to linking. I am not a c++ expert so I’m not sure if they’re related to this issue I’m facing, but posting them here just in case.
clang-9: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
ld: warning: -pie being ignored. It is only used when linking a main executable
Finally FWIW, I also have scalastan installed on my machine for a different project, and that seems to have no trouble running chains in parallel. That one seems to use cmdstan 2.19.1.
Any help is appreciated. Thanks!