Testing With Graphics

From SciNet Users Documentation
Jump to navigation Jump to search

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.