Given that, in our targeted application, each rank only communicates with a constant number of neighbors (independent of the system size), we created a layout of "disposable communicators" , each of which only contained two ranks.
assuming no collectives were needed, we created a communicator for every pair of ranks that had to communicate.