Skip to content

Conversation

@hppritcha
Copy link
Member

Add support for functions added as part of MPI 4.1 standard concerning buffer management for buffered send mode:

MPI_Comm_attach_buffer
MPI_Comm_detach_buffer
MPI_Session_attach_buffer
MPI_Session_detach_buffer
MPI_Comm_buffer_flush
MPI_Comm_buffer_iflush
MPI_Session_buffer_flush
MPI_Session_buffer_iflush

Full support for non-blocking flush is deferred to a subsequent PR to avoid reviewer overload.

Related to #12074

@hppritcha hppritcha marked this pull request as draft July 21, 2025 22:40
@hppritcha
Copy link
Member Author

the fortran binding infrastructure additions in PR #13279 need to be merged in to main prior to adding fortran bindings for these functions.

@hppritcha hppritcha force-pushed the comm_atach_buffer branch 2 times, most recently from b0af63d to de8d884 Compare September 9, 2025 20:02
@hppritcha hppritcha marked this pull request as ready for review September 9, 2025 21:53
@hppritcha
Copy link
Member Author

@edgargabriel we'll start with you for reviewing.

ompi_instance_t* instance;

/* pointer to buffer object used for buffered sends */
void *bsend_buffer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably double check that the size of the communicator structure is still below the threshold for being backwards compatible with the 5.0 series

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good point. I think what we really need to check sizeof ompi_predefined_communicator_t.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm actually looking at how that struct is defined, if sizeof(ompi_communicator_t) is greater than PREDEFINED_COMMUNICATOR_PAD I would hope one would get an error from the compiler when trying to use the communicator.h header in a source file. Any rate, we still get 512 bytes for size of ompi_predefined_communicator_t so I think we're good.

void *addr;
const uint64_t seg_size = (1024UL * 1024UL);

addr = malloc(seg_size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessarily for this PR, but it was discussed in the MPI Forum that one of the advantages that MPI_BUFFER_AUTOMATIC could have is that if the memkind info object on the communicator indicates that the user guarantees that only GPU buffers are being used, MPI_BUFFER_AUTOMATIC could allocate a buffer in device memory. Not sure whether that would be a completely different allocator that we would have to provide, or just a method to influence the implementation of the malloc operation in this routine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm putting a note near line 273 about this. I guess we could have a mechanism for specifying the allocator type by means of an info key/value associated with a communicator?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thank you!

@hppritcha
Copy link
Member Author

@edgargabriel check the comment I added in pml_base_bsend.c at starting at line 272.

@hppritcha
Copy link
Member Author

hmmm not sure what's going on with NVIDIA openshmem test.

Copy link
Member

@edgargabriel edgargabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Add support for functions added as part of MPI 4.1 standard concerning buffer
management for buffered send mode:

MPI_Comm_attach_buffer
MPI_Comm_detach_buffer
MPI_Session_attach_buffer
MPI_Session_detach_buffer
MPI_Comm_buffer_flush
MPI_Comm_buffer_iflush
MPI_Session_buffer_flush
MPI_Session_buffer_iflush

Note the MPI_BUFFER_AUTOMATIC handling in the use mpi_f08
methods requires some beefing up of the fortran binding
generation code.

Full support for non-blocking flush is deferred to a subsequent PR to
avoid reviewer overload.

Related to open-mpi#12074

Signed-off-by: Howard Pritchard <[email protected]>
@hppritcha hppritcha merged commit f1ab135 into open-mpi:main Sep 13, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants