Actual source code: nothread.c

petsc-3.3-p5 2012-12-01
  1: #include <../src/sys/threadcomm/impls/nothread/nothreadimpl.h>

  3: EXTERN_C_BEGIN
  6: PetscErrorCode PetscThreadCommCreate_NoThread(PetscThreadComm tcomm)
  7: {

 11:   if(tcomm->nworkThreads != 1) SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_ARG_WRONG,"Cannot have more than 1 thread for the nonthread communicator,threads requested = %D",tcomm->nworkThreads);
 12:   PetscStrcpy(tcomm->type,NOTHREAD);
 13:   tcomm->ops->runkernel = PetscThreadCommRunKernel_NoThread;
 14:   return(0);
 15: }
 16: EXTERN_C_END
 17: 
 20: PetscErrorCode PetscThreadCommRunKernel_NoThread(MPI_Comm comm,PetscThreadCommJobCtx job)
 21: {

 25:   PetscRunKernel(0,job->nargs,job);
 26:   return(0);
 27: }
 28: