It looks like two places needed trivial changes (changed from 8 to 16 bit fields). See:
https://github.com/SchedMD/slurm/commit/9bd58eec0b511fb7e054ca87dcb0a65938253f5f


Quoting Janne Blomqvist <[email protected]>:

On 2014-07-07T19:35:37 EEST, Kilian Cavalotti wrote:

Hi,

On Mon, Jul 7, 2014 at 6:01 AM, Michal Mazurek <[email protected]> wrote:
Every time I log in using:
  srun -p xxx -w yyy --pty bash -i
I get a ridiculously small terminal:

I can confirm that behavior. It seems to happen as soon as the initial
terminal is larger than 256 columns.

If cols <= 256, the terminal size is kept:

$ tput cols
179
$ srun --pty bash
node:~$ env | grep PTY_WIN
SLURM_PTY_WIN_ROW=51
SLURM_PTY_WIN_COL=179
node:~$ tput cols
179

If cols > 256, it's overflowed somehow:

$ tput cols
264
$ srun --pty bash
node:~$ env | grep PTY_WIN
SLURM_PTY_WIN_ROW=51
SLURM_PTY_WIN_COL=8
node:~$ tput cols
8

The resulting column size seems to be the original column size modulo 256.

From src/common/env.h (struct env_options):

       uint8_t ws_col;         /* window size, columns */
       uint8_t ws_row;         /* window size, row count */

which explains the modulo 256 (2**8). Looking at my system headers, struct winsize has members of type "unsigned short", which on a common x86(-64) system corresponds to uint16_t. So a fix ought to be simple, although I'm not sure whether there are any issues with the network protocol if the types above are enlarged.



--
Janne Blomqvist, D.Sc. (Tech.), Scientific Computing Specialist
Aalto University School of Science, PHYS & BECS
+358503841576 || [email protected]

Reply via email to