Commit 8788ab7b authored by crtrott's avatar crtrott
Browse files

Tpetra: fixed shadow warnings in tests and examples

parent d0498f45
......@@ -238,7 +238,7 @@ namespace KokkosExamples {
copy, callers should not change the KokkosClassic::CrsGraph after
calling this method.
*/
void setGraphAndMatrix(const RCP<const EmptyCrsGraph<Node> > &graph,
void setGraphAndMatrix(const RCP<const EmptyCrsGraph<Node> > &graph_,
const RCP<const EmptyCrsMatrix<Scalar,Node> > &node) {};
//@}
......
......@@ -59,13 +59,13 @@ namespace {
typedef KokkosClassic::DefaultNode::DefaultNodeType Node;
int N = 100;
int NN = 100;
TEUCHOS_STATIC_SETUP()
{
Teuchos::CommandLineProcessor &clp = Teuchos::UnitTestRepository::getCLP();
clp.addOutputSetupOptions(true);
clp.setOption("test-size",&N,"Vector length for tests.");
clp.setOption("test-size",&NN,"Vector length for tests.");
}
//
......
......@@ -273,10 +273,10 @@ TEUCHOS_UNIT_TEST( KokkosRaw, AddSparseMatrices )
throw;
}
ArrayView<const OffsetType> ptr1_view (const_cast<const OffsetType*> (ptr1), numRows+1);
const OffsetType numEntries1 = ptr1_view[numRows];
ArrayView<const OrdinalType> ind1_view (const_cast<const OrdinalType*> (ind1), numEntries1);
ArrayView<const ScalarType> val1_view (const_cast<const ScalarType*> (val1), numEntries1);
ArrayView<const OffsetType> ptr1_view_ (const_cast<const OffsetType*> (ptr1), numRows+1);
const OffsetType numEntries1_ = ptr1_view_[numRows];
ArrayView<const OrdinalType> ind1_view_ (const_cast<const OrdinalType*> (ind1), numEntries1_);
ArrayView<const ScalarType> val1_view_ (const_cast<const ScalarType*> (val1), numEntries1_);
out << "Constructing test matrix 2" << endl;
OffsetType* ptr2 = NULL;
......@@ -297,10 +297,10 @@ TEUCHOS_UNIT_TEST( KokkosRaw, AddSparseMatrices )
throw;
}
ArrayView<const OffsetType> ptr2_view (const_cast<const OffsetType*> (ptr2), numRows+1);
const OffsetType numEntries2 = ptr2_view[numRows];
ArrayView<const OrdinalType> ind2_view (const_cast<const OrdinalType*> (ind2), numEntries2);
ArrayView<const ScalarType> val2_view (const_cast<const ScalarType*> (val2), numEntries2);
ArrayView<const OffsetType> ptr2_view_ (const_cast<const OffsetType*> (ptr2), numRows+1);
const OffsetType numEntries2_ = ptr2_view_[numRows];
ArrayView<const OrdinalType> ind2_view_ (const_cast<const OrdinalType*> (ind2), numEntries2_);
ArrayView<const ScalarType> val2_view_ (const_cast<const ScalarType*> (val2), numEntries2_);
out << "Test alpha = 1, beta = 1" << endl;
{
......@@ -333,8 +333,8 @@ TEUCHOS_UNIT_TEST( KokkosRaw, AddSparseMatrices )
maxDiff = testAddSparseMatrices<OffsetType, OrdinalType, ST> (
ptrOut_view, indOut_view, valOut_view,
alpha, ptr1_view, ind1_view, val1_view,
beta, ptr2_view, ind2_view, val2_view,
alpha, ptr1_view_, ind1_view_, val1_view_,
beta, ptr2_view_, ind2_view_, val2_view_,
numRows, numCols, out);
} catch (...) {
if (ptrOut != NULL) {
......@@ -402,7 +402,7 @@ TEUCHOS_UNIT_TEST( KokkosRaw, AddSparseMatrices )
maxDiff = testAddSparseMatrices<OffsetType, OrdinalType, ST> (
ptrOut_view, indOut_view, valOut_view,
alpha, ptr1_view, ind1_view, val1_view,
alpha, ptr1_view_, ind1_view, val1_view,
beta, ptr2_view, ind2_view, val2_view,
numRows, numCols, out);
} catch (...) {
......
......@@ -59,12 +59,12 @@ namespace {
typedef KokkosClassic::DefaultNode::DefaultNodeType Node;
int N;
int N_;
TEUCHOS_STATIC_SETUP()
{
Teuchos::CommandLineProcessor &clp = Teuchos::UnitTestRepository::getCLP();
clp.addOutputSetupOptions(true);
clp.setOption("test-size",&N,"Vector length for tests.");
clp.setOption("test-size",&N_,"Vector length for tests.");
}
//
......
......@@ -182,9 +182,9 @@ public:
KOKKOS_INLINE_FUNCTION
size_t node_global_index( size_t local ) const
{
const size_t node_grid[SpaceDim] =
const size_t node_grid_[SpaceDim] =
{ m_node_grid(local,0) , m_node_grid(local,1) , m_node_grid(local,2) };
return m_box_part.global_node_id( node_grid );
return m_box_part.global_node_id( node_grid_ );
}
KOKKOS_INLINE_FUNCTION
......@@ -301,30 +301,30 @@ public:
const size_t inode = i % ElemNode ;
size_t elem_grid[SpaceDim] ;
size_t node_grid[SpaceDim] ;
size_t node_grid_[SpaceDim] ;
m_box_part.uses_elem_coord( ielem , elem_grid );
enum { elem_node_scale = Order == BoxElemPart::ElemLinear ? 1 :
Order == BoxElemPart::ElemQuadratic ? 2 : 0 };
node_grid[0] = elem_node_scale * elem_grid[0] + m_elem_node_local[inode][0] ;
node_grid[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
node_grid[2] = elem_node_scale * elem_grid[2] + m_elem_node_local[inode][2] ;
node_grid_[0] = elem_node_scale * elem_grid[0] + m_elem_node_local[inode][0] ;
node_grid_[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
node_grid_[2] = elem_node_scale * elem_grid[2] + m_elem_node_local[inode][2] ;
m_elem_node(ielem,inode) = m_box_part.local_node_id( node_grid );
m_elem_node(ielem,inode) = m_box_part.local_node_id( node_grid_ );
}
if ( i < m_node_grid.dimension_0() ) {
size_t node_grid[SpaceDim] ;
m_box_part.local_node_coord( i , node_grid );
m_node_grid(i,0) = node_grid[0] ;
m_node_grid(i,1) = node_grid[1] ;
m_node_grid(i,2) = node_grid[2] ;
m_coord_map( node_grid[0] ,
node_grid[1] ,
node_grid[2] ,
size_t node_grid_[SpaceDim] ;
m_box_part.local_node_coord( i , node_grid_ );
m_node_grid(i,0) = node_grid_[0] ;
m_node_grid(i,1) = node_grid_[1] ;
m_node_grid(i,2) = node_grid_[2] ;
m_coord_map( node_grid_[0] ,
node_grid_[1] ,
node_grid_[2] ,
m_node_coord(i,0) ,
m_node_coord(i,1) ,
m_node_coord(i,2) );
......
......@@ -201,8 +201,8 @@ BoxElemPart::BoxElemPart(
local( m_global_rank , m_uses_elem_box , m_owns_node_box[0] , m_uses_node_box );
const size_t global_node_count = Kokkos::Example::box_count( m_global_node_box );
const size_t global_elem_count = Kokkos::Example::box_count( m_global_elem_box );
const size_t global_node_count_ = Kokkos::Example::box_count( m_global_node_box );
const size_t global_elem_count_ = Kokkos::Example::box_count( m_global_elem_box );
//----------------------------------------
......@@ -333,13 +333,13 @@ BoxElemPart::BoxElemPart(
}
}
if ( global_node_count != node_count ) {
std::cout << "Node count = " << global_node_count << " overlap error count = " << node_count << std::endl ;
if ( global_node_count_ != node_count ) {
std::cout << "Node count = " << global_node_count_ << " overlap error count = " << node_count << std::endl ;
m_ok = false ;
}
if ( DecomposeElem == decompose && global_elem_count != elem_count ) {
std::cout << "Elem count = " << global_elem_count << " overlap error count = " << elem_count << std::endl ;
if ( DecomposeElem == decompose && global_elem_count_ != elem_count ) {
std::cout << "Elem count = " << global_elem_count_ << " overlap error count = " << elem_count << std::endl ;
m_ok = false ;
}
......
......@@ -189,7 +189,7 @@ public:
typedef typename VectorType::value_type scalar_type ;
const int mpi_tag = 42 ;
const unsigned chunk = v.dimension_1();
const unsigned chunk_ = v.dimension_1();
// Subvector for receives
const std::pair<unsigned,unsigned> recv_range( count_owned , count_owned + count_receive );
......@@ -203,7 +203,7 @@ public:
for ( size_t i = 0 ; i < recv_msg.dimension_0() ; ++i ) {
const int proc = recv_msg(i,0);
const int count = recv_msg(i,1) * chunk ;
const int count = recv_msg(i,1) * chunk_ ;
MPI_Irecv( ptr , count * sizeof(scalar_type) , MPI_BYTE ,
proc , mpi_tag , comm , & recv_request[i] );
......@@ -223,7 +223,7 @@ public:
for ( size_t i = 0 ; i < send_msg.dimension_0() ; ++i ) {
const int proc = send_msg(i,0);
const int count = send_msg(i,1) * chunk ;
const int count = send_msg(i,1) * chunk_ ;
// MPI_Ssend blocks until
// (1) a receive is matched for the message and
......@@ -256,7 +256,7 @@ public:
// Verify message properly received:
const int expected_proc = recv_msg(recv_which,0);
const int expected_size = recv_msg(recv_which,1) * chunk * sizeof(scalar_type);
const int expected_size = recv_msg(recv_which,1) * chunk_ * sizeof(scalar_type);
if ( ( expected_proc != recv_proc ) ||
( expected_size != recv_size ) ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment