Skip to content

Commit 560038e

Browse files
fix and improve test_cluster
1 parent 8c5349c commit 560038e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/functional_tests/clustering/test_cluster.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ bool test_cluster(int size, bool use_given_partition) {
162162
root_cluster_to_global(root_cluster, temporary_vector.data(), result_vector.data());
163163
is_error = is_error || !(random_vector == result_vector);
164164

165+
user_to_cluster(root_cluster, random_vector.data(), temporary_vector.data());
166+
cluster_to_user(root_cluster, temporary_vector.data(), result_vector.data());
167+
is_error = is_error || !(random_vector == result_vector);
168+
165169
// Test renumbering on partition
166170
if (root_cluster.is_permutation_local()) {
167171
int partition_index = 0;
@@ -174,6 +178,10 @@ bool test_cluster(int size, bool use_given_partition) {
174178
local_to_local_cluster(root_cluster, partition_index, random_vector.data(), temporary_vector.data());
175179
local_cluster_to_local(root_cluster, partition_index, temporary_vector.data(), result_vector.data());
176180
is_error = is_error || !(random_vector == result_vector);
181+
182+
user_to_cluster(*cluster_on_partition, random_vector.data(), temporary_vector.data());
183+
cluster_to_user(*cluster_on_partition, temporary_vector.data(), result_vector.data());
184+
is_error = is_error || !(random_vector == result_vector);
177185
}
178186
partition_index++;
179187
}
@@ -205,12 +213,14 @@ bool test_cluster(int size, bool use_given_partition) {
205213
}
206214
// Test renumbering with copied local cluster
207215
std::vector<int> local_random_vector(local_cluster.get_size(), 1), local_temporary_vector(local_cluster.get_size(), 1), local_result_vector(local_cluster.get_size(), 1);
208-
209-
MPI_Bcast(local_random_vector.data(), local_random_vector.size(), wrapper_mpi<int>::mpi_type(), 0, MPI_COMM_WORLD);
210-
216+
generate_random_vector(local_random_vector);
211217
local_to_local_cluster(local_cluster, rankWorld, local_random_vector.data(), local_temporary_vector.data());
212218
local_cluster_to_local(local_cluster, rankWorld, local_temporary_vector.data(), local_result_vector.data());
213219
is_error = is_error || !(local_random_vector == local_result_vector);
220+
221+
user_to_cluster(local_cluster, local_random_vector.data(), local_temporary_vector.data());
222+
cluster_to_user(local_cluster, local_temporary_vector.data(), local_result_vector.data());
223+
is_error = is_error || !(local_random_vector == local_result_vector);
214224
}
215225
}
216226

0 commit comments

Comments
 (0)