Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a KokkosCommInitialize #82

Open
cedricchevalier19 opened this issue Jun 12, 2024 · 2 comments
Open

Provide a KokkosCommInitialize #82

cedricchevalier19 opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@cedricchevalier19
Copy link
Member

cedricchevalier19 commented Jun 12, 2024

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);

Originally posted by @aprokop in #53 (comment)

@dssgabriel
Copy link
Collaborator

Tracking issue for #68?

Note that with the MPI Sessions model, we do not require users to call MPI_Init before our own initialization.

@cedricchevalier19
Copy link
Member Author

#68 is more than that: here, it is a simple function that does not necessarily use sessions.

@dssgabriel dssgabriel self-assigned this Jun 13, 2024
@dssgabriel dssgabriel added the enhancement New feature or request label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants