Skip to content

Conversation

@peterrum
Copy link
Collaborator

@peterrum peterrum commented Feb 2, 2024

As suggested in #1436 (comment), this PR adds a deal.II example using Kokkos. The matrix-free infrastructure in deal.II that uses Kokkos is not as mature so that I only run BP1 (without overintegration) and BP5.

std::cout << "--n_refinements number of refinements (0-)" << std::endl;
std::cout << "--fe_degree polynomial degree (1-)" << std::endl;
std::cout << "--print_timings name of benchmark (0, 1)" << std::endl;
std::cout << "--resource name of resource (e.g., /cpu/self/avx/blocked)" << std::endl;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jeremylt I am wondering whether it is possible to extract the resource information from Kokkos and pass it to libCEED or what the best approach is to keep them in sync?

Copy link
Member

Choose a reason for hiding this comment

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

All libCEED backends can accept CPU pointers for vectors, so what we do in PETSc is

  1. Create the user requested libCEED backend

  2. Request the preferred memory space (CEED_MEM_HOST or CEED_MEM_DEVICE) of this libCEED backend

  3. Set PETSc to use the requested memory space

I think a simpler version of this could be to request the libCEED backend's preferred memory space and hand off pointers in that memory space.

// Set up libCEED

Comment on lines +54 to +55
// TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
// TESTARGS(name="BP4") --resource {ceed_resource} --bp BP4 --fe_degree 3 --print_timings 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
// TESTARGS(name="BP4") --resource {ceed_resource} --bp BP4 --fe_degree 3 --print_timings 0
//TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
//TESTARGS(name="BP4") --resource {ceed_resource} --bp BP4 --fe_degree 3 --print_timings 0

CI breaks if these comments aren't formatted like this

Comment on lines +53 to +54
// TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
// TESTARGS(name="BP4") --resource {ceed_resource} --bp BP5 --fe_degree 3 --print_timings 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
// TESTARGS(name="BP4") --resource {ceed_resource} --bp BP5 --fe_degree 3 --print_timings 0
//TESTARGS(name="BP1") --resource {ceed_resource} --bp BP1 --fe_degree 2 --print_timings 0
//TESTARGS(name="BP4") --resource {ceed_resource} --bp BP5 --fe_degree 3 --print_timings 0

@peterrum
Copy link
Collaborator Author

I will update this PR. By now, we also support vectorial elements and overintegration.

@jeremylt
Copy link
Member

I would like to help with this as I have time. Which branch in deal.II does this use?

@peterrum
Copy link
Collaborator Author

@jeremylt I have updated the code so that it compiles with dealii/master. It also works now for all BPs (new: vectorial elements, overintegration, diagonal preconditioner). I have not rebased on libCEED/main. If you agree with the direction, could I ask you to take over?

@peterrum
Copy link
Collaborator Author

To understand the difference of the two programs, vimdiff bps_01.cc bps_02.cc helps.

@jeremylt
Copy link
Member

Yea, I can work on this some now, thanks for the update!

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.

3 participants