  This paper describes an energy-preserving and globally time-reversible code
for weakly compressible smoothed particle hydrodynamics (SPH). We do not add
any additional dynamics to the Monaghan's original SPH scheme at the level of
ordinary differential equation, but we show how to discretize the equations by
using a corrected expression for density and by invoking a symplectic
integrator. Moreover, to achieve the global-in-time reversibility, we have to
correct the initial state, implement a conservative fluid-wall interaction, and
use the fixed-point arithmetic. Although the numerical scheme is reversible
globally in time (solvable backwards in time while recovering the initial
conditions), we observe thermalization of the particle velocities and growth of
the Boltzmann entropy. In other words, when we do not see all the possible
details, as in the Boltzmann entropy, which depends only on the one-particle
distribution function, we observe the emergence of the second law of
thermodynamics (irreversible behavior) from purely reversible dynamics.
