SCIAMA

High Performance Compute Cluster

Menu
  • Home
  • Getting Started
    • How to get an account
    • How to Log in
    • Log in from Windows
    • Using X2Go
    • Create an SSH key pair
    • SSH Fingerprints
    • Using SSH keys
    • Training Exercises
    • Slurm MPI Batch Script
  • Using SCIAMA
    • Using Jupyter Notebooks
    • Using JupyterHub
    • Using Spyder
    • Storage Policy
    • Submitting jobs
    • Using GPUs
    • Using Matlab
    • Using Conda Environments
    • Using GPU Anaconda Environments
    • SLURM for PBS Users
    • File transfers
    • GitHub/BitBucket
    • Cloud Backup
    • Reserving Compute Nodes
    • Acknowledging SCIAMA
  • Resources
    • Hardware
    • Queues
    • Software
      • Using Software Modules
      • Changing Default Modules
      • Mixing MPI and OpenMP
      • Using CONDA
  • System Status
    • Core Usage
    • Disk Usage
    • Users Logged In
    • Jobs Status
    • Jobs by Group
    • Node Status
    • SCIAMA Grafana Dashboard
    • Maintenance and Outages
  • Contact Us

Exercise: Submitting an interactive job

Introduction

In this exercise we will run some simple “R” commands interactively on a compute node. Please read the related article HERE on how to run interactive jobs on SCIAMA-4.

Exercise

First we need to allocate resources (here 1 task/core by default) on a compute node and run a shell on it:

sinteractive -q training.q

The terminal should respond similar to:

Waiting for JOBID 1689183 to start
...............

Your terminal is blocked until the resources become available. Use the squeue command in another terminal/ssh login and identify your interactive job and verify the partition it is queued for.

Once the requested resources are available, a new shell opens on one of the requested node. Make sure to use srun to run any process, especially those using multiprocessing like MPI.

Ensure you have the “R” module selected in this shell:

module list

If not select the R package:

module load R/3.6.3

In the terminal run the R program. Execute the following commands (a file with these command can be found in the training/scripts directory):

Square <- function(x)
{ return(x^2) }
print(Square(4))
print(Square(x=4)) # same thing
quit()

You should see output similar to:

R version 3.4.1 (2017-06-30) — “Single Candle”
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type ‘license()’ or ‘licence()’ for distribution details.

R is a collaborative project with many contributors.
Type ‘contributors()’ for more information and
‘citation()’ on how to cite R or R packages in publications.

Type ‘demo()’ for some demos, ‘help()’ for on-line help, or
‘help.start()’ for an HTML browser interface to help.
Type ‘q()’ to quit R.

[Previously saved workspace restored]

Square <- function(x)
+ { return(x^2) }
> print(Square(4))
[1] 16
> print(Square(x=4)) # same thing
[1] 16
> quit()
Save workspace image? [y/n/c]: n

 

Exit from the interactive shell by typing exit or EOF/EOT interrupt via CTRL-D.

Top of Page

Back to Training Exercises

 

Copyright © 2022 ICG, University of Portsmouth