2.3 (revision 117c8d5b)
Data Structures | Macros | Typedefs
Operating OTF2 in a collective context

Data Structures

struct  OTF2_CollectiveCallbacks
 Struct which holds all collective callbacks. More...
 

Macros

#define OTF2_COLLECTIVES_ROOT   0
 Constant which determines that the master object should be the root for the collective operation.
 

Typedefs

typedef struct OTF2_CollectiveContext OTF2_CollectiveContext
 User provided type for collective groups. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_GetSize) (void *userData, OTF2_CollectiveContext *commContext, uint32_t *size)
 Returns the number of OTF2_Archive objects operating in this communication context. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_GetRank) (void *userData, OTF2_CollectiveContext *commContext, uint32_t *rank)
 Returns the rank of this OTF2_Archive objects in this communication context. A number between 0 and one less of the size of the communication context. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_CreateLocalComm) (void *userData, OTF2_CollectiveContext **localCommContext, OTF2_CollectiveContext *globalCommContext, uint32_t globalRank, uint32_t globalSize, uint32_t localRank, uint32_t localSize, uint32_t fileNumber, uint32_t numberOfFiles)
 Create a new disjoint partitioning of the the globalCommContext communication context. numberOfFiles denotes the number of the partitions. fileNumber denotes in which of the partitions this OTF2_Archive should belong. localSize is the size of this partition and localRank the rank of this OTF2_Archive in the partition. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_FreeLocalComm) (void *userData, OTF2_CollectiveContext *localCommContext)
 Destroys the communication context previous created by the OTF2_Collectives_CreateLocalComm callback. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Barrier) (void *userData, OTF2_CollectiveContext *commContext)
 Performs a barrier collective on the given communication context. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Bcast) (void *userData, OTF2_CollectiveContext *commContext, void *data, uint32_t numberElements, OTF2_Type type, uint32_t root)
 Performs a broadcast collective on the given communication context. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Gather) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, void *outData, uint32_t numberElements, OTF2_Type type, uint32_t root)
 Performs a gather collective on the given communication context where each ranks contribute the same number of elements. outData is only valid at rank root. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Gatherv) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, uint32_t inElements, void *outData, const uint32_t *outElements, OTF2_Type type, uint32_t root)
 Performs a gather collective on the given communication context where each ranks contribute different number of elements. outData and outElements are only valid at rank root. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Scatter) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, void *outData, uint32_t numberElements, OTF2_Type type, uint32_t root)
 Performs a scatter collective on the given communication context where each ranks contribute the same number of elements. inData is only valid at rank root. More...
 
typedef OTF2_CallbackCode(* OTF2_Collectives_Scatterv) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, const uint32_t *inElements, void *outData, uint32_t outElements, OTF2_Type type, uint32_t root)
 Performs a scatter collective on the given communication context where each ranks contribute different number of elements. inData and inElements are only valid at rank root. More...
 
typedef void(* OTF2_Collectives_Release) (void *userData, OTF2_CollectiveContext *globalCommContext, OTF2_CollectiveContext *localCommContext)
 Optionally called in OTF2_Archive_Close or OTF2_Reader_Close respectively. More...
 

Detailed Description

To operate multiple OTF2_Archive objects in a collective context, the following callbacks need to be implemented. These are mandatory, when writing a trace file with multiple OTF2_Archive objects. The OTF2_Archive for which the OTF2_Collectives_GetRank result is OTF2_COLLECTIVES_ROOT will be marked as the master object. Only this is allowed to write global definitions, markers, …. For reading a set of serial callbacks are provided (See OTF2_Archive_SetSerialCollectiveCallbacks and OTF2_Reader_SetSerialCollectiveCallbacks). The struct OTF2_CollectiveContext needs to be declared too.

Only OTF2_Type of the integer and floating point category need to be considered as values when the callbacks are called.

