has_work() function in sched/base (it can break mpi mode). WaitAndProcess instead of PollAndProcess: it is much more efficivent. This version may not work with mpi