User Tools

Site Tools


exercises:2019_conexs_newcastle:ex0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
exercises:2019_conexs_newcastle:ex0 [2019/09/10 16:22] – [Using PuTTY] abussyexercises:2019_conexs_newcastle:ex0 [2019/09/10 17:17] – [Launching a CP2K calculation] abussy
Line 30: Line 30:
  
 Keep the default `SFTP` file protocol and type `rocket.hpc.ncl.ac.uk` in the `Host name` field, `nconexs##` in `User name` and your password in the corrsponding file. Hit Login and browse! Keep the default `SFTP` file protocol and type `rocket.hpc.ncl.ac.uk` in the `Host name` field, `nconexs##` in `User name` and your password in the corrsponding file. Hit Login and browse!
 +
 +
 +===== Going to the proper directory  =====
 +
 +In your PuTTY terminal, type the following:
 +
 +<code>
 +cd /nobackup/nconexs##/
 +</code>
 +
 +`cd` is the bash command allowing you to move from a directory to another. If you then type the `ls` command, the files contained in this directory will be listed. 
 +
 +To browse to the same file in WinSCP, use the top right field (currently displaying `nconexs##`) and first go to `/ <root>`, then `nobackup` and finally your `nconexs##` directory. You should see the same files as in the WinSCP terminal.
 +
 +
 +**You can edit files, create new files and directories, etc. either directly in the PuTTY terminal or using WinSCP**
 +===== Launching a CP2K calculation  =====
 +
 +The `cp2k.sh` file contains a set of (machine) instructions that allows you to run a job in parallel on the HPC cluster. You can open and edit this file directly in the PuTTY terminal or through WinSCP.
 +
 +<code - cp2k.sh>
 +
 +#!/bin/bash
 +
 +#SBATCH --ntasks=6
 +#SBATCH --tasks-per-node=6
 +#SBATCH --job-name=test
 +
 +myaccount=tpcss
 +export SLURM_ACCOUNT=$myaccount
 +export SBATCH_ACCOUNT=$myaccount
 +export SALLOC_ACCOUNT=$myaccount
 +myres=1
 +export SLURM_RESERVATION=${myaccount}_${myres}
 +export SBATCH_RESERVATION=${myaccount}_${myres}
 +export SALLOC_RESERVATIION=${myaccount}_${myres}
 +
 +
 +module load CP2K/6.1-foss-2017b
 +export OMP_NUM_THREADS=1
 +
 +mpirun -np $SLURM_NTASKS --bind-to core cp2k.popt /nobackup/nconexs03/test.inp > /nobackup/nconexs03/test.out
 +
 +
 +</code>
 +
 +
 +The first line of this file simply marks it as an executable. The next three lines (starting with `#SBATCH`) indicates how many CPUs will be used for this calculation and the its name. If you were to run 8 cores, the you would need to change the `ntasks` and `tasks-per-node` accordingly.
 +
 +
 +The next paragraph specifies a bunch of indications for the queue system which we do not need to understand and should not modify.
 +
 +The `module load` line indicates which (available) version of CP2K to use and the final line is the actual launch command.
 +
 +Look at the structure of that last line. `/nobackup/nconexs03/test.inp` is the path to your CP2K input file and `/nobackup/nconexs03/test.out` that of your input file. You will have to edit those paths for your own calculation. Note that in principle, you can use either absolute paths or relative paths.
 +
 +To launch the calculation, you have to run the `cp2k.sh` file. This is done via the `sbatch` command (to be typed in the PuTTY terminal):
 +
 +
 +<code>
 +sbatch cp2k.sh
 +</code>
 +
 +Note that this specific example will fail, as you do not have access to the `nconexs03` directory.
 +
 +
 +==== Keeping track of your job ====
 +
 +
 +There are a few very useful (terminal) commands that you can use to keep track of your calculations. First of which is the
 +
 +
 +<code>
 +squeue -u nconexs##
 +</code>
 +
 +
 +which informs you about the state of your calculation (whether it is in the queue, or if it is currently running, and also the job id). 
 +
 +If you want to kill your job, you can do so using the `scancel` command:
 +
 +<code>
 +scancel jobid(obtained with squeue)
 +</code>
 +
 +
 +Finally you can also follow the state of your calculation by checking the output file as it is written using the `tail` command:
 +
 +
 +<code>
 +
 +tail -f path_to_your_output_file
 +</code>
 +
 +
 +This command can be exited by pressing `Ctrl+c`
 +
 +
 +
  
exercises/2019_conexs_newcastle/ex0.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1