diff --git a/examples/distributed-solver/distributed-solver.cpp b/examples/distributed-solver/distributed-solver.cpp index d9a1050f32d..809f47a7159 100644 --- a/examples/distributed-solver/distributed-solver.cpp +++ b/examples/distributed-solver/distributed-solver.cpp @@ -91,7 +91,8 @@ int main(int argc, char* argv[]) if (argc == 2 && (std::string(argv[1]) == "--help")) { if (rank == 0) { std::cerr << "Usage: " << argv[0] - << " [executor] [num_grid_points] " << std::endl; + << " [executor] [num_grid_points] [num_iterations] " + << std::endl; } std::exit(-1); } @@ -104,6 +105,8 @@ int main(int argc, char* argv[]) const auto executor_string = argc >= 2 ? argv[1] : "reference"; const auto grid_dim = static_cast(argc >= 3 ? std::atoi(argv[2]) : 100); + const auto num_iters = + static_cast(argc >= 4 ? std::atoi(argv[3]) : 1000); // Pick the requested executor. std::map()>> @@ -216,7 +219,8 @@ int main(int argc, char* argv[]) auto Ainv = solver::build() .with_criteria( - gko::stop::Iteration::build().with_max_iters(100u).on(exec), + gko::stop::Iteration::build().with_max_iters(num_iters).on( + exec), gko::stop::ResidualNorm::build() .with_baseline(gko::stop::mode::absolute) .with_reduction_factor(1e-4) diff --git a/examples/distributed-solver/doc/intro.dox b/examples/distributed-solver/doc/intro.dox index 4f5e6532b6f..da8f7cb13aa 100644 --- a/examples/distributed-solver/doc/intro.dox +++ b/examples/distributed-solver/doc/intro.dox @@ -2,7 +2,7 @@

Introduction

This distributed solver example should help you understand the basics of using Ginkgo in a distributed setting. The example will solve a simple 1D Laplace equation where the system can be distributed row-wise to multiple processes. -To run the solver with multiple processes, use `mpirun -n NUM_PROCS ./distributed-solver [executor] [num_grid_points]`. +To run the solver with multiple processes, use `mpirun -n NUM_PROCS ./distributed-solver [executor] [num_grid_points] [num_iterations]`. If you are using GPU devices, please make sure that you run this example with at most as many processes as you have GPU devices available. diff --git a/include/ginkgo/core/base/executor.hpp b/include/ginkgo/core/base/executor.hpp index 7623411d657..7f9689bda97 100644 --- a/include/ginkgo/core/base/executor.hpp +++ b/include/ginkgo/core/base/executor.hpp @@ -1526,10 +1526,7 @@ class CudaExecutor : public detail::ExecutorBase, this->get_exec_info().num_pu_per_cu = 0; this->CudaExecutor::populate_exec_info( machine_topology::get_instance()); - if (this->get_exec_info().closest_pu_ids.size()) { - machine_topology::get_instance()->bind_to_pus( - this->get_closest_pus()); - } + // it only gets attribute from device, so it should not be affected by // DeviceReset. this->set_gpu_property(); @@ -1732,10 +1729,7 @@ class HipExecutor : public detail::ExecutorBase, this->get_exec_info().num_computing_units = 0; this->get_exec_info().num_pu_per_cu = 0; this->HipExecutor::populate_exec_info(machine_topology::get_instance()); - if (this->get_exec_info().closest_pu_ids.size()) { - machine_topology::get_instance()->bind_to_pus( - this->get_closest_pus()); - } + // it only gets attribute from device, so it should not be affected by // DeviceReset. this->set_gpu_property();