Check whether or not the cluster nodes are alive
A cluster or a cluster node ("worker").
This function works by checking whether the cluster node process is
running or not. This is done by querying the system for its process
ID (PID), which is registered by
makeClusterPSOCK() when the node
starts. If the PID is not known, the NA is returned.
On Unix and macOS, the PID is queried using
system("ps"). On MS Windows,
system2("tasklist") is used,
which may take a long time if there are a lot of processes running.
For details, see the internal
A logical vector of length
length(x) with values
FALSE, TRUE, and NA. If it can be established that the
process for a cluster node is running, then TRUE is returned.
If it does not run, then FALSE is returned.
If neither can be inferred, or it times out, then NA is returned.
parallel::stopCluster() to shut down cluster nodes.
If that's not sufficient,
killNode() may be attempted.
cl <- makeClusterPSOCK(2) ## Check if cluster node #2 is alive print(isNodeAlive(cl[])) ## Check all nodes print(isNodeAlive(cl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.