saving_freq = 0 means no saving