Difference between revisions of "UKCA Training: Logging in and Setting up"

From UKCA
 
(21 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
#* If the workstation needs to reboot after updates, it should boot back into MCS Linux automatically.
 
#* If the workstation needs to reboot after updates, it should boot back into MCS Linux automatically.
 
# You should '''NOT''' stay logged-in overnight, as the workstations may power-down in the evenings.
 
# You should '''NOT''' stay logged-in overnight, as the workstations may power-down in the evenings.
# To log-in, use the conference username and password provided in the white envelope. '''These details are unique to you - do not share them with others'''.
+
# To log-in, use the conference username and password provided. '''These details are unique to you - do not share them with others'''.
   
 
==PUMA and ARCHER==
 
==PUMA and ARCHER==
Line 23: Line 23:
   
 
<ol>
 
<ol>
<li> Log in to PUMA using your personal account details: <code>ssh -X '''userid'''@puma.nerc.ac.uk</code></li>
+
<li> Log in to PUMA using your personal account details: <code>ssh -Y '''userid'''@puma.nerc.ac.uk</code></li>
<li> Log in to ARCHER using the provided training account username and password: <code>ssh -X '''ncastrXX'''@login.archer.ac.uk</code></li>
+
<li> Log in to ARCHER using the provided training account username and password: <code>ssh -Y '''ncastrXX'''@login.archer.ac.uk</code></li>
  +
<!-- :* On the first time you log in to ARCHER you will need to change your password. You will need to '''remember this'''. If you forget it you should contact [[User:Nla27|Luke Abraham]] who will need to contact [mailto:support@archer.ac.uk support@archer.ac.uk].-->
 
:* '''Note:''' Please type your ARCHER password carefully - if it is typed incorrectly too many times you may find that you are locked out of the account
 
:* '''Note:''' Please type your ARCHER password carefully - if it is typed incorrectly too many times you may find that you are locked out of the account
 
<li> '''If you have NOT already done so, generate your SSH-key:''' </li>
 
<li> '''If you have NOT already done so, generate your SSH-key:''' </li>
Line 39: Line 40:
 
:* <code>'''TYPE_YOUR_PASSPHRASE'''</code> needs to be a fairly complicated and unguessable passphrase. You can use spaces in the pass phrase if it helps you to remember it more readily. It is recommended that you don't use your password just in case this is hacked.
 
:* <code>'''TYPE_YOUR_PASSPHRASE'''</code> needs to be a fairly complicated and unguessable passphrase. You can use spaces in the pass phrase if it helps you to remember it more readily. It is recommended that you don't use your password just in case this is hacked.
 
:* You should '''NOT''' use an empty passphrase as this presents a security issue.
 
:* You should '''NOT''' use an empty passphrase as this presents a security issue.
  +
:* If you already have a SSH-key, you can reuse it.
 
<li>Add the public key to the <code>~/.ssh/authorized_keys</code> file on ARCHER.</li>
 
<li>Add the public key to the <code>~/.ssh/authorized_keys</code> file on ARCHER.</li>
 
:* To achieve this in a secure manner, do the following:
 
:* To achieve this in a secure manner, do the following:
Line 48: Line 50:
 
<li> Verify the authentication works:</li>
 
<li> Verify the authentication works:</li>
   
puma$ ssh '''ncastrXX'''@login.archer.ac.uk
+
puma$ ssh -Y '''ncastrXX'''@login.archer.ac.uk
  +
Enter passphrase for key '''userid'''@puma.nerc.ac.uk: '''''Type Passphrase'''''
  +
 
:* If you don't get the prompt for your DSA key (i.e. asked for your Passphrase), then something has gone wrong. Make sure the public key, step 3 above, was successfully copied over to ARCHER. If this happens then you can force the use of the key by using '''-i''':
  +
  +
puma$ ssh '''-i ~/.ssh/id_dsa''' -Y '''ncastrXX'''@login.archer.ac.uk
 
Enter passphrase for key '''userid'''@puma.nerc.ac.uk: '''''Type Passphrase'''''
 
Enter passphrase for key '''userid'''@puma.nerc.ac.uk: '''''Type Passphrase'''''
   
:* If you don't get the prompt for your DSA key (i.e. asked for your Passphrase), then something has gone wrong. Make sure the public key, step 3 above, was successfully copied over to ARCHER.
 
 
<li> Make sure your ssh keys are safe:</li>
 
<li> Make sure your ssh keys are safe:</li>
   
Line 69: Line 75:
   
 
puma$ ssh-add
 
puma$ ssh-add
  +
Enter passphrase for ~/.ssh/id_dsa ('''userid'''@puma.nerc.ac.uk): '''''Type Passphrase'''''
  +
  +
:* If needed, you can explicitly specify the key:
  +
  +
puma$ ssh-add ~/.ssh/id_dsa
 
Enter passphrase for ~/.ssh/id_dsa ('''userid'''@puma.nerc.ac.uk): '''''Type Passphrase'''''
 
Enter passphrase for ~/.ssh/id_dsa ('''userid'''@puma.nerc.ac.uk): '''''Type Passphrase'''''
   
Line 104: Line 115:
   
 
:* You should also make sure that the ''Account name'' is set to <code>n02-training</code>
 
:* You should also make sure that the ''Account name'' is set to <code>n02-training</code>
<li> For this course, you will be running on a specially reserved queue, made up of 88 nodes. This reservation runs from 12.30-18:00 from the 5th-9th January 2015.</li>
+
<li> For this course, you will be running on a specially reserved queue, made up of 80 nodes. This reservation runs from 13:00-17:30 from the 4th-7th January, and from 13:00-15:30 on the 8th January.</li>
 
:* To make use of this queue, you should make sure that the following hand-edit is included and turned on:
 
:* To make use of this queue, you should make sure that the following hand-edit is included and turned on:
   
 
~ukca/hand_edits/Tutorials/course1-queue
 
~ukca/hand_edits/Tutorials/course1-queue
   
<li> The UKCA tutorial jobs that you will be running make use of ''pre-compiled builds''. For technical reasons you should '''not''' try to recompile the reconfiguration executable, as this is using one from a central location.</li>
+
<li> The UKCA tutorial jobs that you will be running make use of ''pre-compiled builds''.</li>
 
<li> Once the job is running, you can check the progress of the job by typing <code>'''qstat -u $USER'''</code>, e.g.</li>
 
<li> Once the job is running, you can check the progress of the job by typing <code>'''qstat -u $USER'''</code>, e.g.</li>
   
Line 142: Line 153:
 
:** You can directly log-in to one of the '''8''' esLogin nodes by
 
:** You can directly log-in to one of the '''8''' esLogin nodes by
   
ssh -X '''ncastrXX'''@login'''X'''.archer.ac.uk
+
ssh -Y '''ncastrXX'''@login'''X'''.archer.ac.uk
   
 
<li> After the job has compiled, you should then</li>
 
<li> After the job has compiled, you should then</li>
Line 148: Line 159:
   
 
qsub ./umui_runs/'''jobid-XXXXXXXXX'''/umuisubmit_rcf
 
qsub ./umui_runs/'''jobid-XXXXXXXXX'''/umuisubmit_rcf
  +
  +
:: You should then wait for this job to finish, before submitting the run step.
   
 
:* Then submit the run step by
 
:* Then submit the run step by
Line 158: Line 171:
 
The hand-edit '''<code>~ukca/hand_edits/Tutorials/course1-queue</code>''' has been designed around the fact that the five separate reservations are grouped into a single queue called '''course1'''. However, if there are any problems with this grouping, then individual hand-edits for each day may need to be used:
 
The hand-edit '''<code>~ukca/hand_edits/Tutorials/course1-queue</code>''' has been designed around the fact that the five separate reservations are grouped into a single queue called '''course1'''. However, if there are any problems with this grouping, then individual hand-edits for each day may need to be used:
   
* '''<code>~ukca/hand_edits/Tutorials/reserve_monday</code>''' for Monday 5th January, using reservation R2577849
+
* '''<code>~ukca/hand_edits/Tutorials/reserve_monday</code>''' for Monday 4th January, using reservation R3375651
* '''<code>~ukca/hand_edits/Tutorials/reserve_tuesday</code>''' for Tuesday 6th January, using reservation R2577850
+
* '''<code>~ukca/hand_edits/Tutorials/reserve_tuesday</code>''' for Tuesday 5th January, using reservation R3375652
* '''<code>~ukca/hand_edits/Tutorials/reserve_wednesday</code>''' for Wednesday 7th January, using reservation R2577853
+
* '''<code>~ukca/hand_edits/Tutorials/reserve_wednesday</code>''' for Wednesday 6th January, using reservation R3375653
* '''<code>~ukca/hand_edits/Tutorials/reserve_thursday</code>''' for Thursday 8th January, using reservation R2577854
+
* '''<code>~ukca/hand_edits/Tutorials/reserve_thursday</code>''' for Thursday 7th January, using reservation R3375656
* '''<code>~ukca/hand_edits/Tutorials/reserve_friday</code>''' for Friday 9th January, using reservation R2577855
+
* '''<code>~ukca/hand_edits/Tutorials/reserve_friday</code>''' for Friday 8th January, using reservation R3375658
   
 
If you are [[#Manually compiling UM jobs on ARCHER|manually compiling]], then you can do
 
If you are [[#Manually compiling UM jobs on ARCHER|manually compiling]], then you can do
Line 169: Line 182:
 
qsub -q '''RESERVATION''' ./umui_runs/'''jobid-XXXXXXXXX'''/umuisubmit_run
 
qsub -q '''RESERVATION''' ./umui_runs/'''jobid-XXXXXXXXX'''/umuisubmit_run
   
where '''RESERVATION''' is the correct reservation code from the above list (e.g. R2577849 for Monday 5th January etc.).
+
where '''RESERVATION''' is the correct reservation code from the above list (e.g. R3375651 for Monday 4th January etc.).
  +
  +
Reservations can be seen using the <code>pbs_rstat</code> command, e.g.
  +
  +
[14:42:04 luke@eslogin006 ~]$ pbs_rstat
  +
Name Queue User State Start / Duration / End
  +
---------------------------------------------------------------------
  +
R3375651.s R3375651 +,orange CO Mon Jan 04 2016 1 / 16200 / Mon Jan 04 2016 1
  +
R3375652.s R3375652 +,orange CO Tue Jan 05 2016 1 / 16200 / Tue Jan 05 2016 1
  +
R3375653.s R3375653 +,orange CO Wed Jan 06 2016 1 / 16200 / Wed Jan 06 2016 1
  +
R3375656.s R3375656 +,orange CO Thu Jan 07 2016 1 / 16200 / Thu Jan 07 2016 1
  +
R3375658.s R3375658 +,orange CO Fri Jan 08 2016 1 / 9000 / Fri Jan 08 2016 1
  +
  +
==Required files and worked solutions==
  +
  +
Worked solutions are available for the practicals. These can be found both on ARCHER and on the local Cambridge workstations.
  +
  +
===ARCHER===
  +
  +
The files can be found within the
  +
  +
/work/n02/n02/ukca/Tutorial/vn8.4
  +
  +
directory.
  +
  +
The <code>Task5.1/</code> sub-directory holds the files required to make up the emissions ancillary. There is also a <code>solution/</code> directory provided here as well.
  +
  +
The <code>sample_output/</code> sub-directory contains the available sample output for each of the tasks.
  +
  +
===Cambridge===
  +
  +
In case ARCHER goes down, a duplicate of the ARCHER directory can be found at
  +
  +
/ux/Archer/UKCA
  +
  +
on the MCS Linux system. There is also a <code>bin/</code> sub-directory which contains Xconv, Xancil, and cdo binaries. The <code>Code/</code> sub-direcrory contains the source-code for solutions for Tasks 4.2-9.1.
  +
  +
==Copying data over to your normal ARCHER account==
  +
  +
At the end of the course, your NCAS training accounts will be deactivated and the data within them deleted. To save any work that you have done, you will need to copy this data elesewhere. It is recommended that you copy the data over to your normal ARCHER account, and using '''<code>rsync</code>''' is a good way to do this.
  +
  +
===Using <code>rsync</code>===
  +
  +
# Log in to your normal ARCHER account:
  +
#: <code>ssh -Y '''userid'''@login.archer.ac.uk</code>
  +
# Make a directory to hold this data on the /work directory of your normal ARCHER account. e.g.
  +
#: <code>cd /work/n02/n02/'''userid'''</code>
  +
#: <code>mkdir Tutorials</code>
  +
#: <code>cd Tutorials</code>
  +
#* Within this directory, then type '''<code>pwd</code>''' to get the full path to this directory.
  +
# Log in to your NCAS training account:
  +
#: <code>ssh -Y '''ncastrXX'''@login.archer.ac.uk</code>
  +
# On your NCAS training account, type the following command, e.g.
  +
#: <code>rsync -auvv '''''directory_to_copy''''' '''userid'''@localhost:/work/n02/n02/'''userid'''/Tutorials/.</code>
  +
#* Where e.g. <code>/work/n02/n02/'''userid'''/Tutorials/.</code> is the output from the '''pwd''' command earlier.
  +
  +
You can also use the rsync command to copy the output elsewhere, e.g. to your host institution. In this case change the <code>''localhost''</code> above to the name of the machine you want to copy the data to.
  +
  +
----
  +
''Written by [[User:Nla27 | Luke Abraham]] 2015''

Latest revision as of 09:31, 6 September 2016

You will be using the machines in the G30 computer lab in the Department of Chemistry.

G30 Workstations

You will be using MCS Linux on the G30 workstations during this course.

  1. Boot to MCS Linux
    • If the machine is powered-off, please turn it on.
    • If machine is on the Windows login screen, press Ctrl-Alt-Del and the press the drop-down menu on the red power-off button (bottom right) and select Restart.
      • If this button is not on the screen, please log-in to Windows and select Restart from the Start Menu.
  2. On the BIOS boot screen, select MCS Linux
    • You will need to be quick here, as you are only allowed 10 seconds to change from the default (Windows)
  3. Software updates may need to be applied - this may take some time.
    • If the workstation needs to reboot after updates, it should boot back into MCS Linux automatically.
  4. You should NOT stay logged-in overnight, as the workstations may power-down in the evenings.
  5. To log-in, use the conference username and password provided. These details are unique to you - do not share them with others.

PUMA and ARCHER

You should use your personal PUMA account during this course.

Setting-up passwordless SSH from PUMA to ARCHER

  1. Log in to PUMA using your personal account details: ssh -Y userid@puma.nerc.ac.uk
  2. Log in to ARCHER using the provided training account username and password: ssh -Y ncastrXX@login.archer.ac.uk
    • Note: Please type your ARCHER password carefully - if it is typed incorrectly too many times you may find that you are locked out of the account
  3. If you have NOT already done so, generate your SSH-key:
  4. puma$ ssh-keygen -f ~/.ssh/id_dsa -C " userid@puma.nerc.ac.uk" Generating public/private rsa key pair. Enter passphrase(empty for no passphrase): TYPE_YOUR_PASSPHRASE Enter same passphrase again: TYPE_YOUR_PASSPHRASE Your identification has been saved in ~/.ssh/id_dsa. Your public key has been saved in ~/.ssh/id_dsa.pub. The key fingerprint is: md5 1024 String of characters userid@puma.nerc.ac.uk
    • TYPE_YOUR_PASSPHRASE needs to be a fairly complicated and unguessable passphrase. You can use spaces in the pass phrase if it helps you to remember it more readily. It is recommended that you don't use your password just in case this is hacked.
    • You should NOT use an empty passphrase as this presents a security issue.
    • If you already have a SSH-key, you can reuse it.
  5. Add the public key to the ~/.ssh/authorized_keys file on ARCHER.
    • To achieve this in a secure manner, do the following:
    puma$ cat ~/.ssh/id_dsa.pub | ssh ncastrXX@login.archer.ac.uk 'mkdir -p .ssh ; cat - >> ~/.ssh/authorized_keys' Enter the password of your ARCHER training account
    • Sometimes, even though the file is copied across successfully, the above command will hang. In which case, do a Ctrl-C to exit, and login to the remote platform and verify the file ~/.ssh/authorized_keys has arrived safely
  6. Verify the authentication works:
  7. puma$ ssh -Y ncastrXX@login.archer.ac.uk Enter passphrase for key userid@puma.nerc.ac.uk: Type Passphrase
    • If you don't get the prompt for your DSA key (i.e. asked for your Passphrase), then something has gone wrong. Make sure the public key, step 3 above, was successfully copied over to ARCHER. If this happens then you can force the use of the key by using -i:
    puma$ ssh -i ~/.ssh/id_dsa -Y ncastrXX@login.archer.ac.uk Enter passphrase for key userid@puma.nerc.ac.uk: Type Passphrase
  8. Make sure your ssh keys are safe:
  9. puma$ chmod -R 700 .ssh ARCHER$ chmod -R 700 .ssh
  10. Make the ssh-agent automatically start-up when your session runs, if you have NOT done so already.
    • On PUMA copy the setup script from /home/ukca/TutorialSetup to $HOME/.ssh/setup, and ensure it has execute permission:
    puma$ chmod u+x $HOME/.ssh/setup
    • Call this script from your .kshrc or .bashrc (ksh or bash shell respectively) file by adding the following line. If you don't have a .kshrc/.bashrc file at it to your .profile.
    . $HOME/.ssh/setup
  11. Run the following command and type your passphrase (you may need to do this every time a new ssh-agent is started - ie. every time you re-start your local session):
  12. puma$ ssh-add Enter passphrase for ~/.ssh/id_dsa (userid@puma.nerc.ac.uk): Type Passphrase
    • If needed, you can explicitly specify the key:
    puma$ ssh-add ~/.ssh/id_dsa Enter passphrase for ~/.ssh/id_dsa (userid@puma.nerc.ac.uk): Type Passphrase

You may now find it easier to log in to PUMA first, then use passwordless SSH to connect to your ARCHER training account.

These instructions have been adapted from: https://puma.nerc.ac.uk/trac/UM_TUTORIAL/wiki/sshAgent

Setting-up your .profile on ARCHER

You should ensure that your .profile on ARCHER contains the following lines:

export UMDIR=/work/n02/n02/hum 
TARGET_MC=cce

# Setup UM Variables
VN=8.4
if test -f $HOME/.umsetvars_$VN; then
  . $HOME/.umsetvars_$VN
else
  . $UMDIR/vn$VN/$TARGET_MC/scripts/.umsetvars_$VN
fi

An example .profile can be copied from /home/n02/n02/ukca/TutorialSetup/example.profile on ARCHER.

UMUI Jobs

  1. You should modify the UMUI to use the ARCHER training account username in the following panel:
  2. Model Selection   User Information and Submit Method     General details
    • You should also make sure that the Account name is set to n02-training
  3. For this course, you will be running on a specially reserved queue, made up of 80 nodes. This reservation runs from 13:00-17:30 from the 4th-7th January, and from 13:00-15:30 on the 8th January.
    • To make use of this queue, you should make sure that the following hand-edit is included and turned on:
    ~ukca/hand_edits/Tutorials/course1-queue
  4. The UKCA tutorial jobs that you will be running make use of pre-compiled builds.
  5. Once the job is running, you can check the progress of the job by typing qstat -u $USER, e.g.
  6. ncastrXX@eslogin003:~> qstat -u $USER sdb: Req'd Req'd Elap Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time --------------- -------- -------- ---------- ------ --- --- ------ ----- - ----- 2590413.sdb ncastrXX S2528390 jobid_rcf 7017 2 48 -- 00:10 R 00:00

Manually compiling UM jobs on ARCHER

Usually, UM jobs are submitted to the ARCHER serial queue to compile, before being automatically submitted to the parallel queues for the reconfiguration and run steps. However, if you are having problems compiling (i.e. the job is taking a lot longer than the expected 10 minutes) you should manually compile the job on the login node.

  1. To do this, you need to include and turn-on the following hand-edit:
  2. ~ukca/hand_edits/VN8.4/manual_comp_ARCHER.ed
  3. Save, process, and submit in the usual way
  4. Then, on ARCHER you will find that the job has not been submitted to the serial queue. To compile the job you should then:
  5. cd ls -ltr ./umui_runs ./umui_runs/jobid-XXXXXXXXX/umuisubmit_compile
    • jobid-XXXXXXXXX is the most recent directory in your ./umui_runs directory.
    • Note: if too many people are trying to manually compile on the same login node, you should log-out and try another.
      • You can directly log-in to one of the 8 esLogin nodes by
    ssh -Y ncastrXX@loginX.archer.ac.uk
  6. After the job has compiled, you should then
    • Submit the reconfiguration step by:
    qsub ./umui_runs/jobid-XXXXXXXXX/umuisubmit_rcf
    You should then wait for this job to finish, before submitting the run step.
    • Then submit the run step by
    qsub ./umui_runs/jobid-XXXXXXXXX/umuisubmit_run

The course1 queue

The hand-edit ~ukca/hand_edits/Tutorials/course1-queue has been designed around the fact that the five separate reservations are grouped into a single queue called course1. However, if there are any problems with this grouping, then individual hand-edits for each day may need to be used:

  • ~ukca/hand_edits/Tutorials/reserve_monday for Monday 4th January, using reservation R3375651
  • ~ukca/hand_edits/Tutorials/reserve_tuesday for Tuesday 5th January, using reservation R3375652
  • ~ukca/hand_edits/Tutorials/reserve_wednesday for Wednesday 6th January, using reservation R3375653
  • ~ukca/hand_edits/Tutorials/reserve_thursday for Thursday 7th January, using reservation R3375656
  • ~ukca/hand_edits/Tutorials/reserve_friday for Friday 8th January, using reservation R3375658

If you are manually compiling, then you can do

qsub -q RESERVATION ./umui_runs/jobid-XXXXXXXXX/umuisubmit_rcf
qsub -q RESERVATION ./umui_runs/jobid-XXXXXXXXX/umuisubmit_run

where RESERVATION is the correct reservation code from the above list (e.g. R3375651 for Monday 4th January etc.).

Reservations can be seen using the pbs_rstat command, e.g.

[14:42:04 luke@eslogin006 ~]$ pbs_rstat
Name       Queue    User     State             Start / Duration / End              
---------------------------------------------------------------------
R3375651.s R3375651 +,orange CO    Mon Jan 04 2016 1 / 16200 / Mon Jan 04 2016 1
R3375652.s R3375652 +,orange CO    Tue Jan 05 2016 1 / 16200 / Tue Jan 05 2016 1
R3375653.s R3375653 +,orange CO    Wed Jan 06 2016 1 / 16200 / Wed Jan 06 2016 1
R3375656.s R3375656 +,orange CO    Thu Jan 07 2016 1 / 16200 / Thu Jan 07 2016 1
R3375658.s R3375658 +,orange CO    Fri Jan 08 2016 1 / 9000 / Fri Jan 08 2016 1

Required files and worked solutions

Worked solutions are available for the practicals. These can be found both on ARCHER and on the local Cambridge workstations.

ARCHER

The files can be found within the

/work/n02/n02/ukca/Tutorial/vn8.4

directory.

The Task5.1/ sub-directory holds the files required to make up the emissions ancillary. There is also a solution/ directory provided here as well.

The sample_output/ sub-directory contains the available sample output for each of the tasks.

Cambridge

In case ARCHER goes down, a duplicate of the ARCHER directory can be found at

/ux/Archer/UKCA

on the MCS Linux system. There is also a bin/ sub-directory which contains Xconv, Xancil, and cdo binaries. The Code/ sub-direcrory contains the source-code for solutions for Tasks 4.2-9.1.

Copying data over to your normal ARCHER account

At the end of the course, your NCAS training accounts will be deactivated and the data within them deleted. To save any work that you have done, you will need to copy this data elesewhere. It is recommended that you copy the data over to your normal ARCHER account, and using rsync is a good way to do this.

Using rsync

  1. Log in to your normal ARCHER account:
    ssh -Y userid@login.archer.ac.uk
  2. Make a directory to hold this data on the /work directory of your normal ARCHER account. e.g.
    cd /work/n02/n02/userid
    mkdir Tutorials
    cd Tutorials
    • Within this directory, then type pwd to get the full path to this directory.
  3. Log in to your NCAS training account:
    ssh -Y ncastrXX@login.archer.ac.uk
  4. On your NCAS training account, type the following command, e.g.
    rsync -auvv directory_to_copy userid@localhost:/work/n02/n02/userid/Tutorials/.
    • Where e.g. /work/n02/n02/userid/Tutorials/. is the output from the pwd command earlier.

You can also use the rsync command to copy the output elsewhere, e.g. to your host institution. In this case change the localhost above to the name of the machine you want to copy the data to.


Written by Luke Abraham 2015