/*************************************************************************************
 *    M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S     *
 *************************************************************************************
 *    authors: Bas van 't Hof, Koos Huijssen, Christiaan M. Klaij                    *
 *************************************************************************************
 *    content: Support for nested PetscTimers                                        *
 *************************************************************************************/

#include <petsclog.h> 

/*****************************************************************/
#undef __FUNCT__
#define __FUNCT__ "PetscAdminSend"
PetscErrorCode PetscAdminSend(int count, int datatype) {
  PetscErrorCode    ierr;
  PetscFunctionBegin;
  petsc_send_ct++;
  ierr = PetscMPITypeSize(&petsc_send_len,count, MPI_Type_f2c((MPI_Fint) datatype)); CHKERRQ(ierr);
  PetscFunctionReturn(0);
}

/*****************************************************************/
#undef __FUNCT__
#define __FUNCT__ "PetscAdminRecv"
PetscErrorCode PetscAdminRecv(int count, int datatype) {
  PetscErrorCode    ierr;
  PetscFunctionBegin;
  petsc_recv_ct++;
  ierr = PetscMPITypeSize(&petsc_recv_len,count, MPI_Type_f2c((MPI_Fint) datatype)); CHKERRQ(ierr);
  PetscFunctionReturn(0);
}

/*****************************************************************/
#undef __FUNCT__
#define __FUNCT__ "PetscAdminReduce"
PetscErrorCode PetscAdminReduce() {
  PetscFunctionBegin;
  petsc_allreduce_ct++;
  PetscFunctionReturn(0);
}
