make gridspec optional for p2d