Open durwasa-chakraborty opened 9 months ago
OMPI_CXX=g++
This part can go as an env param, right?
mpiexec -np 1
What is this part supposed to do?
OMPI_CXX=g++
This part can go as an env param, right?
I did not think of that! Thank you. I'll dig around to see how to add env parameter in the launch.json
.
mpiexec -np 1
What is this part supposed to do?
The mpiexec
command is used to execute the binary. Since the binary has been compiled with mpi++
, using mpiexec
is the required method to run it. The -np
flag specifies the number of processes to initiate, which is set to 1 in this case. Debugging multiple processes can be tough -np 2
but theoretically np 1
should be same as debugging any C++
code.
To me it sounds like one way to debug it is to attach to the process, right? That would be the way to debug it even if you start the process via command like lldb?
TL;DR
Could you assist me / point me to some examples which might help me in resolving the issue with the attach
request in the LLDB setting?
Long answer
I tried to attach the process and debug the code. However, I'm encountering issues when using the attach
request. Below are the steps I've taken and the outcomes:
Initial Setup:
g++ -g betweeness_centrality_serial.cpp -o betweeness_centrality_serial
.lldb betweeness_centrality_serial
.LLDB Attach Attempt:
launch.json
configuration with an attach
request:
{
"configurations": [{
"type": "lldb-vscode",
"request": "attach",
"name": "Debug | C++ | Betweenness Centrality Serial",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/betweeness_centrality_serial",
"pid": "${command:PickProcess}"
}]
}
lldb <binary>
Changing Request to launch
:
launch
in launch.json
.Parallel Execution Issue:
OMPI_CXX=g++ mpiexec -np 1 lldb ./bc_dslV2 small.graph
.attach
configuration for a parallel setup.I suspect the issue lies with the attach
request configuration itself. I've referred to LLDB-VSCode documentation and tried all the three techniques mentioned in the doc (pid, waitFor, application name) but couldn't pin point it whether it's a syntax issue or a problem with the process.
I seek guidance on configuring
launch.json
to debug a parallel C++ MPI program using LLDB on a Mac M1, which currently lacks gdb support. I have successfully debugged a basic C++ program with the followinglaunch.json
configuration:This setup works well for a single-threaded application, where I can run and debug the
betweeness_centrality_serial
binary using LLDB. [1]However, I face challenges when attempting to debug a parallel version of the program, which requires specific MPI commands. Normally, I would run the parallel version using the command:
My current
launch.json
for the parallel version looks like this:I need assistance in modifying this configuration to incorporate the MPI execution and environment setup (
OMPI_CXX=g++ mpiexec -np 1
) before the LLDB command.Could you please guide me on adjusting the
launch.json
to accommodate these requirements for MPI debugging?Thank you so much for your help.