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

## Detailed Description

## Function Documentation

## OTF_get_color()

const otf_color_t OTF_get_color | ( | gtg_color_t | color | ) |

Converts a GTG color into a OTF color.

Parameters

  color | GTG color to convert

Returns
  The OTF color

## OTFAddComment()

trace_return_t OTFAddComment | ( | const char * | comment | ) |

Add some Comment in Trace file.

Parameters

  comment | Comment 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

  alias | Alias on the container
  contType | Type of container
  name | Name 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

  alias | Alias on the entity value
  entType | Type of the entity
  name | Name of the variable type
  color | Color 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

  time | Time at which the event happens
  type | Type of the event
  cont | Container in this event
  val | Entity 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

  alias | Alias on the event type
  contType | Type of container
  name | Name 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

  alias | Alias on the link type
  name | Name of the link type
  contType | Type of container
  srcContType | Type of the source container
  destContType | Type 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

  alias | Alias on the state type
  contType | Type of container
  name | Name 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

  time | Time at which the variable is incremented
  type | Type of the variable
  cont | Container containning the variable
  val | Value 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

  alias | Alias on the variable type
  contType | Type of container
  name | Name 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

  time | Time at which the container is destroyed
  name | Name of the container
  type | Type 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

  time | Time at which the link ends
  type | Type of the link
  cont | Container containning the link
  dest | Container destination
  val | Entity value of the link
  key | Key to identify the link

Returns
  0 if success
  An error code otherwise

## OTFEndTrace()

trace_return_t 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

  filename | Root name of the file to create
  flags | One 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

  time | Time at which the state is poped
  type | Type of the state
  cont | Container 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

  time | Time at which the state is pushed
  type | Type of the state
  cont | Container in this state
  val | Entity 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

  val | 0 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

  time | Time at which the state is set
  type | Type of the state
  cont | Container in this state
  val | Entity 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

  time | Time at which the variable is set
  type | Type of the variable
  cont | Container containning the variable
  val | Value 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

  time | Time at which the container is added
  alias | Alias of the new container
  type | Type of the container
  container | Container parent
  name | Name of the variable type
  file | File 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

  time | Time at which the link starts
  type | Type of the link
  cont | Container containning the link
  src | Container source
  val | Entity value of the link
  key | Key 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

  time | Time at which the variable is incremented
  type | Type of the variable
  cont | Container containning the variable
  val | Value substracted

Returns
  0 if success
  An error code otherwise