Testing With Graphics: Difference between revisions
Jump to navigation
Jump to search
| (9 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
If you need to use graphics while testing your code, e.g. when using a debugger such as DDT or DDD, you have the following options. | If you need to use graphics while testing your code on a Niagara compute node, e.g. when using a debugger such as [[Parallel Debugging with DDT|DDT]] or DDD, you have the following options. | ||
= Use the debugjob command = | = Use the debugjob command = | ||
| Line 6: | Line 6: | ||
USER@nia-login07:~$ debugjob | USER@nia-login07:~$ debugjob | ||
debugjob: Requesting 1 nodes for 60 minutes | debugjob: Requesting 1 nodes for 60 minutes | ||
salloc: Granted job allocation 189857 | |||
salloc: Waiting for resource configuration | |||
salloc: Nodes nia0030 are ready for job | |||
[USER@nia1265 ~]$ | [USER@nia1265 ~]$ | ||
= Use the regular queue = | = Use the regular queue = | ||
If <code>debugjob</code> is not suitable for your case due to the limitations either on time or resources (see [[Niagara_Quickstart# | If <code>debugjob</code> is not suitable for your case due to the limitations either on time or resources (see [[Niagara_Quickstart#Testing_and_Debugging | Testing and Debugging]]), then you can use the <tt>salloc</tt> command with the <tt>--x11</tt> option. For instance | ||
<!-- must follow these steps. You will need two terminals in order to achieve this: | |||
<ol> | <ol> | ||
<li> In the 1st terminal: | <li> In the 1st terminal: | ||
| Line 20: | Line 21: | ||
<li> take note of the node where you are logged to, ie. the head node, let's say <code>niaWXYZ</code> | <li> take note of the node where you are logged to, ie. the head node, let's say <code>niaWXYZ</code> | ||
</ul> | </ul> | ||
$ ssh | --> | ||
USER@nia-login07:~$ salloc --nodes 5 --time=2:00:00 | $ ssh -Y niagara.scinet.utoronto.ca | ||
USER@nia-login07:~$ salloc --nodes 5 --time=2:00:00 --x11 | |||
salloc: Granted job allocation 141862 | |||
salloc: Waiting for resource configuration | |||
salloc: Nodes nia[1265-1271] are ready for job | |||
[USER@nia1265 ~]$ | [USER@nia1265 ~]$ | ||
<!-- | |||
<li> In the second terminal: | <li> In the second terminal: | ||
<ul> | <ul> | ||
| Line 35: | Line 37: | ||
ssh niagara.scinet.utoronto.ca -X | ssh niagara.scinet.utoronto.ca -X | ||
USER@nia-login07:~$ ssh -X nia1265 | USER@nia-login07:~$ ssh -X nia1265 | ||
--> | |||
[USER@nia1265 ~]$ xclock ## just an example to test the graphics, a clock should pop up, close it to exit | [USER@nia1265 ~]$ xclock ## just an example to test the graphics, a clock should pop up, close it to exit | ||
[USER@nia1265 ~]$ module load ddt ## load corresponding modules, eg. for DDT | [USER@nia1265 ~]$ module load ddt ## load corresponding modules, eg. for DDT | ||
[USER@nia1265 ~]$ ddt ## launch DDT, the GUI should appear in your screen | [USER@nia1265 ~]$ ddt ## launch DDT, the GUI should appear in your screen | ||
</ol> | <!--</ol>--> | ||
Observations: | Observations: | ||
<ul> | <ul> | ||
<li> If you are using | <li> If you are using [[SSH]] from a Windows machine, you need to have an X-server, a good option is to use MobaXterm, that already brings an X-server included. See the [[SSH#SSH_for_Windows_Users | Windows SSH entry]] for other options. | ||
<li> If you are in Mac OS, substitute -X by -Y | <li> In some case you can substitute -Y by -X, but this may cause the X display to unexpectedly be disconnected. | ||
<li> Instead of using two terminals, you could just use <code>screen</code> to request the resources and then detach the session and ssh into the head node directly. | <!--<li> If you are in Mac OS, substitute -X by -Y | ||
<li> Instead of using two terminals, you could just use <code>screen</code> to request the resources and then detach the session and ssh into the head node directly.--> | |||
</ul> | </ul> | ||
Latest revision as of 13:46, 31 July 2019
If you need to use graphics while testing your code on a Niagara compute node, e.g. when using a debugger such as DDT or DDD, you have the following options.
Use the debugjob command
You can use the debugjob command, which automatically provides X-forwarding support.
$ ssh niagara.scinet.utoronto.ca -X USER@nia-login07:~$ debugjob debugjob: Requesting 1 nodes for 60 minutes salloc: Granted job allocation 189857 salloc: Waiting for resource configuration salloc: Nodes nia0030 are ready for job [USER@nia1265 ~]$
Use the regular queue
If debugjob is not suitable for your case due to the limitations either on time or resources (see Testing and Debugging), then you can use the salloc command with the --x11 option. For instance
$ ssh -Y niagara.scinet.utoronto.ca USER@nia-login07:~$ salloc --nodes 5 --time=2:00:00 --x11 salloc: Granted job allocation 141862 salloc: Waiting for resource configuration salloc: Nodes nia[1265-1271] are ready for job [USER@nia1265 ~]$ [USER@nia1265 ~]$ xclock ## just an example to test the graphics, a clock should pop up, close it to exit [USER@nia1265 ~]$ module load ddt ## load corresponding modules, eg. for DDT [USER@nia1265 ~]$ ddt ## launch DDT, the GUI should appear in your screen
Observations:
- If you are using SSH from a Windows machine, you need to have an X-server, a good option is to use MobaXterm, that already brings an X-server included. See the Windows SSH entry for other options.
- In some case you can substitute -Y by -X, but this may cause the X display to unexpectedly be disconnected.