Attach to specific multiprocessing subprocesses via the CLI? #1839
Unanswered
garrett361
asked this question in
Q&A
Replies: 3 comments 5 replies
-
Transferring to a discussion item as this isn't a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah, sorry, thought I submitted it as a discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This launch.json should let you pick any process to debug:
That should let you pick a python process to debug and then inject debugpy into it without you having to add any explicit debugpy code. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to attach to a specific
multiprocessing
subprocess using only thedebugpy
CLI?Example:
with
subProcess = True
I can dopython -m debugpy --listen 5678 --wait-for-client <path-to-file.py>
and then attach to a (seemingly random, but usually rank-zero) process by specifyingport = 5678
and debug that one process. But I can't figure out how to either attach to a specifc process or get any of the other ranks to step through their code.Is it possible to achieve this just through the CLI?
One thing that does work is to explicitly insert the
debugpy
API calls into the source code:Just calling
python <path-to-file.py>
, I can attach to any port in{5678, 5679, 5680, 5681}
and connect to the expected rank. But, it would be great if there were a way to achieve this without needing to change the source code.Beta Was this translation helpful? Give feedback.
All reactions