Skip to content

Caller Pass MPI_Comm - #48

Draft
AlexBuccheri wants to merge 1 commit into
fortuno-repos:mainfrom
AlexBuccheri:mpi_comm_injection
Draft

Caller Pass MPI_Comm#48
AlexBuccheri wants to merge 1 commit into
fortuno-repos:mainfrom
AlexBuccheri:mpi_comm_injection

Conversation

@AlexBuccheri

Copy link
Copy Markdown

Allow a caller to initialise the MPI environment, and pass a communicator to Fortuno

@aradi:

  1. How would you like to control whether Fortuno finalises? Have an internal attribute in type :: mpi_env that logs where the comm came from?

  2. I assume I should also add a test?

@hmenke

hmenke commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Should final_mpi_env call MPI_Finalize even if the communicator was user-provided?

@aradi

aradi commented Nov 25, 2025

Copy link
Copy Markdown
Member

I think, this approach is more involved, than I thought originally. If the user sets up the MPI framework before calling Fortuno, Fortuno should not finalize it, but return. This includes some complications:

  • User should call run_mpi_cmd_app instead of execute_mpi_cmd_app, as latter exits before returning (and ensures, that the right exit code is passed to the OS).
  • Apart of tearing down the MPI, the caller also has to make sure, that the exit code returned by run_mpi_cmd_app is passed to the OS, otherwise Fortuno might exit with the wrong exit code, fooling the test system.

Therefore, I merged #50, which gives an easy way of threading level selection. I think, it would be still worth to add the feature of fully user controlled MPI-framework creation/destruction, but via then via the run_mpi_cmd_app function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants