Use mask for dynamic Pregel