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

new interpolation framework #699

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

mkstoyanov
Copy link
Collaborator

First draft the interpolation framework, the PR is already large, it's a good idea to merge it before we start piling in features.

@mkstoyanov mkstoyanov force-pushed the interpolation_scheme branch from 01e2d52 to abb43ce Compare July 5, 2024 11:07

namespace asgard
{
#ifdef KRON_MODE_GLOBAL_BLOCK
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you consider conditionally including this file and the associated asgard_interpolation.cpp and asgard_interpolation_tests.cpp based on the CMake flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doing several answers in one:

This PR has the code that can go through the steps of the interpolation procedure but lacks the link to the PDE and the rest of the code. I want to keep the PRs more manageable instead of pushing that is many thousands of lines (this is >2K already).

In the final design, those files will not be conditional but will be included with every combination of options. To get this right, I will need to reconcile interpolation with local kronmult and that's a mid size rework in it's own. The if-defs will go away, just like any CMake code that I use as an alternative.

The second point is that the connectivity and workspace will be shared with the kronmult matrix, so the owner will be the kron_operatos class that will then hold the interpolation and matrix (for the linear separable case). Right now the kron_operatos is holding the workspace and the matrix takes a non-owning alias. The matrix owns the connectivity but I will pull that one out too.

Connectivity, workspace and the interpolation matrices can be reused even when the refinement and grid change Connectivity and matrices have to change if we add an extra level, otherwise they can stay the same and save on rebuilding/reallocating those. That would be the job of kron_operatos class, which is just more of exactly what it does now.


namespace asgard
{
#ifdef KRON_MODE_GLOBAL_BLOCK
Copy link
Collaborator

Choose a reason for hiding this comment

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

same question as with asgard_interpolation, is this better done within CMake?

{
if constexpr (n == -1)
#pragma omp atomic
number_of_blocks_ += 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can one use number_of_blocks_ ++ with omp atomic?

wavelet_interp1d() : conn(nullptr)
{}
//! cache interpolation points and transformation matrices
wavelet_interp1d(connect_1d const *conn_in) : conn(conn_in)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should wavelet_interp1d own the conn object?

Comment on lines +28 to +29
interpolation(int num_dimenisons, connect_1d const *conn_in,
kronmult::block_global_workspace<precision> *workspace)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ownership of workspace?

@mkstoyanov mkstoyanov merged commit a4dabb5 into project-asgard:develop Jul 5, 2024
11 checks passed
@mkstoyanov mkstoyanov deleted the interpolation_scheme branch July 5, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants