Skip to content
  • Mark OLESEN's avatar
    ENH: add simplified gather methods for globalIndex with default communicator · f498d09d
    Mark OLESEN authored
    - when combining lists in processor order this simplifies code and
      reduces memory overhead.
    
      Write this:
        ----
        labelList collected;
    
        const globalIndex sizing(input.size());
        sizing.gather(input, collected);
        ----
    
      OR
    
        ----
        labelList collected;
        globalIndex::gatherOp(input, collected);
        ----
    
      Instead of this:
    
        ----
        labelList collected;
    
        List<labelList> scratch(Pstream::nProcs());
        scratch[Pstream::myProcNo()] = input;
        Pstream::gatherList(scratch);
    
        if (Pstream::master())
        {
            collected = ListListOps::combine<labelList>
            (
                scratch,
                accessOp<labelList>()
            );
        }
        scratch.clear();
        ----
    f498d09d