MPI and OpenMP have its own advantages and limitations.OpenMP is relatively easy to implement and involves few pragma directives to achieve desired tasks. OpenMP may be used in recursive be well i.e as traversing in binary tree. Nonetheless it suffers from problem of memory limitations for memory intensive calculations.
MPI usually serve those problem well which involve large memory. With MPI 3 , shared memory advantage can be properly used within MPI too. Also it’s possible to use OpenMP with MPI i.e for shared memory in targeted platform OpenMP may be used whereas for distributed one, MPI may be used.