Generic Trace Generator (GTG)  0.1
Functions
OTF interface in C of the traceGeneratorBasic API

Functions

const otf_color_t OTF_get_color (gtg_color_t color)
 Converts a GTG color into a OTF color. More...
 
trace_return_t OTFInitTrace (const char *filename, gtg_flag_t flags)
 Initialize an OTF trace. More...
 
trace_return_t OTFSetCompress (int val)
 Enable trace compression. More...
 
trace_return_t OTFAddContType (const char *alias, const char *contType, const char *name)
 Add a Container Type. More...
 
trace_return_t OTFAddStateType (const char *alias, const char *contType, const char *name)
 Add a State Type. More...
 
trace_return_t OTFAddEventType (const char *alias, const char *contType, const char *name)
 Add an Event Type. More...
 
trace_return_t OTFAddLinkType (const char *alias, const char *name, const char *contType, const char *srcContType, const char *destContType)
 Add a Link Type. More...
 
trace_return_t OTFAddVarType (const char *alias, const char *name, const char *contType)
 Add a Variable Type. More...
 
trace_return_t OTFAddEntityValue (const char *alias, const char *entType, const char *name, const otf_color_t color)
 Add an Entity Value. More...
 
trace_return_t OTFStartContainer (varPrec time, const char *alias, const char *type, const char *container, const char *name, const char *file)
 Start a Container. More...
 
trace_return_t OTFDestroyContainer (varPrec time, const char *name, const char *type)
 Destroy a Container. More...
 
trace_return_t OTFSetState (varPrec time, const char *type, const char *cont, const char *val)
 Set the State of a Container. More...
 
trace_return_t OTFPushState (varPrec time, const char *type, const char *cont, const char *val)
 Save the current State on a stack and change the State of a Container. More...
 
trace_return_t OTFPopState (varPrec time, const char *type, const char *cont)
 Revert the State of a Container to its previous value. More...
 
trace_return_t OTFAddEvent (varPrec time, const char *type, const char *cont, const char *val)
 Add an Event. More...
 
trace_return_t OTFStartLink (varPrec time, const char *type, const char *src, const char *dest, const char *val, const char *key)
 Start a Link. More...
 
trace_return_t OTFEndLink (varPrec time, const char *type, const char *src, const char *dest, const char *val, const char *key)
 End a Link. More...
 
trace_return_t OTFSetVar (varPrec time, const char *type, const char *cont, varPrec val)
 Set a Variable value. More...
 
trace_return_t OTFAddVar (varPrec time, const char *type, const char *cont, varPrec val)
 Add a value to a Variable. More...
 
trace_return_t OTFSubVar (varPrec time, const char *type, const char *cont, varPrec val)
 Substract a value from a Variable. More...
 
trace_return_t OTFAddComment (const char *comment)
 Add some Comment in Trace file. More...
 
trace_return_t OTFEndTrace ()
 Finalize an OTF trace. More...
 

Detailed Description

Function Documentation

◆ OTF_get_color()

const char * OTF_get_color ( gtg_color_t  color)

Converts a GTG color into a OTF color.

Parameters
colorGTG color to convert
Returns
The OTF color

◆ OTFAddComment()

trace_return_t OTFAddComment ( const char *  comment)

Add some Comment in Trace file.

Parameters
commentComment to be added
Returns
TRACE_SUCCESS on success
An error code otherwise

◆ OTFAddContType()

trace_return_t OTFAddContType ( const char *  alias,
const char *  contType,
const char *  name 
)

Add a Container Type.

Parameters
aliasAlias on the container
contTypeType of container
nameName of the container type
Returns
0 if success
An error code otherwise

◆ OTFAddEntityValue()

trace_return_t OTFAddEntityValue ( const char *  alias,
const char *  entType,
const char *  name,
const otf_color_t  color 
)

Add an Entity Value.

Parameters
aliasAlias on the entity value
entTypeType of the entity
nameName of the variable type
colorColor of the entity
Returns
0 if success
An error code otherwise

◆ OTFAddEvent()

trace_return_t OTFAddEvent ( varPrec  time,
const char *  type,
const char *  cont,
const char *  val 
)

Add an Event.

Parameters
timeTime at which the event happens
typeType of the event
contContainer in this event
valEntity value of the event of the container
Returns
0 if success
An error code otherwise

◆ OTFAddEventType()

trace_return_t OTFAddEventType ( const char *  alias,
const char *  contType,
const char *  name 
)

Add an Event Type.

Parameters
aliasAlias on the event type
contTypeType of container
nameName of the event type
Returns
0 if success
An error code otherwise

◆ OTFAddLinkType()

trace_return_t OTFAddLinkType ( const char *  alias,
const char *  name,
const char *  contType,
const char *  srcContType,
const char *  destContType 
)

Add a Link Type.

