Critical conditions for the ignition of magnesium