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

WIP read_distributed with pre-existing data #1631

Conversation

greole
Copy link
Collaborator

@greole greole commented Jun 26, 2024

This PR adds a version of read_distributed that works on existing local data and non_local_data and comm_pattern.

@ginkgo-bot ginkgo-bot added the mod:core This is related to the core module. label Jun 26, 2024
@greole greole changed the title WIP read_distributed with pre existing data and comm_pattern WIP read_distributed with pre-existing data Jun 26, 2024
@yhmtsai
Copy link
Member

yhmtsai commented Jun 26, 2024

Is it more straight way in openFoam application? you can also do it with create function from existing linop and comm pattern.

@greole
Copy link
Collaborator Author

greole commented Jun 26, 2024

I'll add an extra constructor/create function. The reasoning is that we basically already local and non_local data and the communication pattern already in place from OpenFOAM.

@greole
Copy link
Collaborator Author

greole commented Jun 27, 2024

I just realised that the following create method should be sufficient:

template <typename ValueType, typename LocalIndexType, typename GlobalIndexType>
std::unique_ptr<Matrix<ValueType, LocalIndexType, GlobalIndexType>>
Matrix<ValueType, LocalIndexType, GlobalIndexType>::create(
    std::shared_ptr<const Executor> exec, mpi::communicator comm, dim<2> size,
    std::shared_ptr<LinOp> local_linop, std::shared_ptr<LinOp> non_local_linop,
    std::vector<comm_index_type> recv_sizes,
    std::vector<comm_index_type> recv_offsets,
    array<local_index_type> recv_gather_idxs)

@greole greole closed this Jun 27, 2024
@upsj
Copy link
Member

upsj commented Jun 27, 2024

@greole Agreed in general, though we should be using the abstractions from #1588 and #1589 once they are available, instead of raw vectors/arrays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod:core This is related to the core module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants