Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Progress bar doesn't work correctly under MPI #3538

Open
2 tasks done
jwnki opened this issue Oct 24, 2024 · 2 comments
Open
2 tasks done

[BUG] Progress bar doesn't work correctly under MPI #3538

jwnki opened this issue Oct 24, 2024 · 2 comments

Comments

@jwnki
Copy link

jwnki commented Oct 24, 2024

Describe the bug

When using rich with MPI the progress bar doesn't work correctly.
To reproduce:

  1. mpirun -n 1 python -m rich.progress
  2. press ctrl+c

The results differ depending on which mpi implementation one uses.

  • openmpi (4.1.6): the program exits without new line and no cursor visible (see screenshot below)
  • mpich (4.1.2): no progress bar can be seen at all

Note that under openmpi this is not related to this closed issue, because running mpirun -n 1 python -c "import shutil; print(shutil.get_terminal_size())" returns correct values.

scrt

I first discovered this when running pymc (5.17). Running a sampler with mpirun results in no progress bar visible until the sampler finishes. I believe this is related to the issue described above.

Platform

Click to expand

What platform (Win/Linux/Mac) are you running on? What terminal software are you using?

I'm on nixos. This was tested on kitty terminal (and partially on xterm).

I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.

If you're using Rich in a terminal:

python -m rich.diagnose

╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface.                                                  │
│                                                                                  │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=175 ColorSystem.TRUECOLOR>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                  │
│     color_system = 'truecolor'                                                   │
│         encoding = 'utf-8'                                                       │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│           height = 48                                                            │
│    is_alt_screen = False                                                         │
│ is_dumb_terminal = False                                                         │
│   is_interactive = True                                                          │
│       is_jupyter = False                                                         │
│      is_terminal = True                                                          │
│   legacy_windows = False                                                         │
│         no_color = False                                                         │
│          options = ConsoleOptions(                                               │
│                        size=ConsoleDimensions(width=175, height=48),             │
│                        legacy_windows=False,                                     │
│                        min_width=1,                                              │
│                        max_width=175,                                            │
│                        is_terminal=True,                                         │
│                        encoding='utf-8',                                         │
│                        max_height=48,                                            │
│                        justify=None,                                             │
│                        overflow=None,                                            │
│                        no_wrap=False,                                            │
│                        highlight=None,                                           │
│                        markup=None,                                              │
│                        height=None                                               │
│                    )                                                             │
│            quiet = False                                                         │
│           record = False                                                         │
│         safe_box = True                                                          │
│             size = ConsoleDimensions(width=175, height=48)                       │
│        soft_wrap = False                                                         │
│           stderr = False                                                         │
│            style = None                                                          │
│         tab_size = 8                                                             │
│            width = 175                                                           │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮
│ Windows features available.                           │
│                                                       │
│ ╭───────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ ╰───────────────────────────────────────────────────╯ │
│                                                       │
│ truecolor = False                                     │
│        vt = False                                     │
╰───────────────────────────────────────────────────────╯
╭────── Environment Variables ───────╮
│ {                                  │
│     'TERM': 'xterm-kitty',         │
│     'COLORTERM': 'truecolor',      │
│     'CLICOLOR': None,              │
│     'NO_COLOR': None,              │
│     'TERM_PROGRAM': None,          │
│     'COLUMNS': None,               │
│     'LINES': None,                 │
│     'JUPYTER_COLUMNS': None,       │
│     'JUPYTER_LINES': None,         │
│     'JPY_PARENT_PID': None,        │
│     'VSCODE_VERBOSE_LOGGING': None │
│ }                                  │
╰────────────────────────────────────╯
pip freeze | grep rich
rich @ file:///home/conda/feedstock_root/build_artifacts/rich_1729622917073/work/dist
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

I see nothing which suggests the problem is with Rich. I'd suggest you report this to the other projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants