2.2 (revision 4737)
Data Structures | Typedefs
Controlling OTF2 flush behavior in writing mode

Data Structures

struct  OTF2_FlushCallbacks
 Structure holding the flush callbacks. More...
 

Typedefs

typedef OTF2_FlushType(* OTF2_PreFlushCallback) (void *userData, OTF2_FileType fileType, OTF2_LocationRef location, void *callerData, bool final)
 Definition for the pre flush callback. More...
 
typedef OTF2_TimeStamp(* OTF2_PostFlushCallback) (void *userData, OTF2_FileType fileType, OTF2_LocationRef location)
 Definition for the post flush callback. More...
 

Detailed Description

The flushing behavior from OTF2 can be controlled via callbacks. Calling OTF2_Archive_SetFlushCallbacks is mandatory when writing and erroneous when reading an archive.

The pre-flush callback decides whether a flush should actually happen. When missing, the default is not to flush any data for event writers, all others will flush there data by default.

The post-flush callback is used to decide whether a buffer flush record should be written after the flush finished. This only applies to event writers.

Typedef Documentation

typedef OTF2_FlushType( * OTF2_PreFlushCallback) (void *userData, OTF2_FileType fileType, OTF2_LocationRef location, void *callerData, bool final)

Definition for the pre flush callback.

This callback is triggered right before flushing the recorded data into file when running out of memory.

Parameters
userDataData passed to the call OTF2_Archive_SetFlushCallbacks.
fileTypeThe type of file for what this buffer holds data.
locationThe location id for what this buffer holds data. This is only valid for files of type OTF2_FILETYPE_LOCAL_DEFS or OTF2_FILETYPE_EVENTS. For other files this is OTF2_UNDEFINED_LOCATION. A special case exists for files of type OTF2_FILETYPE_EVENTS in writing mode. The location ID may still be OTF2_UNDEFINED_LOCATION. In this case if the application wants to write the data from the buffer into the file, the application needs to provide a valid location ID via a call to OTF2_EvtWriter_SetLocationID() and utilizing the callerData argument.
callerDataDepending of the fileType, this can be an OTF2_EvtWriter, OTF2_GlobalDefWriter, OTF2_DefWriter.
finalIndicates whether this is the final flush when closing the writer objects.
Returns
Returns OTF2_FLUSH or OTF2_NO_FLUSH.
typedef OTF2_TimeStamp( * OTF2_PostFlushCallback) (void *userData, OTF2_FileType fileType, OTF2_LocationRef location)

Definition for the post flush callback.

This callback is triggered right after flushing the recorded data into file when running out of memory. The main function of this callback is to provide a timestamp for the end of flushing data into a file. So an according record can be written correctly.

Parameters
userDataData passed to the call OTF2_Archive_SetFlushCallbacks.
fileTypeThe file type for which the flush has happened.
locationThe location ID of the writer for which the flush has happened (for file types without an ID this is OTF2_UNDEFINED_LOCATION).
Returns
Returns a timestamp for the end of flushing data into a file.