When any inmate is sentenced by the courts to the workhouse, the inmate's time of sentence to begin after a term of imprisonment in the penitentiary has expired, the judge of the court shall, in the commitment to the penitentiary, cause this fact to appear and shall direct the warden of the penitentiary to notify the superintendent of the workhouse of the time when the inmate will be discharged. It is the warden's duty to deliver the inmate upon the order of the superintendent.