AthenaMP+AthenaMPTools: Allow SharedWriter to be debugged just like any other worker
This MR allows passing the debug-worker
flag to SharedWriter
, just like the other workers. It should make debugging w/ gdb
a bit easier. The following procedure seems to work OK for me:
Terminal #1
- Run
athena
w/ the--debugWorker
option, e.g.athena.py --debugWorker --stdcmalloc --nprocs=8 [...]
, - Workers will be stopped after fork, waiting for SIGUSR1 signal,
- Find the
PID
of the worker you'd like to debug (e.g. SharedWriter).
Terminal #2
- Attach
gdb
to the process to be debugged, i.e.gdb python PID
, - Once the symbols are loaded, one can perform any
gdb
action, e.g. insert break points etc. - Once ready continue this process w/
signal SIGUSR1
.
Terminal #3
- Signal remaining workers so that they resume. Easiest way to achieve this is to use
htop
to tag multiple processes (space-bar) and send SIGUSR1 to all (F9).
I'm not sure if there is an easier way to achieve this. Let me tag @tsulaia and @gemmeren for insight. Many thanks.