Except for the OTF2_Collectives_GetSize and OTF2_Collectives_GetRank callbacks, the return value must always be the same for all participating tasks. In particular all calls should either return OTF2_CALLBACK_SUCCESS or !OTF2_CALLBACK_SUCCESS, but it is undefined, if some of the calls return OTF2_CALLBACK_SUCCESS and other !OTF2_CALLBACK_SUCCESS.

The OTF2_Collectives_CreateLocalComm and OTF2_Collectives_FreeLocalComm are ignored when writing and optional when reading, but than both are mandatory. These are used to created the same local communication context as was given at writing time, if possible.

On the contrary the localCommContext to OTF2_Archive_SetCollectiveCallbacks is ignored when reading and optional (i.e., not NULL) when writing. It determines the number of files to use when the SION substrate is used. these localCommContext must be a disjoint partitioning of the used globalCommContext than.

The OTF2_Collectives_Release is optional and will be called as one of the last actions before the OTF2_Archive or the OTF2_Reader will be closed.

If any collective callback returns !OTF2_CALLBACK_SUCCESS, than OTF2 returns to the caller the error OTF2_ERROR_COLLECTIVE_CALLBACK.

Typedef Documentation

User provided type for collective groups.

Since
Version 1.3
typedef OTF2_CallbackCode( * OTF2_Collectives_GetSize) (void *userData, OTF2_CollectiveContext *commContext, uint32_t *size)

Returns the number of OTF2_Archive objects operating in this communication context.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_GetRank) (void *userData, OTF2_CollectiveContext *commContext, uint32_t *rank)

Returns the rank of this OTF2_Archive objects in this communication context. A number between 0 and one less of the size of the communication context.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_CreateLocalComm) (void *userData, OTF2_CollectiveContext **localCommContext, OTF2_CollectiveContext *globalCommContext, uint32_t globalRank, uint32_t globalSize, uint32_t localRank, uint32_t localSize, uint32_t fileNumber, uint32_t numberOfFiles)

Create a new disjoint partitioning of the the globalCommContext communication context. numberOfFiles denotes the number of the partitions. fileNumber denotes in which of the partitions this OTF2_Archive should belong. localSize is the size of this partition and localRank the rank of this OTF2_Archive in the partition.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_FreeLocalComm) (void *userData, OTF2_CollectiveContext *localCommContext)

Destroys the communication context previous created by the OTF2_Collectives_CreateLocalComm callback.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Barrier) (void *userData, OTF2_CollectiveContext *commContext)

Performs a barrier collective on the given communication context.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Bcast) (void *userData, OTF2_CollectiveContext *commContext, void *data, uint32_t numberElements, OTF2_Type type, uint32_t root)

Performs a broadcast collective on the given communication context.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Gather) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, void *outData, uint32_t numberElements, OTF2_Type type, uint32_t root)

Performs a gather collective on the given communication context where each ranks contribute the same number of elements. outData is only valid at rank root.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Gatherv) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, uint32_t inElements, void *outData, const uint32_t *outElements, OTF2_Type type, uint32_t root)

Performs a gather collective on the given communication context where each ranks contribute different number of elements. outData and outElements are only valid at rank root.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Scatter) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, void *outData, uint32_t numberElements, OTF2_Type type, uint32_t root)

Performs a scatter collective on the given communication context where each ranks contribute the same number of elements. inData is only valid at rank root.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef OTF2_CallbackCode( * OTF2_Collectives_Scatterv) (void *userData, OTF2_CollectiveContext *commContext, const void *inData, const uint32_t *inElements, void *outData, uint32_t outElements, OTF2_Type type, uint32_t root)

Performs a scatter collective on the given communication context where each ranks contribute different number of elements. inData and inElements are only valid at rank root.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.
typedef void( * OTF2_Collectives_Release) (void *userData, OTF2_CollectiveContext *globalCommContext, OTF2_CollectiveContext *localCommContext)

Optionally called in OTF2_Archive_Close or OTF2_Reader_Close respectively.

Since
Version 1.3
Returns
OTF2_CALLBACK_SUCCESS or OTF2_CALLBACK_ERROR.