-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add debug_remote_on_single_rank (#498)
* Move management of current debuggers into Debugger class * Move term_size heuristic to RemoteDebugger constructor, document better (gh-485) * Fix post-mortem debugging for Py3 * Remove unexplained stack-eating loop from post_mortem * add debug_remote_on_single_rank * flake8 * better doc * a bit more text * add an mpi4py example * allow arguments to func, better doc, simplify * clarify comment * more doc * clarify comment * add missing args Co-authored-by: Andreas Kloeckner <[email protected]>
- Loading branch information
1 parent
b1efc69
commit 8caead2
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python | ||
|
||
# This example demonstrates how to debug an mpi4py application. | ||
# Run this with 'mpirun -n 2 python mpi4py-debug.py'. | ||
# You can then attach to the debugger by running 'telnet 127.0.0.1 6899' | ||
# (when using the default pudb configuration) in another terminal. | ||
|
||
from mpi4py import MPI | ||
from pudb.remote import debug_remote_on_single_rank | ||
|
||
|
||
def debugged_function(x): | ||
y = x + fail # noqa: F821 | ||
return y | ||
|
||
|
||
# debug 'debugged_function' on rank 0 | ||
debug_remote_on_single_rank(MPI.COMM_WORLD, 0, debugged_function, 42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters