Asynchronous Callback Queuing for MPI Thread Context
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing Message Passing Interface (MPI) approaches lack suitable support for callback-driven completion notifications and efficient handling of non-blocking request completions, leading to indeterminate execution contexts and potential performance regressions in multi-threaded applications.
Innovation Solution
The introduction of asynchronous callback enhancements, such as MSMPI_Isend_apc and MSMPI_Irecv_apc, which allow non-blocking send and receive operations with deterministic thread contexts, and interruptible wait enhancements, like MSMPI_Waitsome_interruptible, along with synchronization functions MSMPI_Queuelock_acquire and MSMPI_Queuelock_release, to manage thread safety and avoid deadlocks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional MPI callback mechanisms are used, then completion notifications can be provided, but the execution context becomes indeterminate and performance regresses
Solution Approach 1:
The patent introduces an intermediary callback queuing mechanism that sits between the completion detection and callback execution. When a non-blocking request completes, the callback is queued in the requesting thread's context rather than executing immediately in an indeterminate context. This intermediary queue ensures deterministic execution context while maintaining performance by avoiding unnecessary thread switches.
2Ease of operation
If blocking waits are used for message passing, then thread synchronization is simplified, but application responsiveness and throughput decrease
Solution Approach 1:
The patent applies preliminary action by having threads transition to an alertable state before performing blocking I/O operations. This allows the system to pre-configure the thread for receiving asynchronous procedure calls, enabling non-blocking message passing with automatic callback notification when operations complete, thus maintaining responsiveness while simplifying synchronization.
Solution Approach 2:
The patent introduces dynamic state transitions for threads, allowing them to switch between alertable and non-alertable states. This dynamic behavior enables threads to be responsive to asynchronous callbacks when needed while maintaining simple blocking semantics when appropriate, balancing ease of operation with application responsiveness.
3Productivity
If internal MPI threads are used for progress, then message passing operations can proceed, but system complexity and overhead increase
Solution Approach 1:
The patent implements self-service by enabling user-mode threads to make progress on their own message passing operations without requiring internal MPI threads. Threads can perform blocking I/O in user mode and automatically receive completion notifications via asynchronous procedure calls, eliminating the need for complex internal thread management while maintaining throughput.
4Adaptability or versatility
If asynchronous callbacks are implemented without thread context control, then non-blocking operations are supported, but execution determinism is lost
Solution Approach 1:
The patent applies local quality by associating each thread with its own callback queue and controlling callback execution locally within that thread's context. This ensures that callbacks execute deterministically in the requesting thread rather than in indeterminate system contexts, maintaining execution determinism while supporting non-blocking operations.
Data Source
AI summary
Through an asynchronous callback enhancement, a thread makes a non-blocking request (e.g., send, receive, I/O) to a message passing interface library, and a callback routine is associated with the request as an asynchronous callback to the thread. The callback is queued for execution in the requesting thread and so has a deterministic execution context. Callback queuing may occur in response to another thread detecting that the request is complete. Further control over callback execution is provided by state transitions which determine whether the thread is open to processing (e.g., executing) an asynchronous callback. Callback association is done by a broad or by narrow association routines. An application which has processes organized in ranks, each including a communication thread with associated callback(s), and multiple worker threads. Interruptible wait enhancements may also be present.


