Testing With Graphics: Difference between revisions

From SciNet Users Documentation
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
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
  xalloc: Granted job allocation 189857
  salloc: Granted job allocation 189857
  xalloc: Waiting for resource configuration
  salloc: Waiting for resource configuration
  xalloc: Nodes nia0030 are ready for job
  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#Testing | Testing]], then you can use the <tt>salloc</tt> command with the <tt>--x11</tt> option. For instance
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:
<!-- must follow these steps.  You will need two terminals in order to achieve this:
<ol>
<ol>
Line 24: Line 24:
  $ ssh -Y niagara.scinet.utoronto.ca
  $ ssh -Y niagara.scinet.utoronto.ca
  USER@nia-login07:~$ salloc --nodes 5 --time=2:00:00 --x11
  USER@nia-login07:~$ salloc --nodes 5 --time=2:00:00 --x11
  .salloc: Granted job allocation 141862
  salloc: Granted job allocation 141862
  .salloc: Waiting for resource configuration
  salloc: Waiting for resource configuration
  .salloc: Nodes nia[1265-1271] are ready for job
  salloc: Nodes nia[1265-1271] are ready for job
  [USER@nia1265 ~]$
  [USER@nia1265 ~]$
<!--
<!--
Line 45: Line 45:
Observations:
Observations:
<ul>
<ul>
<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 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> In some case you can substitute -Y by -X, but this may cause the X display to unexpectedly be disconnected.  
<li> In some case you can substitute -Y by -X, but this may cause the X display to unexpectedly be disconnected.  
<!--<li> If you are in Mac OS, substitute -X by -Y
<!--<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.-->
<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.