1.  TAU Trace Format Writer Library


1.1.  Tau Writer Usage

1.1.1.  SYNOPSIS

An API for writing TAU trace files

See TAU_tf.h

1.1.2.  DESCRIPTION

The TAU Trace Format Writer system, defined in TAU_tf.h, operates as a series of function calls that define the TAU trace file format. A TAU trace file is started with a call to the function:

Ttf_FileHandleT Ttf_OpenFileForOutput( const char *name, const char *edf)

Where *name and *edf are the locations of the TAU trace and event definition files to be written respectively. The TtfFileHandleT returned is then used to write the rest of the TAU trace. e.g: fh = Ttf_OpenFileForInput( argv[1], argv[2]);

1.2. TAU Trace File Writer API

1.2.1. int Ttf_DefClkPeriodT(Ttf_FileHandleT file, double clkPeriod );

Arguments: Ttf_FileHandleT file, double clkPeriod

Returns: int status

This method is called to define the clock period of the trace being written. It should return 0 upon successful completion.

1.2.2.  int Ttf_EndTraceT(userData,nodeToken,threadToken);

Arguments: Ttf_FileHandleT file, unsigned int nodeToken, unsigned int threadToken

Returns: int status

This method is called to mark an "End of Trace" event for a particular node/thread pair. It should return 0 upon successful completion.

1.2.3.  int Ttf_DefStateGroupT(Ttf_FileHandleT file, stateGroupToken, stateGroupName );

Arguments: Ttf_FileHandleT file, unsigned int stateGroupToken, const char *stateGroupName

Returns: int status

This method is called to define a state group. It is called with the trace file handler and the numeric ID of the state group being defined, stateGroupToken, and the name of the group being defined, stateGroupName. It should return 0 upon successful completion.

1.2.4.  int Ttf_DefStateT(Ttf_FileHandleT file, stateToken, stateName, stateGroupToken );

Arguments: Ttf_FileHandleT file, unsigned int stateToken, const char *stateName, unsigned int stateGroupToken

Returns: int status

This method is called to write a state definition. A state generally represents a programmatic function. It should return 0 upon successful completion.

1.2.5.  int Ttf_DefUserEvent(Ttf_FileHandleT file, userEventToken, userEventName, monotonicallyIncreasing);

Arguments: Ttf_FileHandleT file, unsigned int userEventToken, const char *userEventName, int monotonicallyIncreasing

Returns: int status

This method is called when writing a user defined event definition. It should return 0 upon successful completion.

1.2.6.  int Ttf_EnterStateT(Ttf_FileHandleT file, time, nodeToken, threadToken, stateToken );

Arguments: Ttf_FileHandleT file, double time, unsigned int nodeToken, unsigned int threadToken, unsigned int stateToken

Returns: int status

This method is called to write a state entry event. It is called with the trace file handler, the time of the state entry, time, the numeric ID of the node and thread where the entry is taking place, nodeToken and threadToken respectively, and the numeric ID of the state that has been entered. It should return 0 upon successful completion.

1.2.7.  int Ttf_LeaveStateT(Ttf_FileHandleT file, time, nodeToken, threadToken );

Arguments: Ttf_FileHandleT file, double time, unsigned int nodeToken, unsigned int threadToken

Returns: int status

This method is called to finish writing to a state. It is called with the trace file handler, the time of the state exit, time and the numeric IDs of the node and thread where the exit is taking place, nodeToken and threadToken respectively. It should return 0 upon successful completion.

1.2.8.  int Ttf_SendMessageT(Ttf_FileHandleT file, time, sourceNodeToken, sourceThreadToken, destinationNodeToken, destinationThreadToken, messageSize, int messageTag);

Arguments: Ttf_FileHandleT file, double time, unsigned int sourceNodeToken, unsigned int sourceThreadToken, unsigned int destinationNodeToken, unsigned int destinationThreadToken, unsigned int messageSize, unsigned int messageTag

Returns: int status

This method is called write a message send event. It is called with the trace file handler, the time of the transmission, time, the numeric IDs of the node and thread from which the message was sent, sourceNodeToken and sourceThreadToken respectively, the numeric IDs of the node and thread to which the message was sent, destinationNodeToken and destinationThreadToken respectively, the size of the message, messageSize, and the numeric ID of the message, messageTag. It should return 0 upon successful completion.

1.2.9.  int Ttf_RecvMessageT(Ttf_FileHandleT file, time, sourceNodeToken, sourceThreadToken, destinationNodeToken, destinationThreadToken, messageSize, int messageTag);

Arguments: Ttf_FileHandleT file, double time, unsigned int sourceNodeToken, unsigned int sourceThreadToken, unsigned int destinationNodeToken, unsigned int destinationThreadToken, unsigned int messageSize, unsigned int messageTag

Returns: int status

This method is called to write a message receive event. It is called with the trace file handler, the time of the receipt, time, the numeric IDs of the node and thread from which the message was sent, sourceNodeToken and sourceThreadToken respectively, the numeric IDs of the node and thread to which the message was sent, destinationNodeToken and destinationThreadToken respectively, the size of the message, messageSize, and the numeric ID of the message, messageTag. It should return 0 upon successful completion.

1.2.10. int Ttf_EventTrigger(Ttf_FileHandleT file, time, nodeToken, threadToken, userEventToken, userEventValue);

Arguments: Ttf_FileHandleT file, double time, unsigned int nodeToken, unsigned int threadToken, unsigned int userEventToken, long long userEventValue

Returns: int status

This method is called to write a user defined event trigger. It is called with the trace file handler, the time of the event trigger, time, the numeric IDs of the node and thread where the event was triggered, nodeToken and threadToken respectively, the numeric ID of the user defined event triggered, userEventToken and the value recorded by the user defined event, userEventValue. It should return 0 upon successful completion.

1.3.  TauReader API

1.3.1.  Ttf_FileHandleT TtfOpenFileForOutput(name, edf);

Arguments: const char *name, const char *edf

Returns: Ttf_FileHandleT fileHandle

Given the full name of the TAU trace file, name, and the corresponding event file, edf, and returns the virtual file handle that represents the trace in its entirety.

1.3.2.  int Ttf_AbsSeek(handle, eventPosition);

Arguments: Ttf_FileHandleT handle, int eventPosition

Returns: int position