thomas parallelization of PND code