cc_staff
229
edits
m (add category "ComputationalChemistry") |
(add example of multi-threaded run) |
||
Line 35: | Line 35: | ||
#SBATCH --time=0-00:15 # time (DD-HH:MM) | #SBATCH --time=0-00:15 # time (DD-HH:MM) | ||
module load cp2k/ | module load cp2k/8.2 | ||
srun cp2k.popt -o Si_bulk8.out Si_bulk8.inp | srun cp2k.popt -o Si_bulk8.out Si_bulk8.inp | ||
}} | }} | ||
Line 58: | Line 58: | ||
<!--T:11--> | <!--T:11--> | ||
The output of CP2K will be located in the file Si_bulk8.out. There will also be an output file named slurm-*.out which should be empty if the calculation completed without error. | The output of CP2K will be located in the file Si_bulk8.out. There will also be an output file named slurm-*.out which should be empty if the calculation completed without error. | ||
== Threaded/MPI jobs == | |||
The installation of CP2K version 8.2 and later includes both the MPI executable cp2k.popt and the OpenMP/MPI executable cp2k.psmp, which may give better performance for some calculations. Our test shows a 10% performance increase for QS/H2O-512.inp benchmark when using 2 threads | |||
per MPI process, compared to running MPI-only executable cp2k.popt (both runs used the same number of CPU cores in total). | |||
Below is an example OpenMP/MPI job submission file for the Beluga cluster. To use on other clusters, the number of tasks would have to be adjusted to match the number of cores available on the nodes of that cluster. The performance change when threads are used is highly problem dependent, and running the cp2k.psmp executable may actually be slower for some cases, so you must benchmark your code and choose the right option for your particular case. | |||
{{File | |||
|name=openmp_mpi_job.sh | |||
|lang="sh" | |||
|contents= | |||
#!/bin/bash | |||
#SBATCH --account=def-someuser | |||
#SBATCH --nodes=2 | |||
#SBATCH --ntasks=40 # number of MPI processes | |||
#SBATCH --cpus-per-task=2 | |||
#SBATCH --mem-per-cpu=3G # memory; default unit is megabytes | |||
#SBATCH --time=0-00:59 # time (DD-HH:MM) | |||
module load cp2k/8.2 | |||
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK | |||
srun cp2k.psmp -o H2O-512.out H2O-512.inp | |||
}} | |||
</translate> | </translate> |