code: def _get_ownership(self, data):
          
          rank = self.comm.rank
  
          B = [(rank, idx) for (idx, c) in enumerate(data) if c is not None]
          C = self.comm.allreduce(B)
          ownership = [None] * len(data)
          for c in C:
              ownership[c[1]] = c[0]
          return ownership
docs: Determine on which rank each subject currently resides
  
          Parameters
          ----------
  
          data: list of 4D arrays with subject data
  
          Returns
          -------
  
          list of ranks indicating the owner of each subject