Potential waste of MPI communicators
@kjako observed a "too many MPI communicators" error in a calculation. I think this is caused by the constructor of SampleListBase
, which unconditionally creates a new communicator and stores it in self._active_comm
. When either too many sampe lists are generated, or if the garbage collector does not recycle them quickly enough, MPI will run out of comunicators (typical limits are 2048 or 4096).
I don't know a really good solution for this, but we may need a global communicator cache so that we don't recreate the "same" communicator over and over.