(a) a petition under this Act has been presented to the district court having jurisdiction by a party to the marriage praying for a decree for judicial separation under section 23 or for a decree of divorce under section 27, and
(b) another petition under this Act has been presented thereafter by the other party to the marriage praying for decree for judicial separation under section 23, or for decree of divorce under section 27 on any ground whether in the same district court or in a different district court, in the same State or in a different State, the petition shall be dealt with as specified in sub- section (2).