-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error while attempting to bind on address, address already in use #315
Comments
Thanks for the report. I'm not sure anyone intended to support the use of pystan in this manner. The provided code is a little fishy -- you could simply run It's difficult to predict the order of execution when using |
The reason why I run things in parallel, is that my likelihood calculation is very slow, so I've decided to split the data and use many cores that I have to distributie the likelihood/gradient calculations over cores and do HMC myself using littlemcmc. (map_rect is too much pain to use). Regarding multprocessing, on linux it uses processes not threads. And in my actual problem what I have is 36 datasets and run them over my 36 processes in a pool and then accumulate gradients/likelihoods. The order does not matter for me. |
As a temporary stopgap fix I've just put this in stan/common.py
so it'd try 10 times before bailing out, but that's just a hack. |
That's a good idea. I suspect others encountering this issue can copy this.
…
As a temporary stopgap fix I've just put this in stan/common.py
` for i in range(10):
try:
host, port = "127.0.0.1", unused_tcp_port()
site = aiohttp.web.TCPSite(self.runner, host, port)
await site.start()
break
except OSError:
continue
`
so it'd try 10 times before bailing out, but that's just a hack.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#315 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJQUBVRLV6OHFK3VWSOZ2ULTYQW2BANCNFSM5ATXHF6A>.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When running multiple pystan instances in parallel, (specifically I'm directly calling
.log_prob() on subsets of the data in parallel).
there is an error caused by port allocation of httpstan.
Basically if I understand correctly, the port is returned by unused_tcp_port(), but it could
easily get stolen by a parallel httpstan instance
Describe your system
Linux, Ubuntu 20.04, 64bit, gcc-9.3
Steps/Code to Reproduce
The following code does not do anything useful but triggers the bug
The text was updated successfully, but these errors were encountered: