Function

NumCosmoMathfunc_eval_threaded_loop_nw

Declaration [src]

void
ncm_func_eval_threaded_loop_nw (
  NcmFuncEvalLoop lfunc,
  glong i,
  glong f,
  gpointer data,
  guint nworkers
)

Description [src]

Splits [i, f) into nworkers contiguous ranges, the first one also taking the remainder, and calls lfunc with data on each range in the pool. Returns after all calls finish. Uses at most f - i workers, and runs a single serial call if the pool has zero threads. Requires f > i and nworkers > 0.

Parameters

lfunc

Type: NcmFuncEvalLoop

Loop function.

i

Type: glong

First index.

f

Type: glong

One past the last index.

data

Type: gpointer

User data.

The argument can be NULL.
The data is owned by the caller of the function.
nworkers

Type: guint

Number of workers.