A new subroutine algor_diagonalise was created to handle matrix diagonalisation. This subroutine takes a complex matrix and returns its eigenvectors and eigenvalues. Optional arguments specify the symmetry of the matrix (e.g. Hermitian).
The initialisation of the Basic Linear Algebra Communication Subroutines (BLACS) that are used by ScaLAPACK for its communication is done in the comms module, inside comms_parallel_strategy. Because BLACS libraries are not commonplace, all of the BLACS and ScaLAPACK calls are wrapped inside conditional compilation sections - only if Castep is compiled with -DBLACS will the parallel matrix diagonalisers and inverters be used.
As has already been mentioned (e.g. sections 3.2.2 and 4.2.2), in testing it was found that in fact the largest matrix Castep diagonalises in the al3x3 benchmark is not a band-overlap matrix at all, but a projector-projector overlap matrix. Rewriting this to take advantage of the distributed inverter gave the single greatest performance benefit in this phase of the project.