Reverse direction of sample output and keep track of task -> slave mapping for restarts