Skip to content
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

WISH: cloneNode() - clone a RichSOCKnode #102

Closed
HenrikBengtsson opened this issue Apr 17, 2023 · 0 comments
Closed

WISH: cloneNode() - clone a RichSOCKnode #102

HenrikBengtsson opened this issue Apr 17, 2023 · 0 comments
Milestone

Comments

@HenrikBengtsson
Copy link
Collaborator

HenrikBengtsson commented Apr 17, 2023

Add generic function cloneNode() with implementation for RichSOCKnode, e.g.

library(parallelly)
cl <- makeClusterPSOCK(2L)
node <- cl[[2]]
node
## node of a socket cluster on host 'localhost' with pid 1256882
another_node <- cloneNode(node)
another_node
## node of a socket cluster on host 'localhost' with pid 1256886
cl <- c(cl, another_node)

This would make it possible to restart crashed workers, e.g.

for (kk in seq_along(cl)) {
  node <- cl[[kk]]
  if (!isNodeAlive(node)) {
    node <- cloneNode(node)
    cl[[kk]] <- node
  }
}

For this to work, the RichSOCKnode object needs to record all details on how it was launched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant