https://openfoam-parallelisation-course.github.io/workshop/chapters/collective-comms-api/
collective comms are the way to go; use Pstream::gatherList() to gather all lists on master process, combine on master and scatter the result to all other processes
PS: if you can afford to, don't do this, instead communicate the (probably smaller) data you are interested in, max(yourList), sum(yourList) ... etc
from each proc, and do collective comms on that, as it helps with better scaling