Debugging Parallel R Code
Parallel R packages such as Rmpi, snow, foreach, and so on do not set up a terminal window for each process, thus making it impossible to use R’s debugger on the workers. (My Rdsm package, which adds a threads capability to R, is an exception to this.)
What then can you do to debug apps for those packages? Let’s consider snow for a concrete example.
First, you should debug the underlying single-worker function, such as mtl() in Section 16.2. Here, we would set up some artificial values of the arguments and then use R’s ordinary debugging facilities.
Debugging the underlying function may be sufficient. However, the bug may be in the arguments themselves or in the way we set them up. Then things get more difficult.
It’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access