- Introduction
- External Control Module Initialization
- External Control Callback Registration
- Generating External Control Events
Most profiling tools are comprised of two layers, usually implemented as two separate processes:
- The Profiler back-end: a module (usually a dyanamically-linked library) loaded into the virtual machine process executing the profiled application. The back-end is responsible for monitoring the application and collecting profiling data. All MPI clients can be considered as back-end modules.
- The Profiler front-end: a standalone application which implements the tool's user interface and enables the user to interact with the profiler back-end.
The Martini External Control Interface is designed to allow Profiler front-ends to interact with their MPI back-end modules by sending "control" messages that will be dispatched to the MPI back-end modules as MPI events.
To interact with MPI clients, a tool implements an "External Control" module which is loaded into the virtual machine process together with the MPI client it needs to control. This External Control module serves as a bridge between the tool's front-end process and the MPI client back-end and enables the front-end to send certain MPI events to the MPI client.
The following figure outlines the relationship between the tool's front-end, the External Control module, and MPI Client and the profiled application.
Martini External Control
It is important to note that the Martini External Control Interface does not provide nor define any services for the tool's front-end to interact with its External Control module. It only enables the External Control module to deliver messages to the MPI client as MPI events.
A Martini External Control module is expected to implement and export the following functions defined in the MartiniExternalControl.h header file:
- EC_Init : invoked by the Martini runtime during Virtual Machine initialization to initialize the External Control module
- RegisterMartiniCallback : invoked by the Martini runtime when an MPI client registers for an External Control event
- MartiniProcessShutdown : invoked by the Martini runtime just before the virtual machine shuts down
- MartiniMessage : invoked by the Martini runtime when certain error conditions occur.
The Martini External Control module library is loaded by the Martini runtime, according to its configuration (TBD). Once the External Control module is loaded, its
EC_Init entry-point function is called. The module is expected to initialize itself in the context of the
EC_Init function and to establish the communication channel with the tool's front-end. When
EC_Init completes, execution returns to the Martini runtime and the Virtual Machine process continues its initialization.
When an MPI client registers for an external control event, the Martini runtime invokes the
RegisterMartiniCallback function of the External Control module and hands it a callback function pointer. The External Control module can then use this function pointer to generate the an MPI event to be delivered to the loaded MPI client.
When the External Control module needs to send a notification to the MPI Client, it uses the Martini callback function that corresponds to the event it wants to generate.
The following External Control events are supported:
(C) Copyright Intel Corporation 2007-2008. All Rights Reserved.