Rhpc_lapplyLB: Parallel lapply with load balancing

View source: R/Rhpc.R

Rhpc_lapplyLBR Documentation

Parallel lapply with load balancing

Description

MPI-based version of lapply with load balancing for better performance on heterogeneous systems.

Usage

Rhpc_lapplyLB(cl, X, FUN, ...,
              usequote = ifelse(is.logical(getOption("Rhpc.usequote")),
                                getOption("Rhpc.usequote"), TRUE))

Arguments

cl

external pointer to MPI communicator

X

vector or list to be processed

FUN

function to apply to each element of X

...

additional arguments passed to FUN

usequote

logical; if FALSE, quote handling is skipped for performance improvement

Details

This function distributes work to workers using a load-balancing approach. Workers receive tasks dynamically as they become available, which can provide better performance when task execution times vary significantly.

Results are collected and returned in a list maintaining the original order.

Value

A list with results from applying FUN to each element of X.

See Also

Rhpc_lapply, Rhpc_sapplyLB, Rhpc_apply


Rhpc documentation built on Aug. 4, 2026, 1:07 a.m.