How to debug mpi program with Clion?
Executable is set mpirun, that's why I can not debug as usual, I think, so how to do it? Thanks
As Zulan already mentioned,
Add these lines before your breakpoint and rebuild your application (from OpenMPI)
int i = 0;
while(0==i)
sleep(5);
Launch your program from the terminal with mpirun
$mpirun -np 4 ./Application
Run-> Attach to Process
Pause Program (the program will pause on sleep(5)
)
Set i!=0
and Resume Program
Happy debugging
You may need to connect to your other processes to set i!=0
and continue debugging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With