Skip to content

Commit

Permalink
fix typo, format, and mpi enabled function
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Apr 20, 2024
1 parent 26c6c01 commit b795413
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 34 deletions.
6 changes: 4 additions & 2 deletions core/multigrid/pgm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Pgm<ValueType, IndexType>::generate_local(
}


#if GINKGO_BUILD_MPI
template <typename IndexType>
void communicate(
std::shared_ptr<const experimental::distributed::MatrixBase<IndexType>>
Expand Down Expand Up @@ -265,6 +266,7 @@ void communicate(
}
return;
}
#endif


template <typename IndexType>
Expand Down Expand Up @@ -303,7 +305,7 @@ void Pgm<ValueType, IndexType>::generate()
auto non_local_matrix = matrix->get_non_local_matrix();
auto non_local_size = non_local_matrix->get_size()[1];
array<IndexType> non_local_agg(exec, non_local_size);
// prolong, restrict, only needs the local infomation
// prolong, restrict, only needs the local information
// get agg information (prolong_row_gather row idx)
communicate(matrix, agg_, non_local_agg);
// generate non_local_col_map
Expand All @@ -327,7 +329,7 @@ void Pgm<ValueType, IndexType>::generate()
// add additional in tail such that the offset easily handle it.
array<IndexType> renumber(exec->get_master(), non_local_size + 1);
renumber.get_data()[0] = 0;
// renumber (prefix_sum) with not eqaul <part_id, local_agg>
// renumber (prefix_sum) with not equal <part_id, local_agg>
for (int i = 1; i < non_local_size; i++) {
if (part_id.get_data()[i] != part_id.get_data()[i - 1] ||
non_local_agg.get_data()[i] !=
Expand Down
37 changes: 5 additions & 32 deletions test/mpi/multigrid/pgm.cpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
/*******************************<GINKGO LICENSE>******************************
Copyright (c) 2017-2023, the Ginkgo authors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/
// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
//
// SPDX-License-Identifier: BSD-3-Clause

#include <array>
#include <memory>
Expand Down Expand Up @@ -121,7 +93,8 @@ using More =
std::tuple<double, gko::int64, gko::int64>,
std::tuple<std::complex<double>, gko::int64, gko::int64>,
std::tuple<std::complex<double>, gko::int64, gko::int64>>;
TYPED_TEST_SUITE(Pgm, gko::test::ValueLocalGlobalIndexTypes, TupleTypenameNameGenerator);
TYPED_TEST_SUITE(Pgm, gko::test::ValueLocalGlobalIndexTypes,
TupleTypenameNameGenerator);


TYPED_TEST(Pgm, CanGenerateFromDistributedMatrix)
Expand Down

0 comments on commit b795413

Please sign in to comment.