2

I'm running a job in slurm with sbatch.

In job.sh

#!/bin/bash
#SBATCH -o out.txt
python test.py

In test.py I'm printing a lot of intermediate information with print(message +' \r', end='')

I run the job.. sbatch job.sh

However in the output file out.txt will have all the lines, slurm is not respecting the carriage return... Is there anyway to prevent this and make slurm understand carriage return?

user1506145
  • 5,176
  • 11
  • 46
  • 75
  • https://slurm.schedmd.com/faq.html#unbuffered_cr `The libc library used by many programs internally buffers output rather than writing it immediately. This is done for performance reasons. The only way to disable this internal buffering is to configure the program to write to a pseudo terminal (PTY) rather than to a regular file` – Bijay Regmi Sep 20 '22 at 15:25
  • save the output to a log file instead? – Prakhar Sharma Sep 21 '22 at 09:10

0 Answers0