esd_unify.h File Reference

Static program entity unification routines. More...


Data Structures

struct  UnifySingleId
struct  UnifyDoubleId
struct  UnifyMach
struct  UnifyNode
struct  UnifyProc
struct  UnifyThrd
struct  UnifyLoc
struct  UnifyRegion
struct  UnifyCsite
struct  UnifyCpath
struct  UnifyMetric
struct  UnifyCom
struct  UnifyCart
struct  UnifyWin
struct  GrpCount
struct  ComCount
struct  CartCoord
struct  EsdUnifyData_struct

Typedefs

typedef struct EsdUnifyData_struct EsdUnifyData

Enumerations

enum  esd_unify_map_t {
  ESD_UNIFY_STRMAP, ESD_UNIFY_MACHMAP, ESD_UNIFY_NODEMAP, ESD_UNIFY_LOCMAP,
  ESD_UNIFY_FILEMAP, ESD_UNIFY_REGMAP, ESD_UNIFY_CSITEMAP, ESD_UNIFY_CPATHMAP,
  ESD_UNIFY_COMMAP, ESD_UNIFY_WINMAP, ESD_UNIFY_NUM_MAPS
}

Functions

Unification data handling
EsdUnifyDataesd_unify_create ()
void esd_unify_free (EsdUnifyData *instance)
void esd_unify_buffer (EsdUnifyData *instance, const buffer_t buffer, size_t size, ElgOut *mapfile)
EpkIdMapesd_unify_get_map (const EsdUnifyData *instance, esd_unify_map_t map_id)
void esd_unify_clear_maps (EsdUnifyData *instance)
void esd_unify_write_defs (const EsdUnifyData *instance, ElgOut *deffile)


Detailed Description

This file contains type definitions and functions prototypes needed for the unification of per-process EPILOG definition records for static program entities, such as instrumented source code regions or MPI communicators.

The basic usage model of this module is as follows: Before any data can be processed, an unification data structure has to be created.

   EsdUnifyData* data = esd_unify_create();
Now, the EPILOG definition data can be processed by calling esd_unify_buffer() for the data generated by each process. Note that the current implementation requires these calls to be in ascending rank order. The unification process also collects per-process information, such as mappings from local to global identifiers or the numbers of events of the different types, which is stored by the esd_unify_buffer() call to a global mapping file.

To be able to access these mapping tables afterwards, they are not cleared automatically, i.e., this has to be done manually before processing the data of another process.

   for (i = 0; i < num_procs; i++) {
     esd_unify_buffer(data, buffer[i], bufsize[i], mapfile);
     esd_unify_clear_maps(data);
   }
After all definitions have been processed, the unified definitions can be written to a global definition file and the unification data structure can be released.
    esd_unify_write_defs(data, defsfile);
    esd_unify_free(data);

Note:
This module uses the assert() macro to check various conditions (especially the values of given parameters) at runtime, which can cause a performance penalty.

Typedef Documentation

typedef struct EsdUnifyData_struct EsdUnifyData

Opaque data structure storing global and per-process unification data.


Enumeration Type Documentation

Enumeration type defining symbolic names for the different per-process identifier mapping tables handled by EsdUnifyData.

Enumerator:
ESD_UNIFY_STRMAP  String ID mapping table
ESD_UNIFY_MACHMAP  Machine ID mapping table
ESD_UNIFY_NODEMAP  Node ID mapping table
ESD_UNIFY_LOCMAP  Location ID mapping table
ESD_UNIFY_FILEMAP  File ID mapping table
ESD_UNIFY_REGMAP  Region ID mapping table
ESD_UNIFY_CSITEMAP  Call site ID mapping table
ESD_UNIFY_CPATHMAP  Call-path ID mapping table
ESD_UNIFY_COMMAP  MPI communicator ID mapping table
ESD_UNIFY_WINMAP  RMA window ID mapping table
ESD_UNIFY_NUM_MAPS  Total number of mapping tables


Function Documentation

void esd_unify_buffer ( EsdUnifyData instance,
const buffer_t  buffer,
size_t  size,
ElgOut *  mapfile 
)

Processes size bytes of the local definition record data provided in the given memory buffer. The unified definition data is collected in the unification data object instance. In addition, the per-process data (mapping tables etc.) is stored as well as written to the EPILOG output stream mapfile (if defined).

In case of an error (e.g., if the buffer does not contain EPILOG data), an error message is printed and the program is aborted.

Parameters:
instance Unification data object
buffer Memory buffer containing the definition record data
size Size of buffer in bytes
mapfile EPILOG output stream

void esd_unify_clear_maps ( EsdUnifyData instance  ) 

Clears the per-process identifier mapping tables stored in the unification data object instance.

Parameters:
instance Unification data object
Note:
This function does not modify/delete any global unification data.

EsdUnifyData* esd_unify_create (  ) 

Creates and returns an new instance of type EsdUnifyData. If the memory allocation request can not be fulfilled, an error message is printed and the program is aborted.

Returns:
Pointer to new instance

void esd_unify_free ( EsdUnifyData instance  ) 

Destroys the given instance of EsdUnifyData and releases the allocated memory.

Parameters:
instance Object to be freed

EpkIdMap* esd_unify_get_map ( const EsdUnifyData instance,
esd_unify_map_t  map_id 
)

Returns one of the per-process identifier mapping tables stored in the unification data object instance. The requested table is specified by map_id.

Parameters:
instance Unification data object
map_id Requested mapping table
Returns:
Per-process identifier mapping table

void esd_unify_write_defs ( const EsdUnifyData instance,
ElgOut *  deffile 
)

Writes the unified definition data collected in the given EsdUnifyData instance to the EPILOG output stream deffile.

Parameters:
instance Object containing the unified definition data
deffile EPILOG output stream


SCALASCA    Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre