Skip to content

Commit

Permalink
Percept snapshot as of 4/01/2020
Browse files Browse the repository at this point in the history
  • Loading branch information
alanw0 committed Apr 1, 2020
1 parent f3c00a7 commit 3ea6bf2
Show file tree
Hide file tree
Showing 35 changed files with 47 additions and 3,368 deletions.
71 changes: 0 additions & 71 deletions packages/percept/src/adapt/NodeRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3185,75 +3185,4 @@
}
}
}

bool NodeRegistry::verifyAllKeysInKokkosNR(NodeRegistry_KOKKOS * nrk, SetOfEntities& nodesMappedTo, unsigned& noKeysNotInCommon)
{ //checks if all the key value pairs of the NodeRegistry being called on match key value pairs in the NodeRegistry_KOKKOS being passed as an argument
//madbrew: not sure if this is really a fair comparison since the node id's in NodeIdsOnSubDimEntityType can differ due to the fact that map loops differ between the registry's when adding id's
//this causes the registry's to have the same number of id's and even the same sets of id's but a different mapping between parent (i.e. edge/face) and children node(s)
nodesMappedTo.clear();
noKeysNotInCommon = 0;
if(!nrk)
{
std::cout << "NodeRegistry::compare_to_kokkos_NR : Invalid NodeRegistry_KOKKOS pointer, aborting NR diff\n";
return false;
}

bool kUOmap_contains_bUOmap = true;

SubDimCellToDataMap * map = &m_cell_2_data_map;
for (SubDimCellToDataMap::iterator iter = map->begin(); iter != map->end(); ++iter)
{
const SubDimCell_SDCEntityType& subDimEntity_BOOST = (*iter).first;
SubDimCellData& data_BOOST = (*iter).second;

SubDimCellData * data_KOKKOS = nrk->getFromMapPtr(subDimEntity_BOOST);

if(!data_KOKKOS){
kUOmap_contains_bUOmap = false;
if(kUOmap_contains_bUOmap)
std::cout << "NodeRegistry::compare_to_kokkos_NR : key with m_HashCode = " << subDimEntity_BOOST.getHash() << " NOT FOUND kokkos map\n";
noKeysNotInCommon++;
}
else
{
if ( !( std::get<0>(*data_KOKKOS) == std::get<0>(data_BOOST) ))
{
// kUOmap_contains_bUOmap = false;
std::cout << "NodeRegistry::compare_to_kokkos_NR : NodeIdsOnSubDimEntityType on tuple's do not match between NodeRegistry and KokkosNodeRegistry\n";
std::cout << " kOUmap NodeIdsOnSubDimEntityType = "<< std::get<0>(*data_KOKKOS) << " bOUmap NodeIdsOnSubDimEntityType = " << std::get<0>(data_BOOST) << "\n";
}
if(!( std::get<1>(*data_KOKKOS) == std::get<1>(data_BOOST) ))
{
// kUOmap_contains_bUOmap = false;
std::cout << "NodeRegistry::compare_to_kokkos_NR : EntityKey on tuple's do not match between NodeRegistry and KokkosNodeRegistry\n";
std::cout << " kOUmap EntityKey = "<< std::get<1>(*data_KOKKOS) << " bOUmap EntityKey = " << std::get<1>(data_BOOST) << "\n";
}
if(!( std::get<2>(*data_KOKKOS) == std::get<2>(data_BOOST) ) )
{
// kUOmap_contains_bUOmap = false;
std::cout << "NodeRegistry::compare_to_kokkos_NR : unsigned char on tuple's do not match between NodeRegistry and KokkosNodeRegistry\n";
std::cout << " kOUmap unsigned char = "<< std::get<2>(*data_KOKKOS) << " bOUmap unsigned char = " << std::get<2>(data_BOOST) << "\n";
}
if(!( std::get<3>(*data_KOKKOS) == std::get<3>(data_BOOST) ) )
{
// kUOmap_contains_bUOmap = false;
std::cout << "NodeRegistry::compare_to_kokkos_NR : unsigned char on tuple's do not match between NodeRegistry and KokkosNodeRegistry\n";
std::cout << " kOUmap unsigned char = "<< std::get<3>(*data_KOKKOS) << " bOUmap unsigned char = " << std::get<3>(data_BOOST) << "\n";
}
if(!( std::get<4>(*data_KOKKOS) == std::get<4>(data_BOOST) ) )
{
// kUOmap_contains_bUOmap = false;
std::cout << "NodeRegistry::compare_to_kokkos_NR : Double2 on tuple's do not match between NodeRegistry and KokkosNodeRegistry\n";
std::cout << " kOUmap Double2 = "<< std::get<4>(*data_KOKKOS) << " bOUmap Double2 = " << std::get<4>(data_BOOST) << "\n";
}
}
if(!kUOmap_contains_bUOmap)
std::cout << "NodeRegistry::compare_to_kokkos_NR : key with m_HashCode = " << subDimEntity_BOOST.getHash() << " doesn't match anything in kokkos map\n\n";
for(unsigned iEnt=0;iEnt<std::get<0>(data_BOOST).m_entity_id_vector.size();iEnt++){
unsigned ent_val = std::get<0>(data_BOOST).m_entity_id_vector[iEnt];
nodesMappedTo.insert(stk::mesh::Entity(ent_val));
}
}
return noKeysNotInCommon==0;
}
}//percept
5 changes: 0 additions & 5 deletions packages/percept/src/adapt/NodeRegistry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@
#define DEBUG_NR_DEEP 0

#include <adapt/NodeRegistryType.hpp>
#include <adapt/NodeRegistry_KOKKOS.hpp>

// use old PerceptMesh/BulkData create entities if set to 1 - if 0, use PerceptMesh ID server which is much faster (doesn't use DistributedIndex)
#define USE_CREATE_ENTITIES 0

namespace percept {

class NodeRegistry_KOKKOS;

using std::vector;
using std::map;
using std::set;
Expand Down Expand Up @@ -350,8 +347,6 @@
void mod_begin();
void mod_end(const std::string& msg="");

bool verifyAllKeysInKokkosNR(NodeRegistry_KOKKOS * nrk, SetOfEntities& nodesMappedTo, unsigned& noKeysNotInCommon);

private:
percept::PerceptMesh& m_eMesh;
Refiner *m_refiner;
Expand Down
Loading

0 comments on commit 3ea6bf2

Please sign in to comment.