OpenMPI  0.1.1
Reader Interface

The reader provides high level read access to traces disregarding the presence of streams. More...

Files

file  OTF_Reader.h
 Transparently reads OTF traces which consist of multiple streams.
 

Typedefs

typedef struct struct_OTF_Reader OTF_Reader
 reader object
 

Functions

OTF_ReaderOTF_Reader_open (const char *namestub, OTF_FileManager *manager)
 Open a MasterControl file and return a OTF_Reader. More...
 
int OTF_Reader_setBufferSizes (OTF_Reader *reader, uint32_t size)
 Set the default buffer size for all buffers managed by this Reader. More...
 
uint32_t OTF_Reader_getBufferSizes (OTF_Reader *reader)
 Get the default buffer size. More...
 
void OTF_Reader_setZBufferSizes (OTF_Reader *reader, uint32_t size)
 Set the default zbuffer size for all buffers managed by this Reader. More...
 
uint32_t OTF_Reader_getZBufferSizes (OTF_Reader *reader)
 Get the default zbuffer size. More...
 
OTF_MasterControlOTF_Reader_getMasterControl (OTF_Reader *reader)
 Get a pointer to the mastercontrol of the reader. More...
 
int OTF_Reader_close (OTF_Reader *reader)
 Close an OTF_Reader instance and all its related files. More...
 
uint64_t OTF_Reader_readDefinitions (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all definitions from trace. More...
 
uint64_t OTF_Reader_readEvents (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all events from trace and calls the appropriate handler sorted by time. More...
 
uint64_t OTF_Reader_readEventsUnsorted (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all events from trace and calls the appropriate handler NOT sorted by time. More...
 
uint64_t OTF_Reader_readSnapshots (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all snapshots from trace. More...
 
uint64_t OTF_Reader_readSnapshotsUnsorted (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all snapshots from trace and calls the appropriate handler NOT sorted by time. More...
 
uint64_t OTF_Reader_readStatistics (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all statistic records from trace. More...
 
uint64_t OTF_Reader_readStatisticsUnsorted (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all statistics from trace and calls the appropriate handler NOT sorted by time. More...
 
uint64_t OTF_Reader_readMarkers (OTF_Reader *reader, OTF_HandlerArray *handlers)
 This function reads all markers from trace. More...
 
OTF_RStreamOTF_Reader_getStream (OTF_Reader *reader, uint32_t id)
 Searchs a reader stream and returns it. More...
 
int OTF_Reader_disableProcess (OTF_Reader *reader, uint32_t processId)
 disable given process. More...
 
int OTF_Reader_enableProcess (OTF_Reader *reader, uint32_t processId)
 enable given process. More...
 
uint8_t OTF_Reader_getProcessStatus (OTF_Reader *reader, uint32_t processId)
 Returns the current process status. More...
 
int OTF_Reader_setProcessStatus (OTF_Reader *reader, uint32_t processId, uint8_t status)
 Sets the current status of the process. More...
 
int OTF_Reader_setProcessStatusAll (OTF_Reader *reader, uint8_t status)
 Sets the status for all processes with a single call. More...
 
void OTF_Reader_setTimeInterval (OTF_Reader *reader, uint64_t minTime, uint64_t maxTime)
 Set the minimum time and the maximum time of the reader. More...
 
uint64_t OTF_Reader_getTimeIntervalMin (OTF_Reader *reader)
 Returns the begin of current time interval. More...
 
uint64_t OTF_Reader_getTimeIntervalMax (OTF_Reader *reader)
 Returns end of current time interval. More...
 
void OTF_Reader_setRecordLimit (OTF_Reader *reader, uint64_t limit)
 Set the maximum number of records delivered by a single call to OTF_Reader_readXYZ(). More...
 
uint64_t OTF_Reader_getRecordLimit (OTF_Reader *reader)
 Returns the current record limit. More...
 
void OTF_Reader_reset (OTF_Reader *reader)
 Resets all filters for timelimit, process selection and record count limit. More...
 
int OTF_Reader_closeAllStreams (OTF_Reader *reader)
 Closes all streams that are open in the reader. More...
 
uint8_t OTF_Reader_eventTimeProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading events. More...
 
uint8_t OTF_Reader_snapshotTimeProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading snapshots. More...
 
uint8_t OTF_Reader_statisticTimeProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading statistics. More...
 
uint8_t OTF_Reader_eventBytesProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading events. More...
 
uint8_t OTF_Reader_snapshotBytesProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading snapshots. More...
 
uint8_t OTF_Reader_statisticBytesProgress (OTF_Reader *reader, uint64_t *minimum, uint64_t *current, uint64_t *maximum)
 Delivers a progress report for reading statistics. More...
 

Detailed Description

The reader provides high level read access to traces disregarding the presence of streams.

A simple Example

#include <stdio.h>
#include <assert.h>
#include "otf.h"

Define handlers/callbacks for the records you want to read.

int handleEnter (void *userData, uint64_t time, uint32_t function, uint32_t process, uint32_t source) {
printf("we just entered function %u\n", function);
return OTF_RETURN_OK;
}
int handleLeave (void *userData, uint64_t time, uint32_t function, uint32_t process, uint32_t source) {
printf("byebye\n");
return OTF_RETURN_OK;
}
int main( int argc, char** argv ) {
Declare a file manager, a reader, and a handler array.
OTF_FileManager* manager;
OTF_Reader* reader;
OTF_HandlerArray* handlers;

Initialize the file manager. Do not open more than 100 files.

manager= OTF_FileManager_open( 100 );
assert( manager );

Initialize the handler array.

handlers = OTF_HandlerArray_open();
assert( handlers );

Initialize the reader.

reader = OTF_Reader_open( "mytrace", manager );
assert( reader );

Register your callback functions to the handler array.

OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleEnter, OTF_ENTER_RECORD );
OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleLeave, OTF_LEAVE_RECORD );
  Do the actual reading.
OTF_Reader_readEvents( reader, handlers );
  Clean everything up before exiting the program.
OTF_Reader_close( reader );
return 0;
}

Compile and link this using $ gcc -o test test.c otfconfig --libs.

A second, more complex Example

Same as before

#include <stdio.h>
#include <assert.h>
#include "otf.h"

Create a structure, which holds information needed in every handler. We will register this structure to the handlers, so that the userData pointer in every handler will point to it. In this example we just want to count the occurences.

typedef struct {
uint64_t count;

Define four handlers. In every handler we will increase HandlerArgument::count.

int handleDefProcess (void *userData, uint32_t stream, uint32_t process, const char *name, uint32_t parent) {
((HandlerArgument*)userData)->count++;
return OTF_RETURN_OK;
}
int handleDefFunction (void *userData, uint32_t stream, uint32_t func, const char *name, uint32_t funcGroup, uint32_t source) {
((HandlerArgument*)userData)->count++;
return OTF_RETURN_OK;
}
int handleEnter (void *userData, uint64_t time, uint32_t function, uint32_t process, uint32_t source) {
((HandlerArgument*)userData)->count++;
return OTF_RETURN_OK;
}
int handleLeave (void *userData, uint64_t time, uint32_t function, uint32_t process, uint32_t source) {
((HandlerArgument*)userData)->count++;
return OTF_RETURN_OK;
}

Same as before

int main( int argc, char** argv ) {
OTF_FileManager* manager;
OTF_Reader* reader;
OTF_HandlerArray* handlers;
We need some additional variables for the read progress
uint64_t minbytes;
uint64_t curbytes;
uint64_t maxbytes;
uint64_t ret;
ha.count = 0;
manager= OTF_FileManager_open( 100 );
assert( manager );
handlers = OTF_HandlerArray_open();
assert( handlers );
reader = OTF_Reader_open( "mytrace", manager );
assert( reader );

Register handlers for define process records, define function records, enter records and leave records

OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleDefProcess, OTF_DEFPROCESS_RECORD );

Register the first handler argument ha to the handler where it should be passed into.

OTF_HandlerArray_setFirstHandlerArg( handlers, &ha, OTF_DEFPROCESS_RECORD );
OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleDefFunction, OTF_DEFFUNCTION_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, &ha, OTF_DEFFUNCTION_RECORD );
OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleEnter, OTF_ENTER_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, &ha, OTF_ENTER_RECORD );
OTF_HandlerArray_setHandler( handlers, (OTF_FunctionPointer*) handleLeave, OTF_LEAVE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, &ha, OTF_LEAVE_RECORD );

Read definitions ( .def files). Inside this function the defProcess and defFunction handler will be called.

OTF_Reader_readDefinitions( reader, handlers );

Set the record limit to zero and read the events once. This initializes internal datastructures needed for getting the reading progress.

OTF_Reader_readEvents( reader, handlers );

To leave OTF_Reader_readEvents() once in a while, in order to update the progress, set the record limit to an appropriate number. 100000 in this case.

OTF_Reader_setRecordLimit( reader, 100000 );

Read the trace until no records are left.

while ( 0 != ( ret= OTF_Reader_readEvents( reader, handlers ) ) ) {

If an error occurs, leave the program.

if( OTF_READ_ERROR == ret ) {
fprintf( stderr, "Error while reading events. Aborting\n" );
OTF_Reader_close( reader );
exit(1);
}

Update the progress.

OTF_Reader_eventBytesProgress( reader, &minbytes, &curbytes, &maxbytes );
printf( "%llub / %llub\n", (long long unsigned)(curbytes - minbytes), (long long unsigned)(maxbytes-minbytes) );
}

Print out the gathered count of occurences of the four record types.

printf( "count: %llu\n", (long long unsigned) ha.count );

Finish everything

OTF_Reader_close( reader );
return 0;
}

Compile and link this using $ gcc -o test test.c otfconfig --libs.

When executing this test the output will be something like this:

*   4194304b / 73530754b
*   [..]
*   73530754b / 73530754b
*   count: 4582694 

Function Documentation

int OTF_Reader_close ( OTF_Reader reader)

Close an OTF_Reader instance and all its related files.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
1 if instance was closed successfully and 0 otherwise.
int OTF_Reader_closeAllStreams ( OTF_Reader reader)

Closes all streams that are open in the reader.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Reader::n, OTF_RStream_close(), and struct_OTF_Reader::stream.

int OTF_Reader_disableProcess ( OTF_Reader reader,
uint32_t  processId 
)

disable given process.

deprecated, use 'OTF_Reader_setProcessStatus()' instead.

This funktion will destroy a pending read operation, i.e. a read operation currently interrupted cannot be continued!

int OTF_Reader_enableProcess ( OTF_Reader reader,
uint32_t  processId 
)

enable given process.

deprecated, use 'OTF_Reader_setProcessStatus()' instead.

This funktion will destroy a pending read operation, i.e. a read operation currently interrupted cannot be continued!

uint8_t OTF_Reader_eventBytesProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading events.

Progress is given in terms of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).

ATTENTION: This is only a rough estimate of the progress, because it is computed based on the block I/O from files but not based on the actual bytes processed. This may result in constant values for small traces. See also OTF_Reader_eventTimeProgress():

This computation takes the read bytes of every active stream into account. The progress report is only valid after one or several calls to OTF_Reader_readEvents(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium bytes read ( is 0 everytime ).
currentReturn value for the current bytes read.
maximumReturn value for the filesize.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::buffers, struct_OTF_Heap::n, and OTF_RBuffer_getFilePos().

uint8_t OTF_Reader_eventTimeProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading events.

It is given in terms of time stamps. A percentage can be computed as ( current - minimum ) / ( maximum - minimum ). This computation takes restricted time intervals into account which is not possible with OTF_Reader_eventBytesProgress().

The progress report is only valid after one or several calls to OTF_Reader_readEvents(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium time.
currentReturn value for the current time.
maximumReturn value for the maximum time.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::progressMin.

Referenced by OTF_Reader_eventProgress().

uint32_t OTF_Reader_getBufferSizes ( OTF_Reader reader)

Get the default buffer size.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
Default buffer size.

References struct_OTF_Reader::buffersizes.

OTF_MasterControl* OTF_Reader_getMasterControl ( OTF_Reader reader)

Get a pointer to the mastercontrol of the reader.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
Pointer to the mastercontrol.

References struct_OTF_Reader::mc.

uint8_t OTF_Reader_getProcessStatus ( OTF_Reader reader,
uint32_t  processId 
)

Returns the current process status.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
processIdIdentifier of the process to get the status from
Returns
Current process status. '1' for enabled, '0' for disabled or unknown.

Returns the current process status.

uint64_t OTF_Reader_getRecordLimit ( OTF_Reader reader)

Returns the current record limit.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
Current record limit.

References struct_OTF_Reader::recordLimit.

OTF_RStream* OTF_Reader_getStream ( OTF_Reader reader,
uint32_t  id 
)

Searchs a reader stream and returns it.

If the stream does not exist it will be created.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
idIdentifier of the stream searched.
Returns
Initialised OTF_RStream object.

References struct_OTF_Reader::buffersizes, struct_OTF_RStream::id, struct_OTF_Reader::manager, struct_OTF_Reader::n, struct_OTF_Reader::namestub, OTF_RStream_open(), OTF_RStream_setBufferSizes(), OTF_RStream_setZBufferSizes(), and struct_OTF_Reader::stream.

uint64_t OTF_Reader_getTimeIntervalMax ( OTF_Reader reader)

Returns end of current time interval.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().

References struct_OTF_Reader::maxTime.

uint64_t OTF_Reader_getTimeIntervalMin ( OTF_Reader reader)

Returns the begin of current time interval.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().

References struct_OTF_Reader::minTime.

uint32_t OTF_Reader_getZBufferSizes ( OTF_Reader reader)

Get the default zbuffer size.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
Returns
zbuffer size.
OTF_Reader* OTF_Reader_open ( const char *  namestub,
OTF_FileManager manager 
)

Open a MasterControl file and return a OTF_Reader.

Parameters
namestubFile name prefix which is going to be used by all sub-files which belong to the trace.
fileManagerFile handle manager.
Returns
Initialized OTF_Reader instance or 0 if a failure occurred.

References struct_OTF_Reader::manager, struct_OTF_Reader::mc, struct_OTF_Reader::namestub, OTF_MasterControl_new(), OTF_MasterControl_read(), OTF_stripFilename(), struct_OTF_ProcessList::processes, and struct_OTF_ProcessList::status.

uint64_t OTF_Reader_readDefinitions ( OTF_Reader reader,
OTF_HandlerArray handlers 
)

This function reads all definitions from trace.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
handlersPointer to the handler array.
Returns
number of records successfully read or OTF_READ_ERROR

References struct_OTF_MapEntry::argument, struct_OTF_RBuffer::buffer, struct_OTF_Heap::buffers, struct_OTF_RBuffer::end, struct_OTF_Reader::mc, struct_OTF_Heap::n, OTF_KeyValueList_reset(), OTF_MasterControl_getEntryByIndex(), OTF_RBuffer_getRecord(), OTF_Reader_parseDefRecord(), struct_OTF_RBuffer::pos, and struct_OTF_Reader::recordLimit.

uint64_t OTF_Reader_readEventsUnsorted ( OTF_Reader reader,
OTF_HandlerArray handlers 
)

This function reads all events from trace and calls the appropriate handler NOT sorted by time.

It calls every handler in ONE stream sorted by time. And walks through the streams one by one. ( So the handlers of one process will be called, sorted by time, too )

This function is faster than OTF_Reader_readEvents(), especially for a bigger number of streams

See also
OTF_Reader_readEvents()

References struct_OTF_RBuffer::buffer, struct_OTF_Heap::buffers, struct_OTF_RBuffer::end, struct_OTF_RBuffer::firstTime, struct_OTF_RBuffer::lastTime, struct_OTF_Reader::maxTime, struct_OTF_Reader::minTime, struct_OTF_Heap::n, OTF_KeyValueList_reset(), OTF_RBuffer_getFilePos(), OTF_RBuffer_getFileProperties(), OTF_RBuffer_getFileSize(), OTF_RBuffer_getRecord(), OTF_RBuffer_readNewline(), OTF_RBuffer_searchTime(), OTF_Reader_parseEventRecord(), struct_OTF_RBuffer::pos, struct_OTF_RBuffer::process, struct_OTF_Heap::progressMin, struct_OTF_Heap::s, and struct_OTF_RBuffer::time.

uint64_t OTF_Reader_readMarkers ( OTF_Reader reader,
OTF_HandlerArray handlers 
)

This function reads all markers from trace.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
handlersPointer to the handler array.
Returns
number of records successfully read or OTF_READ_ERROR

References struct_OTF_MapEntry::argument, struct_OTF_RBuffer::buffer, struct_OTF_Heap::buffers, struct_OTF_RBuffer::end, struct_OTF_Reader::mc, struct_OTF_Heap::n, OTF_KeyValueList_reset(), OTF_MasterControl_getEntryByIndex(), OTF_RBuffer_getRecord(), OTF_Reader_parseMarkerRecord(), struct_OTF_RBuffer::pos, and struct_OTF_Reader::recordLimit.

uint64_t OTF_Reader_readSnapshotsUnsorted ( OTF_Reader reader,
OTF_HandlerArray handlers 
)

This function reads all snapshots from trace and calls the appropriate handler NOT sorted by time.

It calls every handler in ONE stream sorted by time. And it walks through the streams one by one. ( So the handlers of one process will be called, sorted by time, too )

This function is faster than OTF_Reader_readSnapshots(), especially for a bigger number of streams

See also
OTF_Reader_readSnapshots()

References struct_OTF_RBuffer::buffer, struct_OTF_Heap::buffers, struct_OTF_RBuffer::end, struct_OTF_RBuffer::firstTime, struct_OTF_RBuffer::lastTime, struct_OTF_Reader::maxTime, struct_OTF_Reader::minTime, struct_OTF_Heap::n, OTF_KeyValueList_reset(), OTF_RBuffer_getFilePos(), OTF_RBuffer_getFileProperties(), OTF_RBuffer_getFileSize(), OTF_RBuffer_getRecord(), OTF_RBuffer_readNewline(), OTF_RBuffer_searchTime(), OTF_Reader_parseSnapshotsRecord(), struct_OTF_RBuffer::pos, struct_OTF_RBuffer::process, struct_OTF_Heap::progressMin, struct_OTF_Heap::s, and struct_OTF_RBuffer::time.

uint64_t OTF_Reader_readStatisticsUnsorted ( OTF_Reader reader,
OTF_HandlerArray handlers 
)

This function reads all statistics from trace and calls the appropriate handler NOT sorted by time.

It calls every handler in ONE stream sorted by time. And it walks through the streams one by one. ( So the handlers of one process will be called, sorted by time, too )

This function is faster than OTF_Reader_readStatistics(), especially for a bigger number of streams

See also
OTF_Reader_readStatistics()

References struct_OTF_RBuffer::buffer, struct_OTF_Heap::buffers, struct_OTF_RBuffer::end, struct_OTF_RBuffer::firstTime, struct_OTF_RBuffer::lastTime, struct_OTF_Reader::maxTime, struct_OTF_Reader::minTime, struct_OTF_Heap::n, OTF_KeyValueList_reset(), OTF_RBuffer_getFilePos(), OTF_RBuffer_getFileProperties(), OTF_RBuffer_getFileSize(), OTF_RBuffer_getRecord(), OTF_RBuffer_readNewline(), OTF_RBuffer_searchTime(), OTF_Reader_parseStatisticsRecord(), struct_OTF_RBuffer::pos, struct_OTF_RBuffer::process, struct_OTF_Heap::progressMin, struct_OTF_Heap::s, and struct_OTF_RBuffer::time.

void OTF_Reader_reset ( OTF_Reader reader)

Resets all filters for timelimit, process selection and record count limit.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().

References OTF_Reader_setProcessStatusAll(), OTF_Reader_setRecordLimit(), and OTF_Reader_setTimeInterval().

int OTF_Reader_setBufferSizes ( OTF_Reader reader,
uint32_t  size 
)

Set the default buffer size for all buffers managed by this Reader.

This is only effective for future buffers and will not change already allocated buffers. Those can be changed with the buffers directly.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
sizeIntended buffer size.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Reader::buffersizes.

int OTF_Reader_setProcessStatus ( OTF_Reader reader,
uint32_t  processId,
uint8_t  status 
)

Sets the current status of the process.

This function will destroy a pending read operation, i.e. a read operation currently interrupted cannot be continued!

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
processIdIdentifier of the process.
statusnew status of the process. '1' for enabled, '0' for disabled or unknown.
Returns
1 on success, 0 if an error occurs.

Sets the current status of the process.

status is '0' for disabled and '1' for enabled

int OTF_Reader_setProcessStatusAll ( OTF_Reader reader,
uint8_t  status 
)

Sets the status for all processes with a single call.

This function will destroy a pending read operation, i.e. a read operation currently interrupted cannot be continued!

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
statusnew status of the process.
Returns
1 on success, 0 if an error occurs.

Referenced by OTF_Reader_reset().

void OTF_Reader_setRecordLimit ( OTF_Reader reader,
uint64_t  limit 
)

Set the maximum number of records delivered by a single call to OTF_Reader_readXYZ().

Defaults to OTF_READ_MAXRECORDS == . 'OTF_Reader_readXYZ()' returns with the number of records processed. Successive calls to 'OTF_Reader_readXYZ()' will deliver the remaining records. This funktion will NOT destroy a pending read operation, i.e. a read operation currently interrupted CAN be continued!

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
limitrecord limit. has to be smaller than or equal to OTF_READ_MAXRECORDS

References struct_OTF_Reader::recordLimit.

Referenced by OTF_Reader_reset().

void OTF_Reader_setTimeInterval ( OTF_Reader reader,
uint64_t  minTime,
uint64_t  maxTime 
)

Set the minimum time and the maximum time of the reader.

For example:
minTime = 100000;
maxTime = 100003;
Times to read: 100000, 100001, 100002
Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minTimetime where reading starts (including this timestamp)
maxTimetime where reading ends (excluding this timestamp)

References struct_OTF_Reader::maxTime, and struct_OTF_Reader::minTime.

Referenced by OTF_Reader_reset().

void OTF_Reader_setZBufferSizes ( OTF_Reader reader,
uint32_t  size 
)

Set the default zbuffer size for all buffers managed by this Reader.

This is only effective for future files and will not change already allocated zbuffers. Those can be changed with the files directly.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
sizeIntended zbuffer size.
uint8_t OTF_Reader_snapshotBytesProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading snapshots.

Progress is given in terms of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).

ATTENTION: This is only a rough estimate of the progress, because it is computed based on the block I/O from files but not based on the actual bytes processed. This may result in constant values for small traces. See also OTF_Reader_snapshotTimeProgress():

This computation takes the read bytes of every active stream into account. The progress report is only valid after one or several calls to OTF_Reader_readSnapshots(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium bytes read ( is 0 everytime ).
currentReturn value for the current bytes read.
maximumReturn value for the filesize.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::buffers, struct_OTF_Heap::n, and OTF_RBuffer_getFilePos().

uint8_t OTF_Reader_snapshotTimeProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading snapshots.

It is given in terms of time stamps. A percentage can be computed as ( current - minimum ) / ( maximum - minimum ). This computation takes restricted time intervals into account which is not possible with OTF_Reader_snapshotBytesProgress().

The progress report is only valid after one or several calls to OTF_Reader_readSnapshots(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium time.
currentReturn value for the current time.
maximumReturn value for the maximum time.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::progressMin.

Referenced by OTF_Reader_snapshotProgress().

uint8_t OTF_Reader_statisticBytesProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading statistics.

Progress is given in terms of bytes. The percentage can be computed as ( current - minimum ) / ( maximum - minimum ).

ATTENTION: This is only a rough estimate of the progress, because it is computed based on the block I/O from files but not based on the actual bytes processed. This may result in constant values for small traces. See also OTF_Reader_statisticTimeProgress():

This computation takes the read bytes of every active stream into account. The progress report is only valid after one or several calls to OTF_Reader_readStatistics(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium bytes read ( is 0 everytime ).
currentReturn value for the current bytes read.
maximumReturn value for the filesize.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::buffers, struct_OTF_Heap::n, and OTF_RBuffer_getFilePos().

uint8_t OTF_Reader_statisticTimeProgress ( OTF_Reader reader,
uint64_t *  minimum,
uint64_t *  current,
uint64_t *  maximum 
)

Delivers a progress report for reading statistics.

It is given in terms of time stamps. A percentage can be computed as ( current - minimum ) / ( maximum - minimum ). This computation takes restricted time intervals into account which is not possible with OTF_Reader_statisticBytesProgress().

The progress report is only valid after one or several calls to OTF_Reader_readStatistics(). Otherwise the return arguments 'minimum', 'current' and 'maximum' are undefined! If 'minimum' > 'maximum' the values are invalid.

Parameters
readerPointer to an initialized OTF_Reader object. See also OTF_Reader_open().
minimumReturn value for the minium time.
currentReturn value for the current time.
maximumReturn value for the maximum time.
Returns
1 on success, 0 if an error occurs.

References struct_OTF_Heap::progressMin.

Referenced by OTF_Reader_statisticProgress().