Added assert(idle.size() == num_devices) after iod.wait()