简体   繁体   中英

Race condition with scipy.weave.inline

Recently I've begun to receive SyntaxError s when running parallel neural-network simulations using brian2 . These are being raised by calls to scipy.weave.inline when it tries to evaluate lines of code in a cache file.

The full description of the problem and my guess at its cause is here .

And here is a link to a related question I asked earlier, with a full stacktrace for one of the errors. My answer to that question provides just a temporary solution. (Syntax errors are re-introduced as soon as a new set of parallel runs is executed.)

Is there an easy way for me to avoid this race condition?

This appears to be a known bug in scipy : See this and this discussion on github . Some workarounds are suggested in these discussions:

1) Execute a single run of the script -- so that the cache file is filled -- and then execute the other runs in parallel. The parallel runs will not try to re-fill the cache.

2) Make a symbolic link from /tmp to ~/.python27_compiled . (I'm not sure why this would work.)

3) Use cython instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM