The script runs very quickly when the LBFGS optimizer is used. But see what happens if we switch to the BFGS optimizer instead (change the OPTIMIZER variable in the cp2k input file - you might want to reduce the size of the supercells in the driver script - NREP varying from 1 to 6 perhaps). Look at the timings that cp2k prints at the end of a run and see if you can see the culprit. Also look for warnings in your outputs (this is a good habit to get into).

How does the conjugate gradients optimizer compare to LBFGS in efficiency for this system?

Cell optimization of NaCl

For studying many properties of solid materials it is important that the lattice parameters used in a simulation are close to equilibrium for the model chemistry (Hamiltonian) used. Otherwise, large stresses can be present that complicate comparison to experiment. Successful cell optimization requires that the energy changes smoothly with cell volume - and for this the energy cutoff is the most important parameter. The input file template below template.inp can be used with driver script to examine how the energy volume curve of NaCl changes with the PW cutoff.

What is happening here? Try changing the PW cutoff (defined in the driver script) and using the CELL_REF variable.

Copy the input template to a new file and change the RUN_TYPE to CELL_OPT. You'll also need to ask the code to calculate the stress tensor (in FORCE_EVAL section) ANALYTICALly! Also define the CUTOFF and SCALING_FACTOR. Start the cell optimization from small cells (SCALING_FACTOR 0.85) or large cells (SCALING_FACTOR 1.10) - do you get the same results?

If you are running on ARCHER, use some larger parallel jobs to check whether increasing the supercell size (NREP variable) affects the results.