# Stopping a DMRG Run "Gracefully"

+1 vote

Dear all,

I read this post (C++ implementation) on how to stop dmrg sweeps without killing the entire program. Can this be implemented in Julia?

Cheers!

+1 vote

Hi Leandro,

Yes, there is a detailed and nice doc on how to stop early in Julia, using the so-called observer system. I personally have customized my own observer based on this post : )

Best,
Junsen

commented by (70.1k points)
Thanks for answering, Junsen. Yes I agree this is the best way. Leandro: within a custom Observer type as in that documentation, you can use the isfile function within Julia to detect a file such as STOP_DMRG to get the behavior you are asking for.
commented by (130 points)
Thank you very much Junsen for your answer! I'm using the observer but I never started customizing them, now I think it's good time.
commented by (130 points)
Thank you very much Miles!. Perfect, I didn't know that function in Julia.