Grain growth competition and formation of grain boundaries during solidification of hcp alloys