Definition at line 12 of file parallel_sort_test.C.
◆ CPPUNIT_TEST()
ParallelSortTest::CPPUNIT_TEST |
( |
testSort |
| ) |
|
◆ CPPUNIT_TEST_SUITE()
◆ CPPUNIT_TEST_SUITE_END()
ParallelSortTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ setUp()
void ParallelSortTest::setUp |
( |
| ) |
|
|
inline |
◆ tearDown()
void ParallelSortTest::tearDown |
( |
| ) |
|
|
inline |
◆ testSort()
void ParallelSortTest::testSort |
( |
| ) |
|
|
inline |
Definition at line 27 of file parallel_sort_test.C.
31 const int n_vals = size - rank;
32 std::vector<int> vals(n_vals);
36 int val = rank+1, stride = size;
37 for (
int i=0; i != n_vals; ++i)
39 vals[n_vals-i-1] = val;
48 const std::vector<int> & my_bin = sorter.bin();
55 int total_size = cast_int<int>(my_bin.size());
58 CPPUNIT_ASSERT_EQUAL(total_size, size*(size+1)/2);
63 for (
int i=1; i <= total_size; ++i)
65 int count_i = std::count(my_bin.begin(), my_bin.end(), i);
66 CPPUNIT_ASSERT(count_i < 2);
70 CPPUNIT_ASSERT(rank_with_i <= rank);
76 CPPUNIT_ASSERT_EQUAL(count_i, 1);
References libMesh::Parallel::Sort< KeyType, IdxType >::bin(), libMesh::Parallel::Utils::is_sorted(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), and TestCommWorld.
The documentation for this class was generated from the following file: