kai's MPI code for topdown algorithm