How can I debug a parallel script with spmd?
7 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I'm using a script with parallel processing using spmd. But I'm unsure how to debug the code when it's running in parallel. Can I set breakpoints in parallel code? My tests, and an online research suggest it might not be possible. I am using Matlab R2023b. Any help?
Thanks.
0 件のコメント
回答 (2 件)
Edric Ellis
2024 年 1 月 19 日
Unfortunately you cannot set breakpoints in code running on workers. If the problem is related to the messages you are sending using spmdSend and receive, then you might be able to gain some insight by enabling message logging using mpiSettings, like this:
spmd
mpiSettings(MessageLogging='on')
mpiSettings(MessageLoggingDestination='CommandWindow')
spmdCat(spmdIndex) % this will generate some logging messages
end
0 件のコメント
Vinayak
2024 年 1 月 19 日
Hello Daniel,
I understand that debugging a script employing “spmd” cannot be acheived simply by placing breakpoints. However, there is an option to incorporate conditionals using "spmdIndex." Breakpoints can be set at specific locations by using “dbstop”. “fprintf” can be used to add log statements conditionally as well.
Additionally as mentioned by Edric, if the issues is related to “spmdSend”, you can utilize “mpiSettings” to enable logging.
For further details, please refer to the following links,
- spmdIndex: https://www.mathworks.com/help/parallel-computing/spmdindex.html
- dbstop: https://www.mathworks.com/help/matlab/ref/dbstop.html
- mpiSettings: https://www.mathworks.com/help/parallel-computing/mpisettings.html
I hope this helps!
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!