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

PCMS interpolation functionality #148

Open
wants to merge 50 commits into
base: develop
Choose a base branch
from
Open

Conversation

jacobmerson
Copy link
Collaborator

This pull request brings in @abhiyan123 initial changes for dealing with RBF field interpolations. I have gotten this into a state where it can be merged with develop and tests/compilation passes.

However, I have not done a formal review of this code and there are a some issues that need to be addressed before merging with develop.

@Fuad-HH I have requested you as a reviewer. Please take a look and see if you have any input, questions, etc.

@cwsmith relevant code for our discussion on surface fitting is here. Unfortunately, getting everything merged took some time and I have not had time to do the proper review I wanted before our meeting. Let me know if you prefer to push back that discussion until Thursday/Friday.

abhiyan123 and others added 30 commits September 21, 2024 21:45
searches and adapts radii until all targets get the minimum number of supports and debug queue (counter overflow)
@cwsmith
Copy link
Contributor

cwsmith commented Dec 18, 2024

@jacobmerson Thanks for the heads up. Thursday or Friday works for me.

// It stores the solution in rhs vector itself

SolveMatrix(result.square_matrix, result.transformed_rhs, team);

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed some style issues like this previously. I am talking about the blank lines between each line of code.

using namespace std;
using namespace Omega_h;

class queue
Copy link
Contributor

Choose a reason for hiding this comment

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

The class name could be Queue (PascalCase) to follow the PCMS style.

linear_interpolant.hpp
multidimarray.hpp
MLS_rbf_options.hpp
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to rename these header files to have consistent naming.

#cmake_minimum_required(VERSION 3.20)
#project(Interpolator)

find_package(KokkosKernels REQUIRED)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a minimum required version? This should be pinned to the same version as what we use for Kokkos .

target_link_libraries(pcms_interpolator PUBLIC pcms::core Kokkos::kokkoskernels)

target_include_directories(pcms_interpolator INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should get rid of this. We always want to access header files as pcms/interpolator/...

#include "points.hpp"
#include <type_traits>

#define PI_M 3.14159265358979323846
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should not define our own pi. We can use M_PI from cmath


#define PI_M 3.14159265358979323846

static constexpr int MAX_DIM = 3;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's reassess if we need this. If we do it should be a compile time setting. It should go into a settings or macro header file that gets configured.


// Initialize the scratch matrices and vectors

Kokkos::parallel_for(Kokkos::TeamThreadRange(team, basis_size),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could this be done with kokkos kernels fill instead? Intent would be more clear.

rbf_func);
});

// // sum phi
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove commented code.

#include "MLSInterpolation.hpp"
#include <Omega_h_fail.hpp>

// TODO add PCMS namespace to all interpolation code
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be done before merge.

@@ -0,0 +1,23 @@
#ifndef MLS_RBF_OPTIONS_HPP
#define MLS_RBF_OPTIONS_HPP
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Prefix with PCMS_INTERPOLATOR

using HostIntVecView = Kokkos::View<int*, Kokkos::HostSpace>;

KOKKOS_INLINE_FUNCTION
int calculateIndex(const IntVecView& dimensions, const int* indices)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why do we have these. Kokkos views should handle indexing for us.

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.

4 participants