petsc-master 2015-01-31
Report Typos and Errors


Gets pointers to locations for storing three PetscInts that may be passed to PetscThreadCommRunKernel to ensure that the scalar values remain valid even after the main thread exits the calling function.


#include "petscthreadcomm.h" 
PetscErrorCode PetscThreadCommGetInts(MPI_Comm comm,PetscInt **val1, PetscInt **val2, PetscInt **val3)

Input Parameters

comm - the MPI communicator having the thread communicator
val1 - pointer to store the first integer value
val2 - pointer to store the second integer value
val3 - pointer to store the third integer value


This is a utility function to ensure that any scalars passed to PetscThreadCommRunKernel remain valid even after the main thread exits the calling function. If any scalars need to passed to PetscThreadCommRunKernel then these should be first stored in the locations provided by PetscThreadCommGetInts()

Pass NULL if any pointers are not needed.

Called by the main thread only, not from within kernels

Typical usage

PetscScalar *valptr; PetscThreadCommGetScalars(comm,&valptr,NULL,NULL); *valptr = alpha; (alpha is the scalar you wish to pass in PetscThreadCommRunKernel)


See Also


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