Reverse Connect Examples
Initiate a reverse connection request by specifying any debug target program as the argument to tvconnect. The specified program must be accessible by the TotalView front-end UI that wishes to accept the request.
Here’s a simple example:
tvconnect /home/executable/tests/myTest
To start it on an MPI job, for example:
tvconnect srun -n 4 /home/fullpath/tx_mpi_test
CLI Example
This example illustrates the usage of the reverse connection dload options.
Assume that:
* tvconnect was started on machine1 specifying a program with a full path
* tvconnect was started on machine2 specifying the program tx_hello
*The program was in the current working directory and no path was added to the program.
 
d1.<> dload -list_reverse_connect
(1) machine1.totalviewtech.com /home/user/tests/tx_blocks
(2) machine2.totalviewtech.com tx_hello
 
d1.<> dload -accept_rc 1
d1.<> dload -reject_rc 2
MPI Batch Script Example
This is a simple example for invoking an MPI job from a batch script.
1. Create your job script. For example, create a batch script containing the following:
#-----------------------
#!/bin/tcsh
#SBATCH -p pdebug
#SBATCH -J myJob
#SBATCH -N 2
# Wait for a front end TV to accept this reverse connection request
tvconnect srun -n4 myMPIprogram
echo 'DONE!'
#-----------------------
Once the script is run, the tvconnect command creates the request file with the necessary details, then holds and waits for a connection request.
2. Start TotalView on your front-end node and accept the request. The debugger begins debugging srun. Pressing Go starts the MPI job and TotalView will attach to the MPI processes running on the compute nodes in the normal way.
NOTE: If the application is in your system path, TotalView will find it. i.e., you do not need to enter the full path in your command.
it is not required that you include the full path to your application in the command, if the application is in your path. In the above case, myMPIprogram was in the current working directory when the batch job was submitted. The request file reports the current working directory, so that the front-end TotalView can find the application even if it was not started from same directory.
MPI Batch Script Example
This is a simple example for invoking an MPI job from a batch script.
1. Create your job script. For example, create a batch script containing the following:
#-----------------------
#!/bin/tcsh
#SBATCH -p pdebug
#SBATCH -J myJob
#SBATCH -N 2
# Wait for a front end TV to accept this reverse connection request
tvconnect srun -n4 myMPIprogram
echo 'DONE!'
#-----------------------
Once the script is run, the tvconnect command creates the request file with the necessary details, then holds and waits for a connection request.
2. Start TotalView on your front-end node and accept the request. The debugger begins debugging srun. Pressing Go starts the MPI job and TotalView will attach to the MPI processes running on the compute nodes in the normal way.
NOTE: If the application is in your system path, TotalView will find it. i.e., you do not need to enter the full path in your command.
it is not required that you include the full path to your application in the command, if the application is in your path. In the above case, myMPIprogram was in the current working directory when the batch job was submitted. The request file reports the current working directory, so that the front-end TotalView can find the application even if it was not started from same directory.