FNSetParallel — SLEPc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# FNSetParallel

Selects the mode of operation in parallel runs.

## Synopsis

    #include "slepcfn.h"
    PetscErrorCode FNSetParallel(FN fn,FNParallelType pmode)

Logically Collective

## Input Parameters

- fn - the math function context

- pmode - the parallel mode

## Options Database Key

- -fn_parallel (redundant|synchronized) - sets the parallel mode

## Notes

This is relevant only when the function is evaluated on a matrix, with either `FNEvaluateFunctionMat()` or `FNEvaluateFunctionMatVec()`.

In the `redundant` parallel mode, all processes will make the computation redundantly, starting from the same data, and producing the same result. This result may be slightly different in the different processes if using a multithreaded BLAS library, which may cause issues in ill-conditioned problems.

In the `synchronized` parallel mode, only the first MPI process performs the computation and then the computed matrix is broadcast to the other processes in the communicator. This communication is done automatically at the end of `FNEvaluateFunctionMat()` or `FNEvaluateFunctionMatVec()`.

## See Also

FN: Mathematical Functions, `FNEvaluateFunctionMat()`, `FNEvaluateFunctionMatVec()`, `FNGetParallel()`

## Level

advanced

## Location

src/sys/classes/fn/interface/fnbasic.c

Index of all FN routines Table of Contents for all manual pages Index of all manual pages