Recent experiments suggest that the onset of lasing in optically active
disordered media is related to an ergodicity-breaking transition for the
degrees of freedom of the electromagnetic field. We test this hypothesis in
numerical simulations of the dynamics of nonlinearly coupled light modes under
external pumping. The collective behavior of light mode amplitudes appears to
be akin to the one displayed in glass formers around the ergodicity breaking
glass transition: a critical pumping exists, beyond which the thermodynamic
phase is fragmented into a multitude of states. The probability distribution of
the overlap between such states, i.e., the glass order parameter, turns out to
be well described by the replica symmetry breaking scheme. The unprecedented
observation is that such symmetry breaking occurs at the same pumping power
values at which a lack of equipartition among light modes arises. Finally, we
show that the mean-field scenario for the glass transition is quite robust for
the description of the physics of random lasers.Comment: 13 pages, 4 figure