<div dir="ltr">Hello all,<div><br></div><div>I've noticed an odd behaviour with job steps in some Slurm environments. When a script is launched directly as a job, the output is written to file immediately. When the script is launched as a step in a job, output is written in ~30 second chunks. This doesn't happen in all Slurm environments, but if it happens in one, it seems to always happen. For example, on my local development cluster, which is a single node on Ubuntu 18, I don't experience this. On a large Centos 7 based cluster, I do.<br><br>Below is a simple reproducible example:<br><br>loop.sh:</div><div><font face="monospace">#!/bin/bash</font></div><div><font face="monospace">for i in {1..100}</font></div><div><font face="monospace">do</font></div><div><font face="monospace">   echo $i</font></div><div><font face="monospace">   sleep 1</font></div><div><font face="monospace">done</font></div><div><font face="monospace"><br></font></div><div>withsteps.sh:</div><div><font face="monospace">#!/bin/bash</font></div><div><font face="monospace">srun ./loop.sh</font></div><div><div><br></div><div>Then from the command line running <font face="monospace">sbatch loop.sh</font><font face="arial, sans-serif"> followed by </font><font face="monospace">tail -f slurm-<job #>.out</font><font face="arial, sans-serif"> prints the job output in smaller chunks, which appears to be related to file system buffering or the time it takes for the </font><font face="monospace">tail</font><font face="arial, sans-serif"> process to notice that the file has updated. Running </font><font face="monospace">cat</font><font face="arial, sans-serif"> on the file every second shows that the output is in the file immediately after it is emitted by the script.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">If you run </font><font face="monospace">sbatch withsteps.sh</font><font face="arial, sans-serif"> instead, </font><font face="monospace">tail</font><font face="arial, sans-serif">-ing or repeatedly </font><font face="monospace">cat-</font><font face="arial, sans-serif">ing</font><font face="arial, sans-serif"> the output file will show that the job output is written in a chunk of 30 - 35 lines.</font></div><div><br></div><div>I'm hoping this is something that is possible to work around, potentially related to an OS setting, the way Slurm was compiled, or a Slurm setting.</div><div><br></div>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div>Thanks,<br></div>Maria<br></div></div></div></div>