Parallelize 'seriation' functions
Henrik Bengtsson
Source:vignettes/futurize-81-seriation.md
futurize-81-seriation.Rmd+
=

The futurize package allows you to easily turn
sequential code into parallel code by piping the sequential code to the
futurize() function. Easy!
Introduction
The seriation package provides functions for ordering objects using seriation, ordination techniques for reordering matrices, dissimilarity matrices, and dendrograms.
Example:
Example adopted from
help("seriate_best", package = "seriation"):
library(futurize)
plan(multisession)
library(seriation)
data(SupremeCourt)
d_supreme <- as.dist(SupremeCourt)
o <- seriate_best(d_supreme, criterion = "AR_events") |> futurize()
print(o)This will parallelize the computations, given that we have set up parallel workers, e.g.
plan(multisession)The built-in multisession backend parallelizes on your
local computer and works on all operating systems. There are other parallel
backends to choose from, including alternatives to parallelize
locally as well as distributed across remote machines, e.g.
plan(future.mirai::mirai_multisession)and
plan(future.batchtools::batchtools_slurm)Supported Functions
The following seriation functions are supported by
futurize():