Refactor paralleltest_nprand.