#include <petscmath.h> type max PetscMax(type v1,type v2)
Notes: type can be integer or floating point value