petsc-master 2014-10-30
Report Typos and Errors

PetscThreadCommRunKernel

Runs the kernel using the thread communicator associated with the MPI communicator

Synopsis

#include "petscthreadcomm.h" 
PetscErrorCode PetscThreadCommRunKernel(MPI_Comm comm,PetscErrorCode (*func)(PetscInt,...),PetscInt nargs,...)
Not Collective

Input Parameters

comm - the MPI communicator
func - the kernel (needs to be cast to PetscThreadKernel)
nargs - Number of input arguments for the kernel
... - variable list of input arguments

Notes

All input arguments to the kernel must be passed by reference, Petsc objects are inherrently passed by reference so you don't need to additionally & them.

Example usage - PetscThreadCommRunKernel(comm,(PetscThreadKernel)kernel_func,3,x,y,z); with kernel_func declared as PetscErrorCode kernel_func(PetscInt thread_id,PetscInt* x, PetscScalar* y, PetscReal* z)

The first input argument of kernel_func, thread_id, is the thread rank. This is passed implicitly by PETSc.

See Also

PetscThreadCommCreate(), PetscThreadCommGNThreads()

Level:developer
Location:
src/sys/threadcomm/interface/threadcomm.c
Index of all PetscThreadComm routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sys/threadcomm/examples/tutorials/ex1.c.html
src/sys/threadcomm/examples/tutorials/ex2.c.html
src/sys/threadcomm/examples/tutorials/ex3.c.html
src/sys/threadcomm/examples/tutorials/ex5.c.html