Add const to thread-MPI functions