Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikvn committed Feb 9, 2023
1 parent d9baac1 commit aa07c7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/distributed-solver/distributed-solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

int main(int argc, char* argv[])
{
// @sect3{MPI environment}
// Start an scoped MPI environment, which gets cleaned up on the exit of the
// function.
const gko::experimental::mpi::environment env(argc, argv);
// @sect3{Type Definitiions}
// Define the needed types. In a parallel program we need to differentiate
Expand Down Expand Up @@ -77,6 +80,7 @@ int main(int argc, char* argv[])
ValueType, LocalIndexType, GlobalIndexType>;
using bj = gko::preconditioner::Jacobi<ValueType, LocalIndexType>;

// Create an MPI communicator get the rank of the calling process.
const auto comm = gko::experimental::mpi::communicator(MPI_COMM_WORLD);
const auto rank = comm.rank();

Expand Down Expand Up @@ -135,7 +139,7 @@ int main(int argc, char* argv[])
device_id = gko::experimental::mpi::map_rank_to_device_id(
comm, gko::DpcppExecutor::get_num_devices("cpu"));
} else {
GKO_NOT_IMPLEMENTED;
throw std::runtime_error("No suitable DPC++ devices");
}
return gko::DpcppExecutor::create(
device_id, gko::ReferenceExecutor::create());
Expand Down

0 comments on commit aa07c7f

Please sign in to comment.