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

Fix BovWriter #758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions grid/src/Cabana_Grid_BovWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ void writeTimeStep( ExecutionSpace, const std::string& prefix,
local_space_max.back() = owned_extents.back();
IndexSpace<num_space_dim + 1> local_space( local_space_min,
local_space_max );
auto owned_subview = createSubview( array.view(), local_space );

auto array_host = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, array.view());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try replacing this with a fence instead?

auto owned_subview = createSubview( array_host, local_space );

std::array<long, num_space_dim + 1> reorder_space_size;
for ( std::size_t d = 0; d < num_space_dim; ++d )
Expand All @@ -276,9 +278,11 @@ void writeTimeStep( ExecutionSpace, const std::string& prefix,
}
reorder_space_size.back() = owned_extents.back();
IndexSpace<num_space_dim + 1> reorder_space( reorder_space_size );
auto owned_view = createView<value_type, Kokkos::LayoutRight, memory_space>(

auto owned_view = createView<value_type, Kokkos::LayoutRight, Kokkos::HostSpace>(
array.label(), reorder_space );
reorderView( owned_view, owned_subview, reorder_space, ExecutionSpace() );

reorderView( owned_view, owned_subview, reorder_space, Kokkos::DefaultHostExecutionSpace{} );
Copy link
Member

@streeve streeve Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything that would stop us from reordering on device, then mirroring after this kernel - what am I missing?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abisner I have segment fault error when encounter node_halo->gather and Grid_Halo CUDA test fails as well. Do you have same issue on summit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwitaechong that may be unrelated - this should only affect the grid output tests


// Compose a data file name prefix.
std::stringstream file_name;
Expand Down
Loading