materialize | R Documentation |
FlashR lazily evaluates many operations and outputs virtual objects
that represent computation results. fm.materialize.list
and
fm.materialize
explicitly materialize the virtualized computation
and save the computation results to memory or disks. Materialization of
these virtualized computations triggers materialization of other virtualized
computation. By default, FlashR only saves the computation results
specified by the arguments of fm.materialize.list
and
fm.materialize
. fm.set.cached
changes the default behavior and
notifies FlashR to save the materialized computation results of a virtual
matrix in memory or on disks.
fm.materialize.list(args) fm.materialize(...) fm.set.cached(fm, cached, in.mem = fm.in.mem(fm))
args |
a list of virtual FlashR objects. |
... |
a list of virtual FlashR objects. |
fm |
a FlashR object. |
in.mem |
a logical value, indicating whether to save the computation results in memory. |
a list of materialized compuation results.
mat <- fm.mapply2(fm.runif.matrix(100, 10), fm.runif.matrix(100, 10), "+") mat <- fm.materialize(mat) mat2 <- fm.sapply(fm.runif.matrix(100, 10), "sqrt") mat.list <- list(mat, mat2) mat.list <- fm.materialize.list(mat.list) mat <- fm.mapply2(fm.runif.matrix(100, 10), fm.runif.matrix(100, 10), "+") fm.set.cached(mat, TRUE) res <- fm.agg(mat, "+")