-
Notifications
You must be signed in to change notification settings - Fork 8
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
Multiple client sockets #23
Comments
The way I imagine it, I would have multiple sockets on the client, each with the same IP address but different ephemeral ports (which I would get from |
Conceptually it would be as easy as making However, please tell me exactly what you envisage - just "cpu" and "gpu", or fully flexible number of sockets? As this change is now on the critical path, I would want to think about the most efficient implementation. |
I am thinking fully flexible sockets because there is an enormous variety of situations where different tasks require different server types: not only GPUs, but also 1-core vs 4-core machines, different amounts of memory, etc. I would like to take responsibility to handle most of this complexity with As an attempted workaround, I tried creating and switching out multiple sockets myself, but I found that library(mirai)
daemons("tcp://xx.xx.xx.138:5000") # let's say this socket connects to expensive high-memory 4-core servers
socket1 <- environment(daemons)$sock
daemons("tcp://xx.xx.xx.94:8888") # let's say this socket connects to cheaper low-memory 1-core servers
socket2 <- environment(daemons)$sock
# ... submit some tasks ...
environment(daemons)$sock <- socket1 # switch back to socket1
daemons(0) # does not reliably close servers listening to tcp://xx.xx.xx.138:5000
environment(daemons)$sock <- socket2 # switch back to socket2
daemons(0) # does not reliably close servers listening to tcp://xx.xx.xx.94:8888 If there could be a convenient way to get the socket created by |
Interesting hackish way of getting to the sockets. You have the right idea. Just when you call |
It's done in 0.7.2.9009 (commit 3828506) - simply specify the Btw. thanks for the suggestions and testing out the new features - I have added a special mention in the changelog! |
Fantastic! I will try it out once the r-universe builds complete. |
Tried it out (installing from the source on my company's SGE cluster). Works beautifully! |
Absolutely, and thanks for the mention! I hope it is okay that I ask so many questions. |
I am developing a branch of
crew
based on https://github.com/shikokuchuo/mirai#example-1-connecting-to-remote-servers--remote-server-queues, and I am really optimistic about how it will turn out. Currently, however, building onmirai
instead ofrrq
makes it difficult to implement heterogeneous workers to accommodate tasks with varying resource requirements (wlandau/crew#23).Would you be willing to consider support for multiple concurrent client sockets instead of just the current one stored in
environment(daemons)$sock
? I would be fine with managing multiple socket objects and supplying the right ones tomirai()
anddaemons()
as needed.The text was updated successfully, but these errors were encountered: