  In this paper, we prove a nonabelian Hodge correspondence for principal
bundles on a smooth variety $X$ in positive characteristic, which generalizes
the Ogus-Vologodsky correspondence for vector bundles. Then we extend the
correspondence to logahoric torsors over a log pair $(X,D)$, where $D$ a
reduced normal crossing divisor in $X$. As an intermediate step, we prove a
correspondence between principal bundles on root stacks $\mathscr{X}$ and
parahoric torsors on $(X,D)$, which generalizes the correspondence on curves
given by Balaji--Seshadri to higher dimensional case.
