self-flagellation
the disciplinary and devotional practice of flogging oneself with whips or other instruments that inflict pain. In Christianity, self-flagellation is practiced in the context of the doctrine of the mortification of the flesh and is seen as a spiritual discipline --wikipedia