Outputting to console / SLURM log files in real time

I’m running julia scripts on a SLURM server in batch mode (julia my_script.jl). SLURM creates output files with the output that julia is sending to the console, but I’m finding that while warnings are output in real time, print statements I add (just so I can keep track of progress and keep an eye on what steps are taking most time) don’t get output till the script finishes.

Is there a way to get print statements to output faster?

(Sorry, I know this might be a SLURM issue, but given warnings are output in real time, I think it’s a julia thing…)

Warnings are printed to stderr while print statements are printed to stdout.

Perhaps try How to change how frequently SLURM updates the output file (stdout)? - Stack Overflow or flush(stdout) in your program.

2 Likes

perfect, thanks! (though for future readers: it’s flush(STDOUT), not flush(stdout)

Sorry, on 0.7 it is flush(stdout) :slight_smile: