In the discrete 2D XY model of finite number of point dipoles of square spin ice, the order parameter has been calculated exactly as the average size of the maximal cluster. The finite size and edge effects do not allow research the critical behavior of the phase transition for finite systems. It is found that frustrations in spin ice model with long-range interaction are possible only in presence of symmetry for the distribution of magnetic moments.