The HECToR Service is now closed and has been superceded by ARCHER.

CASTEP

Useful links

Licensing and Access

CASTEP is licensed software. Please see the CASTEP web page for details. Users who wish to access the CASTEP package should contact the HECToR Helpdesk.

Running

To run CASTEP you need to add the correct module. The default version of CASTEP is 6.0:

module add castep

Once the module has been added the CASTEP executable is available as castep. To load CASTEP 6.0.1 you would use:

module add castep/6.0.1

An example CASTEP 6.0 job submission script is shown below.


#!/bin/bash --login
#PBS -N castep_job
#PBS -V
#PBS -l mppwidth=2048
#PBS -l mppnppn=32
#PBS -l walltime=03:00:00
#PBS -A z01

# Make sure any symbolic links are resolved to absolute path
export PBS_O_WORKDIR=$(readlink -f $PBS_O_WORKDIR)

# Change to the directory that the job was submitted from
cd $PBS_O_WORKDIR

# Load the CASTEP module
module add castep

# This line sets the temporary directory - without it CASTEP will fail
export GFORTRAN_TMPDIR=$PBS_O_WORKDIR

# Set the number of threads to 1
#   This prevents any system libraries from automatically 
#   using threading.
export OMP_NUM_THREADS=1

# Change the name of the input file to match your own job
aprun -n 2048 -N 32 castep my_job

Known issues

When setting the $GFORTRAN_TMPDIR environment variable you must use the absolute /work path rather than a symbolic link to /work from the /home filesystem otherwise your calculation will fail. This is done in the example above by resetting the PBS_O_WORKDIR environment variable using the readlink command.

CASTEP has an option to optimise its run between speed and memory saving. This is controlled either by parameter:

OPT_STRATEGY_BIAS [=-3..3]

or equivalently

OPT_STRATEGY=MEMORY/DEFAULT/SPEED

Normally it should be recommended that users choose OPT_STRATEGY=SPEED/OPT_STRATEGY_BIAS=+3 unless the run attempts to use more memory than available. (Even in that case the first choice should be to increase the number of processors used and distribute the memory if possible.)

Compiling