Distributed simulation and optimization of large-area metasurfaces