## Introduction to

# SCRTP Facilities

J. Reizenstein,

Y. Lifanov,

J. Mascie-Taylor,

Q. Caudron.

# SCRTP HPC

Available Facilities

- Cluster of Workstations (COW)
- Tinis and Orac (Parallel computing mainly)
- Chiron (big data etc)
- (bigger things, eg via MidPlus)

# Purpose

- Provide extra toolkit
- Allow long simuations
- Allow parallel computing

# Exercise

- Download this
- This is a tested code
- We will compile and run it:

1. On SCRTP machines
2. On the COW

# Exercise

We are going to

1. Upload the code on to SCRTP server
2. Log in to SCRTP machines
3. Find the code and compile with g++
4. Run the binary on SCRTP machines with nice
5. Write a COW job submission script
6. Submit a job to the COW using qsub

# Step 0

Choose your host name

    adobo     bulalo   halabos
    inihaw    jamon    kinilaw
    niliga    okoy     pinakbet
    sinuglaw  rilyeno  galunggong

# Step 1

Uploading a file

# Step 1

On Linux/Mac

1. Navigate to your file via terminal
2. Use the scp command:

    scp filename username@hostname.complexity.warwick.ac.uk:

This copies the file into your home directory on CSC server

# Step 1

On Linux using sshfs

- `sudo apt-get install sshfs`
- `sudo apt-get install fuse`
- With your local username as firstname: `sudo adduser firstname fuse` - may not be necessary
- create an empty directory to represent the other side, e.g. wormhole in your home directory: `mkdir ~/wormhole`
- Start, each time: `sshfs username@godzilla.csc.warwick.ac.uk: ~/wormhole`. This will ask for your CSC password many times.
- End, each time: `fusermount -u ~/wormhole`

This makes `wormhole` be a window into your home directory on CSC server, which you can copy files into. Perhaps try using a complexity CSC machine instead of go dzilla.

# Step 1

Using Filezilla on Windows

1. Open Filezilla -> File -> Site Manager
2. Click New Site and name it after host
3. In Host Name box, put:

    hostname.complexity.warwick.ac.uk

4. In Port box put 22
5. Choose SFTP - SSH File Transfer Protocol

# Step 1

Using Filezilla on Windows

1. From Logon Menu, choose Normal
2. Specify your username and password
3. Click Connect
4. In the Local site pane, navigate to your file
5. Click and drag your file across to Remote site

# Step 2

Remote login

# Step 2

SSH on Linux/Mac

1. Open terminal
2. For console only, use

    ssh username@hostname.complexity.warwick.ac.uk

3. For console + graphics, use

    ssh -X username@hostname.complexity.warwick.ac.uk

# Step 2

Putty on Windows

1. Open Putty. Into Host Name box, put

    username@hostname.complexity.warwick.ac.uk

2. Check that Port is set to 22
3. Name your session and click Save
4. Click Open

# Step 3

Compiling code

1. Navigate to your file using cd
2. Hit Tab key in quick succession to autocomplete
3. Use ls to check folder contents
4. Once found, compile your file using:

    g++-4.9 -std=c++11 filename

Avoid compiling on head nodes (e.g. godzilla, minerva)

# Step 3

Useful resources

- Compiler flags
- Code structure (header/source)
- Make files
- Compiling at CSC

# Step 4

Running code on host

Warning: never do this on a front end, e.g. godzilla, minerva

Always be sure that you aren't running on the head node

# Step 4

Use the following:

    nice -n 18 ./a.out 0.5

- nice -n 18 lowers the call priority
- 0.5 is an argument to a.out

# Step 4

Running in the background

    nice -n 18 ./a.out 0.5 > a.log &

- > a.log feeds output into a.log
- & puts program in background
- Check by using top
- Program will continue after logout
- Read more here

# Step 5

Submission script

1. Log into godzilla `ssh username@godzilla.csc.warwick.ac.uk`
2. Create and open script file with:

    vi script.pbs

3. Press i to enter INSERT mode
4. Copy the code below
5. Paste and press ESC to leave INSERT mode
6. Use SHIFT+ZZ to save and quit editor
7. Or, use `cat>script.pbs` and press enter and Ctrl-D to quit

    #!/bin/bash
    #PBS -l nodes=1:ppn=1,pvmem=1024mb,walltime=01:00:00
    #PBS -V
    cd $PBS_O_WORKDIR
    ./a.out 0.5

# Step 6

Submitting a job

1. Copy your executable and script into storage

    cp a.out script.pbs /storage/rawsys/username/

2. Navigate to the storage directory

    cd /storage/rawsys/username/

3. Submit your script using

    qsub script.pbs -q serial

# Step 6

- Monitor progress with

    qstat -u username

- Delete jobs with

    qdel jobid

- More info here

# Step 7

Retrieve output

1. Zip the output files with

    zip myzip.zip *.bin

2. Clean up with

    rm *.bin

3. Back on your computer, download with Filezilla or

    scp username@hostname.complexity.warwick.ac.uk:/pathto/myzip.zip .

4. Unzip your files with file browser or

    unzip myzip.zip

# Step 7

Visualise output with MatLab or Julia

1. Download this script for MatLab
2. Download this script for Julia
3. Put it in the same directory as data
4. Run with MatLab or julia

# The End