Whenever there shall be a vacancy in the office of the warden of a correctional institution, or when the warden shall necessarily be absent from the correctional institution, all the duties and keeping of the inmates and the discipline of the correctional institution shall devolve upon and be executed by the person designated by the warden until the vacancy be filled, or the warden returned to the correctional institution. The deputy warden shall perform, under the directions of the warden, such duties connected with the office of the latter as the warden may assign the deputy warden, and shall in all things cooperate with the warden in the government, management and police regulations of the correctional institution.