add MPI for multiple tasks; still work in progress but non-MPI (HAVE_MPI not defined) is ok