futureLapplyHet {xegaPopulation} | R Documentation |
Future apply of R-package future.apply
configured
for a tasks with heterogenous execution times.
Description
The lapply()
function is redefined as as
future.apply::future_lapply()
.
Henrik Bengtsson recommends that the configuration of the parallel/distributed programming environment should be kept outside the package and left to the user. The advantage is that the user may take advantage of all parallel/distributed available backends for the Future API.
Usage
futureLapplyHet(pop, EvalGene, lF)
Arguments
pop |
Population of genes. |
EvalGene |
Function for evaluating a gene. |
lF |
Local function factory which provides
all functions needed in |
Details
This configuration has an increased communication and synchronization overhead.
Value
Fitness vector.
References
Bengtsson H (2021). “A Unifying Framework for Parallel and Distributed Processing in R using Futures.” The R Journal, 13(2), 208–227. <doi:10.32614/RJ-2021-048>
See Also
Other Execution Model:
MClapply()
,
MClapplyHet()
,
PparLapply()
,
PparLapplyHet()
,
futureLapply()
Examples
pop<-xegaInitPopulation(30, lFxegaGaGene)
library(future)
plan(multisession, workers=2)
popnew<-futureLapplyHet(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
plan(sequential)