change algorithm at task-end and locality-check