Capturing stdout with slurm
See original GitHub issueWe’ve been running our experiments with the slurm
scheduler which captures stdout and stdin and pipes them to a file. This seems to confuse sacred
, which doesn’t capture stdout in this case.
Easiest solution by far would be just telling sacred where to look for stdout. Is there a way to do that?
Thanks! A
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How do I redirect stdout/stderr in my SLURM job scripts? - Ask
I submit a job in a slurm cluster and all output and error messages go into the same file. Is there a way...
Read more >SLURM display the stdout and stderr of an unfinished job
I ran my job with sbatch and a bash script that has a few slurm parameters, loads a few modules, cd and then...
Read more >Handling job output | Division of Information Technology
One simple method for handling the output of your job is redirecting the program output directly in your bash script (the .slurm file...
Read more >Submitting SLURM jobs with STDOUT & STDERR written ...
This article will show you how to refer the SLURM jobs id in the sbatch job script to redirect STDOUT and STDERR to...
Read more >Knowledge Base: Bell User Guide: Checking Job Output
SLURM catches output written to standard output and standard error - what would be printed to your screen if you ran your program...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ohh, I found the problem: Sys-based capturing relies on replacing
sys.stdout
andsys.stderr
with custom wrappers. But theStreamHandler
still maintains a copy of the oldsys.stderr
and logs to that. So in fact any Sacred experiment that uses capture modesys
looses their logging. That is clearly a problem!You might be able to work around it with something like this, which should give you most logs (except for the “experiment started” logs):
I have to think about how to best fix this problem in a clean way. Let me know if you have any thoughts on this, especially also concerning the general integration of sacred with logging, since I am not entirely happy with the way it is currently done.
That is an interesting case I hadn’t thought about. So far this is not possible, no. If you are fine with only capturing stdout from within python, you could try to set the capture mode to
sys
. My guess is that this wouldn’t be affected by stdout redirects:But I’ll mark this as a feature request nonetheless.