You are here

Using Matlab on Lyceum4

Lyceum4 is a cluster of Linux computers that students can use in their Matlab projects.

1a. Uploads, downloads and logging in on Linux or Mac computers

You can upload a file by opening a terminal program and using the command

scp <SourcePath&FileName> <YourUserName>@iridis4_a.soton.ac.uk:<DestinationPath&FileName>

Note that it is your iSolutions password that you need to input when prompted. For example, I might type

scp main.m rm@iridis4_a.soton.ac.uk:MySimulations/BPSKinAWGN/ 

You can download using the command

scp <YourUserName>@iridis4_a.soton.ac.uk:<SourcePath&FileName> <DestinationPath&FileName>  

and you can log in using the command

ssh -X <YourUserName>@iridis4_a.soton.ac.uk

Again, it is your iSolutions password that you need to input when prompted. 

1b. Uploads, downloads and logging in on Windows computers

You can upload and download files using PSCP. You should save this to your My Documents folder. Next, you should open a command window by clicking Start, then Run... and then typing

cmd

You can change to your My Documents folder by typing

cd "My Documents"

You can upload a file by typing

pscp <SourcePath&FileName> <YourUserName>@iridis4_a.soton.ac.uk:<DestinationPath&FileName>

Note that it is your iSolutions password that you need to input when prompted. For example, I might type

pscp main.cpp rm@iridis4_a.soton.ac.uk:MySimulations/BPSKinAWGN/ 

You can download using the command

pscp <YourUserName>@iridis4_a.soton.ac.uk:<SourcePath&FileName> <DestinationPath&FileName>  

In order to log in to Lyceum4, you need to save PuTTY to your My Documents folder. From within the My Documents folder in the command window, you should type

putty <YourUserName>@iridis4_a.soton.ac.uk

Again, it is your iSolutions password that you need to input when prompted.  You can find out more about PuTTY and PSCP here

2. Installing the Matlab project template on Lyceum4

The first step is to log in to Lyceum4 and then download the Matlab project template. You can do this by giving Lyceum4 the command

wget http://users.ecs.soton.ac.uk/rm/MatlabLyceumProject.tgz

You can extract the template by typing

tar -xzvf MatlabLyceumProject.tgz

This will create a directory named MatlabLyceumProject, which you should go into by typing

cd MatlabLyceumProject

If you type

ls

you'll see that the MatlabLyceumProject directory contains a job file and a couple of Matlab files. You can edit main.m using the emacs editor by typing

emacs main.m

3. Running jobs on Lyceum4

Once you have written your Matlab code, you can get Lyceum4 to run it by submitting a job file. The Matlab project template includes an example job file called 'job', which you can edit using the command

emacs job

from within the MatlabLyceumProject directory. This job file will request sixteen processors on one of Lyceum4's nodes, for one minute. It will run sixteen instances of main.m. You can request a different number of nodes or a different number of processors per node by changing the following line in the job file

#PBS -l nodes=1:ppn=16

Likewise, you can request more than one minute of processor time by changing the following line in the job file

#PBS -l walltime=00:01:00

In the job file, the ampersands (&) at the end of each line that runs the executable are required in order to get them to run in parallel. Each of the sixteen instances uses different command line parameters, which specify the SNRs to consider. The job can be submitted to Lyceum4 by issuing the command

qsub job

from within the MatlabLyceumProject directory. You can see the state of your jobs (Queued or Running) by using the command

qstat

This will tell you the Job ID number, which you need in order to cancel a job using the command

qdel <JobID>

You can see how busy Lyceum4 is using the command

showq

When the example job has finished running, you should find that some results files have been created. You can consolidate these files into one by running the consolidate.m script on Lyceum4's login node. You can do this using the commands

module load matlab
matlab -r "consolidate"

Note that it is okay to run quick scripts like this on the login node. However, long simulations should always be run by submitting them as jobs, as described above.

Have fun, Rob Maunder.

University of Southampton: