It must enforce a correct calling order for MPI_Init and Kokkos::initialize.
It should also handle special Kokkos arguments:
Another pretty annoying thing that we have to do is to avoid passing --help to non-zero ranks, as otherwise Kokkos would print help on all ranks. We do it like this:
// Strip "--help" and "--kokkos-help" from the flags passed to Kokkos if we
// are not on MPI rank 0 to prevent Kokkos from printing the help message
// multiply.
if (comm_rank != 0)
{
auto *help_it = std::find_if(argv, argv + argc, [](std::string const &x) {
return x == "--help" || x == "--kokkos-help";
});
if (help_it != argv + argc)
{
std::swap(*help_it, *(argv + argc - 1));
--argc;
}
}
Kokkos::initialize(argc, argv);
It must enforce a correct calling order for
MPI_Init
andKokkos::initialize
.It should also handle special Kokkos arguments:
Originally posted by @aprokop in https://github.com/kokkos/kokkos-comm/issues/53#issuecomment-2105364199