An array of sixteen laser-pumped scalar Cs magnetometers was part of the neutron electric dipole moment (nEDM) experiment taking data at the Paul Scherrer Institute in 2015 and 2016. It was deployed to measure the gradients of the experiments magnetic field and to monitor their temporal evolution. The originality of the array lies in its compact design, in which a single near-infrared diode laser drives all magnetometers that are located in a high-vacuum chamber, with a selection of the sensors mounted on a high-voltage electrode. We describe details of the Cs sensors construction and modes of operation, emphasizing the accuracy and sensitivity of the magnetic field readout. We present two applications of the magnetometer array directly beneficial to the nEDM experiment: (i) the implementation of a strategy to correct for the drift of the vertical magnetic field gradient and (ii) a procedure to homogenize the magnetic field. The first reduces the uncertainty of the new nEDM result. The second enables transverse neutron spin relaxation times exceeding 1500 s, improving the statistical sensitivity of the nEDM experiment by about 35% and effectively increasing the rate of nEDM data taking by a factor of 1.8.