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: isAlive() #32

Closed
HenrikBengtsson opened this issue Nov 9, 2020 · 0 comments
Closed

WISH: isAlive() #32

HenrikBengtsson opened this issue Nov 9, 2020 · 0 comments
Milestone

Comments

@HenrikBengtsson
Copy link
Owner

HenrikBengtsson commented Nov 9, 2020

Add S3 methods `isAlive() for 'cluster' to check whether or not the R process of a node is still running, e.g.

> cl <- makeClusterPSOCK(4L)
> isAlive(cl)
[1] TRUE TRUE TRUE TRUE
> ans <- clusterEvalQ(cl[3], { quit("no") })
> isAlive(cl)
[1] TRUE TRUE FALSE TRUE

Not all types of 'cluster' support this, or it will be complicated to achieve. For instance, for cluster nodes running on remote machines, we would have to SSH into each of the remote machines and query the process via a remote ps --pid=PID system call.

When not supported for some types of node types, isAlive() could return NA, e.g.

> isAlive(cl)
[1] TRUE NA NA FALSE
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