Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
abkein committed Jan 16, 2025
1 parent 24df2a6 commit 8a4ae4d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/compute_cluster_size_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ void ComputeClusterSizeExt::compute_vector()
clusters[clidx].atoms<false>()[ns[2 * clidx + 1]++] = i;
}
}
for (const auto& [clid, clidx] : cmap) {
cluster_data& clstr = clusters[clidx];
const auto clatoms = clstr.atoms();
for (int i = 0; i < clstr.l_size; ++i) {
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/compute_vector_1:{}: particle index exceeds nlocal", style, comm->me); }
}
}

// add ghost atoms
for (int i = atom->nlocal; i < atom->nmax; ++i) {
Expand All @@ -204,6 +211,14 @@ void ComputeClusterSizeExt::compute_vector()
}
}

for (const auto& [clid, clidx] : cmap) {
cluster_data& clstr = clusters[clidx];
const auto clatoms = clstr.atoms();
for (int i = 0; i < clstr.l_size; ++i) {
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/compute_vector_2:{}: particle index exceeds nlocal", style, comm->me); }
}
}

// communicate about number of unique clusters
const int ncluster_local = 2 * cmap.size();
::MPI_Allgather(&ncluster_local, 1, MPI_INT, counts_global.data(), 1, MPI_INT, world);
Expand Down Expand Up @@ -248,13 +263,17 @@ void ComputeClusterSizeExt::compute_vector()
// adjust local data and fill local size distribution
nonexclusive = 0;
nmono = 0;

for (const auto& [clid, clidx] : cmap) {
cluster_data& clstr = clusters[clidx];
const auto clatoms = clstr.atoms();
for (int i = 0; i < clstr.l_size; ++i) {
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();
const auto clatoms = clstr.atoms();
for (int i = 0; i < clstr.l_size; ++i) {
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/compute_vector:{}: particle index exceeds nlocal", style, comm->me); }
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;
}
if ((clstr.g_size < size_cutoff) && (clstr.g_size > 1)) { cbs_all[clstr.g_size].push_back(clidx); }
Expand Down

0 comments on commit 8a4ae4d

Please sign in to comment.