Skip to content

DEPRECATION: local=FALSE and persistent=TRUE #382

@HenrikBengtsson

Description

@HenrikBengtsson

I'm planning to phase out support for local = FALSE and possibly also persistent = TRUE on cluster futures. I'm posting this issue to clarify that this is on the roadmap and to provide a location for discussion this move. If someone out there make use of local = FALSE or persistent = TRUE, I'd like to hear how and why. It might be that one solution is to provide workarounds with future backend solutions that support these but are not fully compliant to the Future API.

The main reason for deprecating local = FALSE is that it may affect the results and it is not supported by all backend. This is not safe because as a developer you don't know what backend the end-user will use and as an end-user you might break the developer's intentions if you set it for a backend. It was added to the Future API in the early days during its "experimental" phase. Also, keeping support for argument local prevents further development of the Future API.

The main reason for persistent = TRUE is it's use in remote futures where you want to control a remote R session as if it was your main one, but control it from your local one. An example of this can be seen in https://cran.r-project.org/web/packages/future/vignettes/future-3-topologies.html. I also think that some people use

cl <- future::makeClusterPSOCK(...)
plan(cluster, workers = cl, persistent =TRUE)
parallel::clusterExport(cl, c("some", "large", "global", "objects"))

to avoid large objects being exported/transferred each time some "heavy" future are launched. If this is a common use case, please note that I've got some ideas on adding support for sticky globals (#339 (comment)). For this to work across the board and with all backends, this feature needs to be optional, i.e. globals are sticky and cached on workers if supported and up-to-date, otherwise they are re-exported. With support for the latter, the need of the above kind of persistent = TRUE is less needed. Support for persistent = TRUE is a bit of a hack and like local it blocks taking the Future API to the next level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backend APIPart of the Future API that only backend package developers rely onFrontend APIPart of the Future API that users of futures rely oncluster (PSOCK)help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions