Automatically choose the faster algorithm when nkx=nky=nkz.