How to print loss information immediately on the computer cluster?

I have a problem: when I train my network on the computer cluster, the terminal window don’t print the loss information until one epoch is finished. However, these loss information can be printed immediately on the local computer after given iterations.

So, how to print loss information immediately on the computer cluster? Can anybody help me with this problem? Thanks!

Do you use some kind of logging or just print statements?
If you just use print statements there shouldn’t be a difference.
Could you provide a small script and give some information on the OS running on the server and your local machine?