Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patchkernel: improve adaption/partitioning tracking #370

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

andrea-iob
Copy link
Member

Adaption/partitioning tracking is extended also to vertices and interfaces. However, tracking of vertices and interfaces offers only a limited set of information.

During adaption, information available for tracking purposes are the following:

  • internal cells that have been coarsened/refined;
  • new internal vertices that have been created;
  • internal vertices that have been deleted;
  • new ghost cells that have been created;
  • new ghost vertices that have been created;
  • ghost cells that have been deleted;
  • ghost vertices that have been deleted;
  • new interfaces that have been created;
  • interfaces that have been deleted.

During partitioning, information available on the sender side for tracking purposes are the following:

  • internal cells that have been sent;
  • internal vertices that have been sent;
  • new ghost cells that have been created (some of the internal cells that
    have been sent may have become ghosts cells);
  • new ghost vertices that have been created (some of the internal vertices
    that have been sent may have become ghosts vertices);
  • ghost cells that have been deleted;
  • ghost vertices that have been deleted;
  • new interfaces that have been created;
  • interfaces that have been deleted.

During partitioning, information available on the receiver side for tracking purposes are the following:

  • internal cells that have been received;
  • internal vertices that have been received;
  • new ghost cells that have been created;
  • new ghost vertices that have been created;
  • ghost cells that have been deleted (some ghost cells may have been replaced by internal cells that have just been received);
  • ghost vertices that have been deleted (some ghost vertices may have been replaced by internal vertices that have just been received);
  • new interfaces that have been created;
  • interfaces that have been deleted.

@andrea-iob andrea-iob self-assigned this Feb 3, 2023
@andrea-iob andrea-iob changed the title patchkernel: improve adaption/partitioning tacking patchkernel: improve adaption/partitioning tracking Feb 3, 2023
@andrea-iob andrea-iob force-pushed the patchkernel.fix.adaption.tracking branch 2 times, most recently from ccbb63e to 552890e Compare February 6, 2023 08:18
@andrea-iob andrea-iob force-pushed the patchkernel.fix.adaption.tracking branch from 32d6e4c to 552890e Compare February 20, 2023 13:49
@andrea-iob andrea-iob force-pushed the patchkernel.fix.adaption.tracking branch from 5b2019b to 552890e Compare March 7, 2023 12:22
@andrea-iob
Copy link
Member Author

andrea-iob commented Apr 4, 2023

Test failures seems related to problems with travis; pull requests #371 and #372 contain also these changes and there the tests pass just fine.

@edoardolombardi
Copy link
Member

The pull seems not working for vertices tracking. The adaption info returned for entity VERTEX are empty.

You can see with following modifications to test_volunstructured_parallel_00001 as following (this code chunk at the place of line 523):

` std::vectorbitpit::adaption::Info adaptionInfo = patch_3D->partition(cellRanks, true, true);

log::cout() << "adaption info size: " << adaptionInfo.size() << std::endl;

for (auto & info : adaptionInfo) {
    if (info.entity == bitpit::adaption::Entity::ENTITY_CELL) {
        log::cout() << "cell info previous: " << info.previous << std::endl;
        log::cout() << "cell info current: " << info.current << std::endl;
    }
    else if (info.entity == bitpit::adaption::Entity::ENTITY_VERTEX) {
        log::cout() << "vertex info previous: " << info.previous << std::endl;
        log::cout() << "vertex info current: " << info.current << std::endl;
    }

}

`
The previous/current vectors in case of ENTITY_VERTEX adaption entity are empty.
But maybe I'm doing something wrong in the usage...

@andrea-iob could you add in the pull a test or an example of usage of the tracking results, please? For both purposes, to test the implementation (at least that there are no empty structures neither segmentation fault, or better if a predefined partitioning is reached) and to help the usage.

I don't know where is the best place and the best way to explain it, but could you also add some comments to the documentation or of the adaption info structures (completely missing) or to the partition methods to explain what the returning objects mean, please? What are the current ids, the previous ones for instance, where the user can find info on ghost cells/vertices/interfaces, etc.
Practically, I think that it should be enough explaining where each one of the info that you listed in the description of the pull can be retrieved.

Thanks

@andrea-iob andrea-iob requested a review from lucask81 June 30, 2023 14:07
@andrea-iob
Copy link
Member Author

Tracking vertex send/receive during partitioning is more tricky than expected. The image represent a 2x2 mesh before (left) and after (right) the bottom left cell has been send from process #0 to process #2.

vertex_tracking

Cell exchange involves ranks #⁠0 and #⁠2, but after the cell have been send there are some vertices that are now owned by process #⁠1 (the owner of a vertex is the process with the lowest rank). The tracking should than report that those vertices have been sent to process #⁠1 from process #⁠0. I'm not sure how I can get that information in the partitioning prepare stage (this is when vertex data to be send should be collected).

The best solution would be to void tracking data exchange for vertices and relay on cell exchange to communicate vertex data.

        for (const auto &adaptionInfo : updateData) {
            if (adaptionInfo.entity != adaption::ENTITY_CELL) {
                continue;
            }

            int rank = adaptionInfo.rank;
            adaption::Type adaptionType = adaptionInfo.type;
            if (adaptionType == adaption::TYPE_PARTITION_SEND) {
                const std::vector<long> &cellsToSend = adaptionInfo.previous;
                std::vector<long> verticesToSend = patch->getOrderedCellsVertices(cellsToSend, true, true);
                
                // Start vertex communications
                ...              
            }
        }

I've already modified the branch to allow that, after some more tests I'll push it.

@andrea-iob andrea-iob force-pushed the patchkernel.fix.adaption.tracking branch from 552890e to b8fb3af Compare August 1, 2023 13:53
@andrea-iob andrea-iob force-pushed the patchkernel.fix.adaption.tracking branch from b8fb3af to d63a6c7 Compare June 6, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants