Domain decomposition algorithms for spectral methods