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

Stratimikos, Piro, Panzer: Silence warnings #13365

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ buildGhostedNodes(const Tpetra::Import<int,panzer::GlobalOrdinal,panzer::TpetraN
using Teuchos::rcp;

typedef Tpetra::MultiVector<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> mvec_type;
typedef typename mvec_type::dual_view_type dual_view_type;

size_t owned_cell_cnt = importer.getSourceMap()->getLocalNumElements();
size_t ghstd_cell_cnt = importer.getTargetMap()->getLocalNumElements();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ void Quad8ToQuad4MeshFactory::buildMetaData(stk::ParallelMachine /* parallelMach

if(createEdgeBlocks_) {
const CellTopologyData * edge_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(1,0);
std::vector<std::string> element_block_names;
quad8Mesh_->getElementBlockNames(element_block_names);
for (const auto& block_name : element_block_names)
std::vector<std::string> element_block_names2;
quad8Mesh_->getElementBlockNames(element_block_names2);
for (const auto& block_name : element_block_names2)
mesh.addEdgeBlock(block_name,edgeBlockName_,edge_ctd);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ void QuadraticToLinearMeshFactory::buildMetaData(stk::ParallelMachine /* paralle

if(createEdgeBlocks_) {
const CellTopologyData * edge_ctd = shards::CellTopology(ctd).getBaseCellTopologyData(1,0);
std::vector<std::string> element_block_names;
quadMesh_->getElementBlockNames(element_block_names);
for (const auto& block_name : element_block_names)
std::vector<std::string> element_block_names2;
quadMesh_->getElementBlockNames(element_block_names2);
for (const auto& block_name : element_block_names2)
mesh.addEdgeBlock(block_name,edgeBlockName_,edge_ctd);
}

Expand Down
14 changes: 7 additions & 7 deletions packages/panzer/disc-fe/src/Panzer_IntegrationValues2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ getCubaturePointsRef(const bool cache,
const int order = int_rule->getOrder();

// Scratch space for storing the points for each side of the cell
auto side_cub_points = af.template buildStaticArray<Scalar,IP,Dim>("side_cub_points",num_points_on_face,cell_dim);
auto side_cub_points2 = af.template buildStaticArray<Scalar,IP,Dim>("side_cub_points",num_points_on_face,cell_dim);

Intrepid2::DefaultCubatureFactory cubature_factory;

Expand All @@ -1733,9 +1733,9 @@ getCubaturePointsRef(const bool cache,
// Get the cubature for the side
if(cell_dim==1){
// In 1D the surface point is either on the left side of the cell, or the right side
auto side_cub_points_host = Kokkos::create_mirror_view(side_cub_points.get_view());
auto side_cub_points_host = Kokkos::create_mirror_view(side_cub_points2.get_view());
side_cub_points_host(0,0) = (side==0)? -1. : 1.;
Kokkos::deep_copy(side_cub_points.get_view(),side_cub_points_host);
Kokkos::deep_copy(side_cub_points2.get_view(),side_cub_points_host);
} else {

// Get the face topology from the cell topology
Expand All @@ -1750,15 +1750,15 @@ getCubaturePointsRef(const bool cache,
ic->getCubature(tmp_side_cub_points, tmp_side_cub_weights);

// Convert from reference face points to reference cell points
cell_tools.mapToReferenceSubcell(side_cub_points.get_view(), tmp_side_cub_points, subcell_dim, side, cell_topology);
cell_tools.mapToReferenceSubcell(side_cub_points2.get_view(), tmp_side_cub_points, subcell_dim, side, cell_topology);
}

PHX::Device::execution_space().fence();

// Copy from the side allocation to the surface allocation
Kokkos::MDRangePolicy<PHX::Device::execution_space,Kokkos::Rank<3>> policy({0,0,0},{num_evaluate_cells_,num_points_on_face, num_space_dim});
Kokkos::parallel_for("copy values",policy,KOKKOS_LAMBDA (const int cell,const int point, const int dim) {
aux(cell,point_offset + point,dim) = side_cub_points(point,dim);
aux(cell,point_offset + point,dim) = side_cub_points2(point,dim);
});
PHX::Device::execution_space().fence();
}
Expand All @@ -1770,11 +1770,11 @@ getCubaturePointsRef(const bool cache,
"ERROR: 0-D quadrature rule infrastructure does not exist!!! Will not be able to do "
<< "non-natural integration rules.");

auto cub_points = getUniformCubaturePointsRef(false,force,false);
auto cub_points2 = getUniformCubaturePointsRef(false,force,false);

Kokkos::MDRangePolicy<PHX::Device,Kokkos::Rank<3>> policy({0,0,0},{num_evaluate_cells_,num_ip,num_space_dim});
Kokkos::parallel_for(policy, KOKKOS_LAMBDA(const int & cell, const int & ip, const int & dim){
aux(cell,ip,dim) = cub_points(ip,dim);
aux(cell,ip,dim) = cub_points2(ip,dim);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ buildGhostedCellOneRing(const Teuchos::RCP<const Teuchos::Comm<int> > & comm,
// Copy the row for a global node index into a local vector
node_to_cell->getGlobalRowCopy(global_node_index,indices,values,numEntries);

for(size_t i=0; i<indices.extent(0); ++i) {
auto index = indices(i);
for(size_t j=0; j<indices.extent(0); ++j) {
auto index = indices(j);
// if this is a new index (not owned, not previously found ghstd index
// add it to the list of ghstd cells
if(unique_cells.find(index)==unique_cells.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ initializeData()
ghostedVector_->putScalar(0.0);
PHX::ExecSpace().fence();

typedef typename VectorType::dual_view_type::t_dev::memory_space DMS;
auto values = ghostedVector_->getLocalViewHost(Tpetra::Access::OverwriteAll);

// initialize some ghosted values to the user specified values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ namespace panzer
*/
PHX::MDField<double, panzer::Cell, panzer::BASIS, panzer::IP> basis_;

/**
* \brief If set to true, device shared memory will be used.
*/
bool use_shared_memory;

/// Temporary for non-shared calculations
PHX::View<ScalarT*> tmp_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ namespace panzer
:
evalStyle_(evalStyle),
multiplier_(multiplier),
basisName_(basis.name()),
use_shared_memory(false)
basisName_(basis.name())
{
using PHX::View;
using panzer::BASIS;
Expand Down Expand Up @@ -368,7 +367,7 @@ namespace panzer
// Grab the basis information.
basis_ = this->wda(workset).bases[basisIndex_]->weighted_div_basis;

use_shared_memory = panzer::HP::inst().useSharedMemory<ScalarT>();
bool use_shared_memory = panzer::HP::inst().useSharedMemory<ScalarT>();

if (use_shared_memory) {
int bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ Teko::LinearOp FullDarcyPreconditionerFactory::buildPreconditionerOperator(Teko:
Teko::LinearOp diffK;

if (useTpetra) {
typedef panzer::TpetraNodeType Node;
typedef int LocalOrdinal;
typedef panzer::GlobalOrdinal GlobalOrdinal;

RCP<const Thyra::TpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node> > tOp = rcp_dynamic_cast<const Thyra::TpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node> >(K2,true);
RCP<Thyra::TpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node> > tOp2 = Teuchos::rcp_const_cast<Thyra::TpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node>>(tOp);
RCP<Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > crsOp = rcp_dynamic_cast<Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >(tOp2->getTpetraOperator(),true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ class ThyraProductME_Constraint_SimOpt : public ROL::Constraint_SimOpt<Real> {
}
}
else {
Thyra::ModelEvaluatorBase::Derivative<Real> dfdp_dv = outArgs.get_DfDp(0);
auto dfdp_op = dfdp_dv.getLinearOp();
auto dfdp = dfdp_dv.getMultiVector();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ LinearSolverBuilder<Scalar>::LinearSolverBuilder(


template<class Scalar>
LinearSolverBuilder<Scalar>::~LinearSolverBuilder<Scalar>()
LinearSolverBuilder<Scalar>::~LinearSolverBuilder()
Copy link
Member

Choose a reason for hiding this comment

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

👍

{
#ifdef TEUCHOS_DEBUG
// Validate that we read the parameters correctly!
Expand Down
Loading