-
Notifications
You must be signed in to change notification settings - Fork 27
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
IDEA: A parallel cluster API for clustermq #119
Comments
Good points! I was already looking into this for #109 (with an S3 for the object |
Looking at this again after a long time, I think providing a The reason for this is that, as @HenrikBengtsson said, the S3 methods # parallel:::staticClusterApply
function (cl = NULL, fun, n, argfun)
{
cl <- defaultCluster(cl)
p <- length(cl)
if (n > 0L && p) {
val <- vector("list", n)
start <- 1L
while (start <= n) {
end <- min(n, start + p - 1L)
jobs <- end - start + 1L
for (i in 1:jobs) sendCall(cl[[i]], fun, argfun(start + i - 1L))
val[start:end] <- lapply(cl[1:jobs], recvResult)
start <- start + jobs
}
checkForRemoteErrors(val)
}
} However,
It seems that (2) could be a viable option. |
If so, one need to worry about the different "load-balancing" features of the "cluster" API, e.g. It might very well be that the parallel "cluster" API is not designed to work with such setups. Maybe it was never anticipated in the original design. |
The So we could not support any package that uses those functions. Even if this is not widespread (which it may be) it would cause unexpected failures. |
Just like
parallel::makePSOCKCluster()
sets up aSOCKcluster
object ofSOCKnode
workers, I think it would not be too complicated(*) to provideCMQcluster
andCMQnode
alternatives for clustermq.For instance,
(*) Roughly, S3 methods for generic functions such as
sendCall()
andrecvResult()
and possibly a few more is what needs to be implemented for theQMQnode
class.This would bring the clustermq backend to users/code of the parallel cluster API and thereby lower the mental threshold that some might have for using/migrating to it. It would also make clustermq immediately available to the future framework, e.g.
PS. I realized this while working on the future.clustermq backend - I got a first very-rough prototype of the latter up and running (too early to share or be used).
The text was updated successfully, but these errors were encountered: