Client-Server Interface
Due to security limitation of gdb (see gdb manual) mdb implements its own
client-server interface. This section explains the plan for this interface.
Launch Mode
The first stage of debugging with mdb is to run the launch command. mdb launch is the
part that actually runs the target binary using the MPI launcher (mpirun, mpiexec, srun etc.).
mdb launchstarts two child processes; (a) the first process runs the MPI launcher, in this examplempirun, and (b) the second is anmdb exchange serverwhich will be responsible for authenticating communication between thegdbsubprocesses and themdb attachprocess.The call to
mpirunin the previous step will launchnprocmdb serverprocesses which will provide a thin wrapper aroundgdb, essentially providing encrypted command input and output to each rank.mdb exchange serverwill perform a TLS handshake with eachmdb serverprocess. This sets up the initial encrypted communication channel.The last step in launch mode is for each
mdb serverprocess to communicate some basic information with themdb exchange server, such as, IP address (orHOSTNAME), port number and MPI rank.
Attach Mode
Now that the debug processes are launched we can connect using the mdb attach command.
Running
mdb attachwill trigger a TLS handshake with themdb exchange serveron the specified host (--host [hostname]).Once authenticated,
mdbcan forward command IO to and from themdb exchange server.mdb serverhas already authenticated the connection with thinmdb serverprocesses. It forwards the relevant commands to each rank.Each rank responds depending on the command issued.
mdb exchange serversends encrypted output back tomdb attach, where it will be unencrypted automatically using TLS/SSL sockets.
Communication Protocol
This is still a work in progress but some things are already certain:
messages will be sent as
json.each message will include a version number.
each message will have a destination (e.g.,
exchange serverormdb server).