Parameters
aliasAlias on the link type
nameName of the link type
contTypeType of container
srcContTypeType of the source container
destContTypeType of the destination container
Returns
0 if success
An error code otherwise

◆ OTFAddStateType()

trace_return_t OTFAddStateType ( const char *  alias,
const char *  contType,
const char *  name 
)

Add a State Type.

Parameters
aliasAlias on the state type
contTypeType of container
nameName of the state type
Returns
0 if success
An error code otherwise

◆ OTFAddVar()

trace_return_t OTFAddVar ( varPrec  time,
const char *  type,
const char *  cont,
varPrec  val 
)

Add a value to a Variable.

Parameters
timeTime at which the variable is incremented
typeType of the variable
contContainer containning the variable
valValue added
Returns
0 if success
An error code otherwise

◆ OTFAddVarType()

trace_return_t OTFAddVarType ( const char *  alias,
const char *  contType,
const char *  name 
)

Add a Variable Type.

Parameters
aliasAlias on the variable type
contTypeType of container
nameName of the variable type
Returns
0 if success
An error code otherwise

◆ OTFDestroyContainer()

trace_return_t OTFDestroyContainer ( varPrec  time,
const char *  name,
const char *  type 
)

Destroy a Container.

Parameters
timeTime at which the container is destroyed
nameName of the container
typeType of the container
Returns
0 if success
An error code otherwise

◆ OTFEndLink()

trace_return_t OTFEndLink ( varPrec  time,
const char *  type,
const char *  cont,
const char *  dest,
const char *  val,
const char *  key 
)

End a Link.

Parameters
timeTime at which the link ends
typeType of the link
contContainer containning the link
destContainer destination
valEntity value of the link
keyKey to identify the link
Returns
0 if success
An error code otherwise

◆ OTFEndTrace()

OTFEndTrace ( )

Finalize an OTF trace.

Returns
0 if success
An error code otherwise

◆ OTFInitTrace()

trace_return_t OTFInitTrace ( const char *  filename,
gtg_flag_t  flags 
)

Initialize an OTF trace.

Parameters
filenameRoot name of the file to create
flagsOne of GTG_FLAG_NONE, GTG_FLAG_USE_MPI, GTG_FLAG_NOTBUF.
Returns
0 if success An error code otherwise

◆ OTFPopState()

trace_return_t OTFPopState ( varPrec  time,
const char *  type,
const char *  cont 
)

Revert the State of a Container to its previous value.

Parameters
timeTime at which the state is poped
typeType of the state
contContainer in this state
Returns
0 if success
An error code otherwise

◆ OTFPushState()

trace_return_t OTFPushState ( varPrec  time,
const char *  type,
const char *  cont,
const char *  val 
)

Save the current State on a stack and change the State of a Container.

Parameters
timeTime at which the state is pushed
typeType of the state
contContainer in this state
valEntity value of the state of the container
Returns
0 if success
An error code otherwise

◆ OTFSetCompress()

trace_return_t OTFSetCompress ( int  val)

Enable trace compression.

Parameters
val0 means no compression, otherwize the output files will be compressed.
Returns
0 if success
An error code otherwise

◆ OTFSetState()

trace_return_t OTFSetState ( varPrec  time,
const char *  type,
const char *  cont,
const char *  val 
)

Set the State of a Container.

Parameters
timeTime at which the state is set
typeType of the state
contContainer in this state
valEntity value of the state of the container
Returns
0 if success
An error code otherwise

◆ OTFSetVar()

trace_return_t OTFSetVar ( varPrec  time,
const char *  type,
const char *  cont,
varPrec  val 
)

Set a Variable value.

Parameters
timeTime at which the variable is set
typeType of the variable
contContainer containning the variable
valValue of the variable
Returns
0 if success
An error code otherwise

◆ OTFStartContainer()

trace_return_t OTFStartContainer ( varPrec  time,
const char *  alias,
const char *  type,
const char *  container,
const char *  name,
const char *  file 
)

Start a Container.

Parameters
timeTime at which the container is added
aliasAlias of the new container
typeType of the container
containerContainer parent
nameName of the variable type
fileFile containing the container trace
Returns
0 if success
An error code otherwise

◆ OTFStartLink()

trace_return_t OTFStartLink ( varPrec  time,
const char *  type,
const char *  cont,
const char *  src,
const char *  val,
const char *  key 
)

Start a Link.

Parameters
timeTime at which the link starts
typeType of the link
contContainer containning the link
srcContainer source
valEntity value of the link
keyKey to identify the link
Returns
0 if success
An error code otherwise

◆ OTFSubVar()

trace_return_t OTFSubVar ( varPrec  time,
const char *  type,
const char *  cont,
varPrec  val 
)

Substract a value from a Variable.

Parameters
timeTime at which the variable is incremented
typeType of the variable
contContainer containning the variable
valValue substracted
Returns
0 if success
An error code otherwise