Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
abkein committed Jan 17, 2025
1 parent 4658905 commit b053f41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/compute_cluster_size_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ void ComputeClusterSizeExt::compute_vector()
}
}

// add ghost atoms
for (int i = atom->nlocal; i < atom->nmax; ++i) {
if ((atom->mask[i] & groupbit) != 0) {
const auto clid = static_cast<int>(cluster_ids[i]);
if (cmap.count(clid) > 0) {
cluster_data& clstr = clusters[cmap[clid]];
// also possible segfault if number of ghost exceeds LMP_NUCC_CLUSTER_MAX_GHOST
clstr.ghost_initial()[clstr.nghost++] = i;
}
}
}
// // add ghost atoms
// for (int i = atom->nlocal; i < atom->nmax; ++i) {
// if ((atom->mask[i] & groupbit) != 0) {
// const auto clid = static_cast<int>(cluster_ids[i]);
// if (cmap.count(clid) > 0) {
// cluster_data& clstr = clusters[cmap[clid]];
// // also possible segfault if number of ghost exceeds LMP_NUCC_CLUSTER_MAX_GHOST
// clstr.ghost_initial()[clstr.nghost++] = i;
// }
// }
// }

for (const auto& [clid, clidx] : cmap) {
cluster_data& clstr = clusters[clidx];
Expand Down Expand Up @@ -271,7 +271,7 @@ void ComputeClusterSizeExt::compute_vector()
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/compute_vector_3:{}: particle index exceeds nlocal", style, comm->me); }
}
clstr.l_size = ns[2 * clidx + 1];
clstr.rearrange();
// clstr.rearrange();
for (int i = 0; i < clstr.l_size; ++i) {
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/compute_vector_4:{}: particle index exceeds nlocal", style, comm->me); }
peratom_size[clatoms[i]] = clstr.g_size;
Expand Down
6 changes: 3 additions & 3 deletions src/nucc_cluster_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace NUCC {
struct cluster_data {
explicit cluster_data(const int _clid) : clid(_clid) {}

void rearrange() noexcept { ::memcpy(_atoms + l_size, _ghost, nghost * sizeof(int)); }
// void rearrange() noexcept { ::memcpy(_atoms + l_size, _ghost, nghost * sizeof(int)); }

NUCC::cspan<const int> atoms_all() const { return std::span<const int>(_atoms, l_size + nghost); }

Expand All @@ -21,7 +21,7 @@ struct cluster_data {

NUCC::cspan<const int> atoms() const { return std::span<const int>(_atoms, l_size); }

NUCC::cspan<int, LMP_NUCC_CLUSTER_MAX_GHOST> ghost_initial() { return std::span<int, LMP_NUCC_CLUSTER_MAX_GHOST>(_ghost, nghost); }
// NUCC::cspan<int, LMP_NUCC_CLUSTER_MAX_GHOST> ghost_initial() { return std::span<int, LMP_NUCC_CLUSTER_MAX_GHOST>(_ghost, nghost); }

NUCC::cspan<const int> ghost() const { return std::span<const int>(_atoms + l_size, nghost); }

Expand All @@ -44,7 +44,7 @@ struct cluster_data {
private:
int _owners[LMP_NUCC_CLUSTER_MAX_OWNERS]; // procs owning some cluster's atoms
int _atoms[LMP_NUCC_CLUSTER_MAX_SIZE]; // local ids of atoms
int _ghost[LMP_NUCC_CLUSTER_MAX_GHOST]; // local ids of ghost atoms
// int _ghost[LMP_NUCC_CLUSTER_MAX_GHOST]; // local ids of ghost atoms
};

} // namespace NUCC
Expand Down

0 comments on commit b053f41

Please sign in to comment.