'Converts the given matrix to a distributed sparse matrix.
Parameters
local_mat : NumPy 2D array.
Returns
Elemental distributed sparse matrix.'

@staticmethod
def distr_mat(local_mat):

    import El
    local_mat = local_mat.tocoo()
    mat = El.DistSparseMatrix()
    mat.Resize(*local_mat.shape)
    mat.Reserve(len(local_mat.data))
    for (val, i, j) in zip(local_mat.data, local_mat.row.astype(int), local_mat.col.astype(int)):
        mat.QueueUpdate(i, j, val)
    mat.ProcessQueues()
    return mat
