This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
workshops:hpcprac2 [2017/07/04 17:03] kevin |
workshops:hpcprac2 [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | =====Practical 2: Using CHPC===== | + | =====Practical 2: OpenMP & Using CHPC===== |
| **Aim:** to launch a parallel job on the CHPC cluster //Lengau//. | **Aim:** to launch a parallel job on the CHPC cluster //Lengau//. | ||
| Line 68: | Line 68: | ||
| Copy the // | Copy the // | ||
| - | cp ~/ | + | cp ~/ |
| + | |||
| + | cd ~/lustre | ||
| Then untar (unpack) it. | Then untar (unpack) it. | ||
| - | tar -zxvf ~/OpenMP_Tut.tar.gz | + | tar -zxvf OpenMP_Tut.tar.gz |
| And then go into the //OpenMP/// tut directory and start the practical. | And then go into the //OpenMP/// tut directory and start the practical. | ||
| Line 81: | Line 83: | ||
| Most of the prac can be done in an interactive session. | Most of the prac can be done in an interactive session. | ||
| - | |||
| - | To execute longer running jobs you will need to submit a job script to the scheduler. | ||
| - | |||
| - | cp ~/ | ||
| - | |||
| - | |||
| - | **example.sh**: | ||
| - | <code lang=bash> | ||
| - | #!/bin/bash | ||
| - | #PBS -N example01 | ||
| - | #PBS -l select=1: | ||
| - | #PBS -P Wchpc | ||
| - | #PBS -q R522145 | ||
| - | #PBS -W group_list=training | ||
| - | #PBS -l walltime=4: | ||
| - | |||
| - | CWD=/ | ||
| - | |||
| - | |||
| - | |||
| - | cd $CWD | ||
| - | echo " | ||
| - | nproc=`cat $PBS_NODEFILE | wc -l` | ||
| - | echo "nproc is $nproc" | ||
| - | echo "Nodes used by this job:" | ||
| - | cat $PBS_NODEFILE | ||
| - | |||
| - | echo " | ||
| - | # Insert command to run here: | ||
| - | |||
| - | echo "... done." | ||
| - | </ | ||
| - | |||
| - | Note that the options passed to the **qsub** command appear as shell comment lines that start with ''# | ||
| - | |||
| - | **Note: the script uses // | ||
| - | |||
| - | mkdir ~/ | ||
| - | |||
| - | or edit the script file to point to the prac directory. | ||
| - | |||
| - | **NOTE: your script will fail if you don't use the Lustre file system.** | ||
| - | |||
| - | In the example file the command to actually run your code is missing. | ||
| - | |||
| - | |||
| - | To then submit the job script to the scheduler you simply use | ||
| - | |||
| - | qsub example.sh | ||
| - | | ||
| - | The **qsub** command will read all its option parameters from the file. | ||
| - | |||
| - | |||
| - | ====Job Control==== | ||
| - | |||
| - | |||
| - | To check the status of your jobs in the Winter School queue: | ||
| - | |||
| - | qstat | grep R522145 | ||
| - | |||
| - | This command lists all the jobs in the **R522145** queue. | ||
| - | |||
| - | Use the **qdel** command to remove a queue job from the queue. | ||
| - | |||
| - | qdel jobid | ||
| - | |||
| - | where //jobid// is replaced by the number of the job (looks like '' | ||
| - | |||