Skip to content

Commit

Permalink
Merge branch 'kharma-expt' of github:afd-illinois/parthenon into khar…
Browse files Browse the repository at this point in the history
…ma-expt
  • Loading branch information
bprather committed Jul 25, 2024
2 parents e7035e3 + 19c4f99 commit e957897
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
11 changes: 11 additions & 0 deletions src/interface/data_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ std::string DataCollection<T>::GetKey(const std::string &stage_label,
return key;
}

template <typename T>
std::string DataCollection<T>::GetKey(const std::string &stage_label,
const std::shared_ptr<BlockListPartition> &in) {
auto key = stage_label;
if (in->grid.type == GridType::two_level_composite)
key = key + "_gmg-" + std::to_string(in->grid.logical_level);
for (const auto &pmb : in->block_list)
key += "_" + std::to_string(pmb->gid);
return key;
}

template <>
std::shared_ptr<MeshData<Real>> &
DataCollection<MeshData<Real>>::GetOrAdd(const std::string &mbd_label,
Expand Down
1 change: 1 addition & 0 deletions src/kokkos_abstraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ par_reduce_inner(team_mbr_t team_member, const int il, const int iu, const Funct
function(i, lreduce);
},
reduction);
}

// reused from kokoks/core/perf_test/PerfTest_ExecSpacePartitioning.cpp
// commit a0d011fb30022362c61b3bb000ae3de6906cb6a7
Expand Down
17 changes: 2 additions & 15 deletions src/parthenon_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ void ParthenonManager::ParthenonInitPackagesAndMesh(
} else if (arg.res_flag == 0) {
pmesh =
std::make_unique<Mesh>(pinput.get(), app_input.get(), packages, arg.mesh_flag);
pmesh->analysis_flag = false;
} else {
// Open restart file
// Read Mesh from restart file and create meshblocks
Expand All @@ -215,12 +214,6 @@ void ParthenonManager::ParthenonInitPackagesAndMesh(
// close hdf5 file to prevent HDF5 hangs and corrupted files
// if code dies after restart
restartReader = nullptr;

if (arg.analysis_flag == 1) {
pmesh->analysis_flag = true;
} else {
pmesh->analysis_flag = false;
}
}

// add root_level to all max_level
Expand Down Expand Up @@ -296,7 +289,7 @@ void ParthenonManager::RestartPackages(Mesh &rm, RestartReader &resfile) {
}

// Allocate space based on largest vector
int max_blocksize = 0;
int max_vlen = 1;
int num_sparse = 0;
size_t nCells = 1;
for (const auto &v_info : all_vars_info) {
Expand Down Expand Up @@ -361,13 +354,7 @@ void ParthenonManager::RestartPackages(Mesh &rm, RestartReader &resfile) {
pmb->meshblock_data.Get()->GetVarPtr(label)->dealloc_count = dealloc_count;
} else {
// nothing to read for this block, advance reading index
const int te_length = (v_info->metadata().Where() == MetadataFlag(Metadata::Face) ||
v_info->metadata().Where() == MetadataFlag(Metadata::Edge)) ? rm.ndim : 1;
const int te_offset = (v_info->metadata().Where() == MetadataFlag(Metadata::Face) ||
v_info->metadata().Where() == MetadataFlag(Metadata::Edge) ||
v_info->metadata().Where() == MetadataFlag(Metadata::Node)) ? 1 : 0;
const int nPoints = (bsize[0] + te_offset) * (bsize[1] + te_offset) * (bsize[2] + te_offset);
index += nPoints * vlen * te_length;
index += nCells * vlen;
continue;
}
}
Expand Down

0 comments on commit e957897

Please sign in to comment.