Implementtion of the Dijkstra-Scholten algorithm for termination detection