Add bounds check during lma to csr conversion
Fix csr representation for mpi/cuda