Rhpc_sapply: Parallel sapply using MPI

Rhpc_sapplyR Documentation

Parallel sapply using MPI

Description

MPI-based version of sapply that distributes work across worker processes.

Usage

Rhpc_sapply(cl = NULL, X, FUN, ...,
            usequote = ifelse(is.logical(getOption("Rhpc.usequote")),
                              getOption("Rhpc.usequote"), TRUE),
            simplify = TRUE,
            USE.NAMES = 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

simplify

logical or character string; if possible, simplify the result to a vector or matrix

USE.NAMES

logical; if TRUE and X is character, use X as names for the result

Details

This function combines the functionality of Rhpc_lapply with automatic simplification of results. When possible, results are simplified to a vector or matrix form rather than remaining as a list.

Value

A simplified version of the result (vector, matrix, or array) or list depending on simplify parameter.

See Also

Rhpc_sapplyLB, Rhpc_lapply, Rhpc_apply


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