kokkos / kokkos-comm

Experimental MPI Wrapper for Kokkos
https://kokkos.org/kokkos-comm/
Other
14 stars 9 forks source link

Provide `KokkosComm::initialize`/`finalize` #88

Closed dssgabriel closed 3 months ago

dssgabriel commented 3 months ago

This PR implements a very basic initialization and finalization for KokkosComm (closes #82).

Users should now only call KokkosComm::initialize and KokkosComm::finalize, no more manual MPI and Kokkos initialization. Using these functions ensures MPI is correctly initialized/finalized (with multiple thread support) before Kokkos is initialized/finalized.

To-do before merging:

dssgabriel commented 3 months ago

I think it would be nice to have KokkosComm::ScopeGuard that is similar to Kokkos::ScopeGuard

Should this and other utilities (e.g. is_initialized) be added here or in another PR?

aprokop commented 3 months ago

Should this and other utilities (e.g. is_initialized) be added here or in another PR?

Easier in a different PR to keep the PR size small.

dssgabriel commented 3 months ago

Last thing we need to think about is: do we abort if we failed to get the desired thread support level?

cedricchevalier19 commented 3 months ago

It was decided not to continue and to provide stubs for users to initialize correctly.