Rhpc_worker_call: Call a function on worker processes

View source: R/Rhpc.R

Rhpc_worker_callR Documentation

Call a function on worker processes

Description

Executes a function on all worker processes and collects the results.

Usage

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

Arguments

cl

external pointer to MPI communicator

FUN

function or string naming the function to be called on workers

...

arguments to pass to FUN

usequote

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

Details

This function broadcasts a function call to all worker processes and waits for results. Results from all workers are collected and returned.

The function or its name is sent to workers via collective communication only on the first call; subsequent calls with the same function reuse the cached version.

Value

Results collected from all worker processes.

See Also

Rhpc_worker_noback, Rhpc_lapply, Rhpc_EvalQ


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