fix for nprocs larger than matrix dimensions