These are the errors when I run my supercell on material studio using CASTEP module. I have tried decreasing k points and also increased the cutoff energy. Furthermore I deleted all the files related to my material. But every time I am facing the same issue. I am using hybrid functional with norm conserving pseudopotential. How can I fix it??

  • $\begingroup$ +1 but can you please take a screenshot from your computer rather than a photograph from a camera? $\endgroup$ Feb 3 at 11:59

1 Answer 1


The error message says that the computer did not have enough memory to perform the calculation (line 2 of the log you photographed). You don't give any details about your calculation, but in general the memory required for a CASTEP calculation (or any plane-wave DFT calculation) is proportional to the:

  • number of plane-waves ($\propto {E_\mathrm{cut}}^{\frac{3}{2}}\Omega$, where $E_\mathrm{cut}$ is the plane-wave cut-off energy and $\Omega$ is the volume of the simulation cell)
  • number of atoms (which affects the number of bands and also the number of pseudopotential projectors)
  • number of k-points (symmetry-reduced)

Reducing any of these will reduce the memory requirements, though of course you need to be satisfied that your calculation is scientifically reasonable. Certain kinds of calculation also require more RAM, for example non-local exchange-correlation functionals need significantly more RAM than semi-local functionals.

CASTEP tries to estimate the RAM it requires at the start of a calculation, and writes it to the output file. It's not 100% accurate, but the data estimates shouldn't be too far out. Here's an example from a small calculation:

+---------------- MEMORY AND SCRATCH DISK ESTIMATES PER PROCESS --------------+
|                                                     Memory          Disk    |
| Baseline code, static data and system overhead      507.0 MB         0.0 MB |
| BLAS internal memory storage                          0.0 MB         0.0 MB |
| Model and support data                               88.1 MB         0.0 MB |
| Electronic energy minimisation requirements          37.7 MB         0.0 MB |
| Force calculation requirements                        2.9 MB         0.0 MB |
|                                               ----------------------------- |
| Approx. total storage required per process          632.8 MB         0.0 MB |
|                                                                             |
| Requirements will fluctuate during execution and may exceed these estimates |

(NB there's a slightly weird issue with some Linux builds where the baseline code appears to take many gigabytes, but the other estimated components should be good.)

I recommend you take a look at your .castep output file from the server, and see what CASTEP's memory estimate is for your calculation. If you don't have a .castep file then that usually means the RAM requirements are so large that CASTEP couldn't even get to the point where it computes the estimate!

Using disk space instead of RAM

You can ask CASTEP to conserve as much RAM as possible by moving the optimisation strategy from "speed" to "memory"; in your param file:

opt_strategy : memory

or, equivalently,

opt_strategy_bias : -3

I can't remember how you do this from the Materials Studio GUI but it's in the options somewhere. This will cause CASTEP not to keep some auxiliary data in RAM, in which case it will either recalculate it whenever it's needed, or save it to disk and read it back in when needed. (Note that CASTEP will not run as quickly if you do this.)

CASTEP can also page wavefunctions to disk, so that the data for only one k-point is stored in RAM at any one time. In the param file you can set page_wvfns to a negative number to mean "always page":

page_wvfns : -1

Parallel calculations

If you're running the calculation MPI-parallel, switching to OpenMP threading instead should also lower the RAM requirements; e.g. instead of

mpirun -np 2 castep.mpi myinput

(where "myinput" is the filename prefix you're using) you would set the environment variable CASTEP_NUM_THREADS to 2 and then run either the serial version of CASTEP or the MPI version but with only one process. For example, in a bash environment you would do

mpirun -np 1 castep.mpi myinput


The computer you're running on doesn't have enough RAM to perform that simulation. You could reduce the RAM required by carefully lowering the simulation accuracy, but there are limits to what you can do without compromising your scientific aims. You can ask CASTEP to save RAM where possible (though the simulations will take more time). Finally, it may be that your calculation is simply too large for that computer, and you need to find a machine with more RAM.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .