Commit 03e156c5 authored by Dorian Krause's avatar Dorian Krause Committed by Morris Jette
Browse files

srun: Enable output processing on stdout in pty mode

Dear all,

we noticed that debugX() and error() calls in srun mess up the output if the --pty flag is used. The reason for this behavior is that srun sets the terminal in raw mode and disables output processing. This is fine for the output forwarded from the remote damon but not for local printf()s by the srun process. This problem can be circumented by re-enabling OPOST after the cfmakeraw() call in srun(). A patch is pasted at the bottom of the mail. It works nicely on Linux but I am not 100% sure it may not have some undesirable side effects on other platforms.

Best regards,
Dorian

Example with current HEAD:

[snip]
srun: jobid 10: nodes(1):`node1', cpu counts: 1(x1)
srun: launching 10.0 on host node1, 1 tasks: 0
                                              srun: route default plugin loaded
                                                                               srun: Node node1, 1 tasks started
                                                                                                                srun: Received task exit notification for 1 task (status=0x0100).
                                         srun: error: node1: task 0: Exited with exit code 1
                                                                                            #
Example with the patch applied:

[snip]
 srun: jobid 11: nodes(1):`node1', cpu counts: 1(x1)
srun: launching 11.0 on host node1, 1 tasks: 0
srun: route default plugin loaded
srun: Node node1, 1 tasks started
srun: Received task exit notification for 1 task (status=0x0100).
srun: error: node1: task 0: Exited with exit code 1
parent bb2c84c6
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment