-
Notifications
You must be signed in to change notification settings - Fork 1
MGTwoLevelTransferCopyToHost #25
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
Conversation
| * An abstract base class for transfer operators between two multigrid levels. | ||
| * The implementation of | ||
| * restriction and prolongation between levels is delegated to derived classes, | ||
| * which implement prolongate_and_add_internal() and restrict_and_add_internal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update this
80576a3 to
c696016
Compare
| MemorySpace::Default>>, | ||
| "This class is currently only implemented for vectors of " | ||
| "type LinearAlgebra::distributed::Vector."); | ||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line
| * Default constructor. | ||
| */ | ||
| MGTwoLevelTransferBase(); | ||
| MGTwoLevelTransferBase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MGTwoLevelTransferBase() | |
| MGTwoLevelTransferBase() = default; |
| MemorySpace::Host>> || | ||
| std::is_same_v< | ||
| VectorType, | ||
| LinearAlgebra::distributed::Vector<typename VectorType::value_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only support host
|
|
||
| /** | ||
| * A class which provides extra functionality used by several MGTwoLevelTransfer | ||
| * schemes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base class for nonnested and mgtransfertwolevel
| */ | ||
| using Number = typename VectorType::value_type; | ||
|
|
||
| using VectorTypeHost = LinearAlgebra::distributed::Vector<Number>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| using VectorTypeHost = LinearAlgebra::distributed::Vector<Number>; | |
| using VectorTypeHost = LinearAlgebra::distributed::Vector<Number,MemorySpace::Host>; |
| VectorTypeHost dst_host; | ||
| VectorTypeHost src_host; | ||
|
|
||
| copy_to_host(dst_host, dst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary
| VectorTypeHost dst_host; | ||
| VectorTypeHost src_host; | ||
|
|
||
| dst_host.reinit(dst.get_partitioner()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy should be necessary
| interpolate(VectorType &dst, const VectorType &src) const override | ||
| { | ||
| VectorTypeHost dst_host; | ||
| VectorTypeHost src_host; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make these class members
| src.get_partitioner()->locally_owned_range()); | ||
| rw_vector.import_elements(src, VectorOperation::insert); | ||
|
|
||
| dst.reinit(src.get_partitioner()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if size is ==0:
| return {t->dof_handler_fine, t->mg_level_fine}; | ||
| } | ||
|
|
||
| if (const auto t = dynamic_cast<const MGTwoLevelTransferCopyToHost< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might need constexpr if memoryspace==::default
c696016 to
438684e
Compare
tjhei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Feel free to open the PR to deal.II.
| * An abstract base class for transfer operators between two multigrid levels. | ||
| * The implementation of | ||
| * restriction and prolongation between levels is delegated to derived classes, | ||
| * which implement prolongate_and_add_internal() and restrict_and_add_internal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update this
| /** | ||
| * Default constructor. | ||
| */ | ||
| MGTwoLevelTransferCore(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either do = default; or update the comment to just say "constructor" if you need it to do something. :-)
| /** | ||
| * Vectors used for the host transfer. | ||
| */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line
| // &, | ||
| // const LinearAlgebra::distributed::Vector<S2, MemorySpace::Host> &, | ||
| // const bool) const; | ||
| // MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<S1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these here? you can delete these lines, I think.
1a5aff7 to
c62d29c
Compare
…rmits transfer on device vectors via use of an internal MGTwoLevelTransfer class defined on the host.
c62d29c to
d2efed8
Compare
No description provided.