1
1

- added tool 'otfinfo' which can be used to get basic information of a trace

(also usable to check validation of a trace)
- removed OTF python bindings
  (a working version of the OTF python bindings are available in the latest stand-alone release;
  see http://www.tu-dresden.de/zih/otf/)
- incremented OTF version number

This commit was SVN r21601.
Этот коммит содержится в:
Matthias Jurenz 2009-07-06 11:55:09 +00:00
родитель 92e40cb20a
Коммит b4026c40ad
15 изменённых файлов: 1702 добавлений и 465 удалений

Просмотреть файл

@ -1,4 +1,5 @@
5.4.9
- updated version of internal OTF to 1.3.12 (see extlib/otf/ChangeLog)
- install header files to 'PREFIX/include/vampirtrace' by default to
avoid conflicts with the OpenMPI integrated version of VT
- added configure option '--with[out]-bfd' to control usage of BFD

Просмотреть файл

@ -1,164 +1,53 @@
1.0
- initial version
1.1.1
- OTF_Reader now considers the return values of the handlers
- added OTF_VERBOSE, OTF_DEBUG macro for error treatment
- introduced 'UnknownRecord' handler which allows to catch
unknown record types
1.3.12
- added tool 'otfinfo' which can be used to get basic information of
a trace
- removed python bindings
(a working version of the OTF python bindings are available in the
latest stand-alone release; see http://www.tu-dresden.de/zih/otf/)
1.1.2
- inverted return value of call-back handlers:
'0' is non-error, '!= 0' is regarded as an error, now!
(this makes OTF conform with the VTF3 scheme.)
1.3.11
- build/install tool 'otfdump' by default
- install documentation
- bugfix: removed included system headers inside 'extern "C" {}'
- bugfix: added configure check for functions 'fseeko()' and 'ftello()'
(these functions are not available on NEC SX platforms)
1.1.3
- fixed a minor bug in otfaux
1.3.10
- added configure option '--[enable|disable]-binaries' to control
building of binaries (useful for multi-lib installations)
1.1.4
- fixed a bug in OTF_Reader which might have caused the very first
time stamp of a trace to be not properly sorted
- introduced '--snapshots' and '--statistics' switches to do only
snapshots or statistics. for statistics a selective mode is allowed
which regards only some streams. By this means statistics can be created
in parallel by calling otfaux multiple times.
1.3.9
- fixed a portability bug: use own implementation of function
'strdup()'
- install a symbolic link 'otfdecompress' which is a synonym for
'otfcompress -d'
1.1.5
- have UnknownRecord report handle incomplete records or additional bytes at
the end of a file.
1.3.8
- generate OTF_inttypes.h during configuring which provides
the integer types like int64_t, int8_t,...
- shared OTF library will be linked with zlib, thus additionally
linking with zlib is not necessary
- bugfix in otf2vtf: correctly handle function leave records with id 0
1.2
- introduce transparent zlib compression
1.3.7
- added example for using OTF_MasterControl to the doxygen documentation
- general improvement of the documentation
- improved autoconf's m4 scripts for cross buildings
1.2.1
- added progress functions using read bytes instead of timestamps
1.3.6
- OTF_{Keywords.h,Parse.h,Platform.h} will no longer be installed
- added a compile time assert making sure the correct sizes of the
integer types ([u]int*_T)
- OTF is now Windows Visual Studio compatible
1.2.2
- important bugfix: definitionstream 0 was ignored since version 1.2
1.3.5
- added doxygen html documentation (docu/doxygen/html/index.html)
- fixed issue, where newlines were forbidden in def, stats and snaps
- added missing const to OTF_WStream_writeDefProcessGroup()
1.2.3
- bugfix: provided copy handlers returned wrong value
1.2.4
- bugfix: zlib compression bug, wrong sanity check fixed
1.2.5
- bugfix: correctly handle process groups with more than 1000 entries
1.2.6
- support shared libraries
1.2.7
- added progress functions to OTF_RStream
- added a progress counter to otfmerge
1.2.8
- allow suffix '.dylib' for zlib library file (from Mac OS X)
- removed configure warning
1.2.9
- changeable zlevel
- changeable zbuffersize
1.2.10
- bugfix: otfmerge does no longer accept traces with local streams
1.2.11
- changed OTF_RETURN*( 0=success, !0 = error )
- added these macros to all internal functions and tools for better
consistency
- fixed various memoryleaks in otf and otfmerge
- added otfconfig to tools. otfconfig shows installationparameters
important for developers
- updated documentation
1.2.12
- removed intel compiler warnings in otfmerge
- removed debug output
- fixed 64bit issue
1.2.13
- removed intel compiler warnings
- changed OTF_FILETYPE_*-macros
- fixed issues with OTF_getFilename()
1.2.14
- do not linke with '-lz' if '--with-zlibsymbols' was specified
- added zlib include line to otflib/Makefile.am
1.2.15
- 3 new records introduced (NOTE: these are experimental):
- DefFile
- DefFileGroup
- FileOperation
1.2.16
- fixed a problem with comments in otfmerge
- 2 new records introduced (NOTE: these are experimental):
- OpenFileSnapshot
- FileOperationSummary
1.2.17
- bugfixed parser (wrong treatment of unknown records)
- added FileGroupOperationSummary record
- changed FileOperation-, OpenFileSnapshot- and FileOperationSummary- record
NOTE: these records are still experimental
- included file operation records into all tools
NOTE: some parameters were added/changed
- the byte-parameter in the FileOperation record does now contain the
new position in the file file after the seek operation
- bugfixed otfmerge
1.2.18
- added fwrite check for writting less bytes than expected
- re-write of otfdump. Now, it uses OTF read lib instead of plain scanf.
It produces nicer output and numbers records in read order.
1.2.19
- finished otfdump
- removed debug output in OTF_Reader.c
- re-introduced DefVersion record as read only
1.2.20
- added own inttypes definitions in case there is no on the platform
(necessary on NEC SX6)
1.2.21
- fixed "--with-zlib-symbols"-bug
1.2.22
- fixed inttypes/stdint bug
1.2.23
- removed libtool from autoconf to make configure much faster,
libtool was not used by automake anyhow
- removed some autoconf-generated files from CVS,
you might need to re-run 'sh bootstrap' yourself
1.2.24
- minor change in otf[de|un]compress
- strictly avoid writing of unsorted time stamps. Now, there will be an
error message and the corresponding buffer/stream will be disabled for
further writing. The write routines provide an invlaid return code but
currently there is no way to "repair" the buffer/stream after an unsorted
time stamp has been issued.
1.3
- integrated libtool for shared and static linkage to otf
- removed the possibility to include zlib symbols into otf
- fixed warning which appeared when not using zlib
- added python bindings to the otf library
1.3.1
- if an fopen() call fails an error is now printed out every time
- OTF_READ_ERROR was introduced as an error return value for all
OTF_Reader_readXXX and OTF_RStream_readXXX functions. So (uint64_t)-1 is
now a reserved value, thus cannot be used as record limit.
The record limit always has to be smaller than or equal to
OTF_READ_MAXRECORDS.
- fixed issue in otfmerge, when using many streams
1.3.2
- added small functions to convert various variable types to common
counter type uint64_t. By this means, other types can be transported
as uint64_t and re-casted during reading.
This requires type information as additional counter property flags!
1.3.4
- bug fix in otfmerge: missing handling of DefCollectiveOperation
- bugfix in the documentation: overview.eps was broken
1.3.3
- fixed configure bug when searching for zlib on mac
@ -171,46 +60,168 @@
- fixed configure bug, when using python bindings
- updated python bindings to support user defined counters
1.3.4
- bug fix in otfmerge: missing handling of DefCollectiveOperation
- bugfix in the documentation: overview.eps was broken
1.3.2
- added small functions to convert various variable types to common
counter type uint64_t. By this means, other types can be transported
as uint64_t and re-casted during reading.
This requires type information as additional counter property flags!
1.3.5
- added doxygen html documentation (docu/doxygen/html/index.html)
- fixed issue, where newlines were forbidden in def, stats and snaps
- added missing const to OTF_WStream_writeDefProcessGroup()
1.3.1
- if an fopen() call fails an error is now printed out every time
- OTF_READ_ERROR was introduced as an error return value for all
OTF_Reader_readXXX and OTF_RStream_readXXX functions. So (uint64_t)-1 is
now a reserved value, thus cannot be used as record limit.
The record limit always has to be smaller than or equal to
OTF_READ_MAXRECORDS.
- fixed issue in otfmerge, when using many streams
1.3.6
- OTF_{Keywords.h,Parse.h,Platform.h} will no longer be installed
- added a compile time assert making sure the correct sizes of the
integer types ([u]int*_T)
- OTF is now Windows Visual Studio compatible
1.3
- integrated libtool for shared and static linkage to otf
- removed the possibility to include zlib symbols into otf
- fixed warning which appeared when not using zlib
- added python bindings to the otf library
1.3.7
- added example for using OTF_MasterControl to the doxygen documentation
- general improvement of the documentation
- improved autoconf's m4 scripts for cross buildings
1.2.24
- minor change in otf[de|un]compress
- strictly avoid writing of unsorted time stamps. Now, there will be an
error message and the corresponding buffer/stream will be disabled for
further writing. The write routines provide an invlaid return code but
currently there is no way to "repair" the buffer/stream after an unsorted
time stamp has been issued.
1.3.8
- generate OTF_inttypes.h during configuring which provides
the integer types like int64_t, int8_t,...
- shared OTF library will be linked with zlib, thus additionally
linking with zlib is not necessary
- bugfix in otf2vtf: correctly handle function leave records with id 0
1.2.23
- removed libtool from autoconf to make configure much faster,
libtool was not used by automake anyhow
- removed some autoconf-generated files from CVS,
you might need to re-run 'sh bootstrap' yourself
1.3.9
- fixed a portability bug: use own implementation of function
'strdup()'
- install a symbolic link 'otfdecompress' which is a synonym for
'otfcompress -d'
1.2.22
- fixed inttypes/stdint bug
1.3.10
- added configure option '--[enable|disable]-binaries' to control
building of binaries (useful for multi-lib installations)
1.2.21
- fixed "--with-zlib-symbols"-bug
1.3.11
- build/install tool 'otfdump' by default
- install documentation
- bugfix: removed included system headers inside 'extern "C" {}'
- bugfix: added configure check for functions 'fseeko()' and 'ftello()'
(these functions are not available on NEC SX platforms)
1.2.20
- added own inttypes definitions in case there is no on the platform
(necessary on NEC SX6)
1.2.19
- finished otfdump
- removed debug output in OTF_Reader.c
- re-introduced DefVersion record as read only
1.2.18
- added fwrite check for writting less bytes than expected
- re-write of otfdump. Now, it uses OTF read lib instead of plain scanf.
It produces nicer output and numbers records in read order.
1.2.17
- bugfixed parser (wrong treatment of unknown records)
- added FileGroupOperationSummary record
- changed FileOperation-, OpenFileSnapshot- and FileOperationSummary- record
NOTE: these records are still experimental
- included file operation records into all tools
NOTE: some parameters were added/changed
- the byte-parameter in the FileOperation record does now contain the
new position in the file file after the seek operation
- bugfixed otfmerge
1.2.16
- fixed a problem with comments in otfmerge
- 2 new records introduced (NOTE: these are experimental):
- OpenFileSnapshot
- FileOperationSummary
1.2.15
- 3 new records introduced (NOTE: these are experimental):
- DefFile
- DefFileGroup
- FileOperation
1.2.14
- do not linke with '-lz' if '--with-zlibsymbols' was specified
- added zlib include line to otflib/Makefile.am
1.2.13
- removed intel compiler warnings
- changed OTF_FILETYPE_*-macros
- fixed issues with OTF_getFilename()
1.2.12
- removed intel compiler warnings in otfmerge
- removed debug output
- fixed 64bit issue
1.2.11
- changed OTF_RETURN*( 0=success, !0 = error )
- added these macros to all internal functions and tools for better
consistency
- fixed various memoryleaks in otf and otfmerge
- added otfconfig to tools. otfconfig shows installationparameters
important for developers
- updated documentation
1.2.10
- bugfix: otfmerge does no longer accept traces with local streams
1.2.9
- changeable zlevel
- changeable zbuffersize
1.2.8
- allow suffix '.dylib' for zlib library file (from Mac OS X)
- removed configure warning
1.2.7
- added progress functions to OTF_RStream
- added a progress counter to otfmerge
1.2.6
- support shared libraries
1.2.5
- bugfix: correctly handle process groups with more than 1000 entries
1.2.4
- bugfix: zlib compression bug, wrong sanity check fixed
1.2.3
- bugfix: provided copy handlers returned wrong value
1.2.2
- important bugfix: definitionstream 0 was ignored since version 1.2
1.2.1
- added progress functions using read bytes instead of timestamps
1.2
- introduce transparent zlib compression
1.1.5
- have UnknownRecord report handle incomplete records or additional bytes at
the end of a file.
1.1.4
- fixed a bug in OTF_Reader which might have caused the very first
time stamp of a trace to be not properly sorted
- introduced '--snapshots' and '--statistics' switches to do only
snapshots or statistics. for statistics a selective mode is allowed
which regards only some streams. By this means statistics can be created
in parallel by calling otfaux multiple times.
1.1.3
- fixed a minor bug in otfaux
1.1.2
- inverted return value of call-back handlers:
'0' is non-error, '!= 0' is regarded as an error, now!
(this makes OTF conform with the VTF3 scheme.)
1.1.1
- OTF_Reader now considers the return values of the handlers
- added OTF_VERBOSE, OTF_DEBUG macro for error treatment
- introduced 'UnknownRecord' handler which allows to catch
unknown record types
1.0
- initial version

Просмотреть файл

@ -1,12 +1,5 @@
if AMHAVEPYTHONSWIG
OTFLIB_PY = otflib_py
else
OTFLIB_PY =
endif
SUBDIRS = \
otflib \
$(OTFLIB_PY) \
tools \
docu

Просмотреть файл

@ -208,263 +208,3 @@ AC_DEFUN([WITH_VERBOSE],
fi
])
AC_DEFUN([SWIG_PYTHON],[
#
#enable python bindings
#
AC_ARG_ENABLE([python-bindings],
AC_HELP_STRING([--enable-python-bindings],
[force generation of Python bindings]),
[enable_python_bindings="yes"],
[enable_python_bindings=""])
#
#with python version
#
AC_ARG_WITH([python-version],
AC_HELP_STRING([--with-python-version=VERSION],
[force a custom python version]),
[PYTHON_VERSION=$withval])
#
#only check if the user did --enable-python-bindings
#
if test x"$enable_python_bindings" = xyes; then
#
#test for swig >= 1.3
#
AC_PROG_SWIG(1.3)
#
#test for python-dev
#
AC_PYTHON_DEVEL
test "x$1" != "xno" || swig_shadow=" -noproxy"
#
#set the swig options
#
AC_SUBST([SWIG_PYTHON_OPT],[-python])
#
#set the python compiler flags
#
AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
fi
])
AC_DEFUN([AC_PYTHON_DEVEL],[
#
# Allow the use of a (user set) custom python version
#
AC_ARG_VAR([PYTHON_VERSION],[The installed Python
version to use, for example '2.3'. This string
will be appended to the Python interpreter
canonical name.])
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
if test -z "$PYTHON"; then
AC_MSG_WARN([Cannot find python$PYTHON_VERSION in your system path])
PYTHON_VERSION=""
else
#
# Check for Python include path
#
AC_MSG_CHECKING([for python include path])
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc();" 2> /dev/null`
if test -n "${python_path}"; then
python_path="-I$python_path"
fi
PYTHON_CPPFLAGS=$python_path
fi
if test -n "$PYTHON_CPPFLAGS"; then
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
else
AC_MSG_RESULT([no])
fi
AC_SUBST([PYTHON_CPPFLAGS])
#
# Check for Python library path
#
AC_MSG_CHECKING([for python library path])
if test -z "$PYTHON_LDFLAGS"; then
# (makes two attempts to ensure we've got a version number
# from the interpreter)
py_version=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print join(get_config_vars('VERSION'))" 2> /dev/null`
if test "$py_version" = "[None]" -o -z "$py_version"; then
if test -n "$PYTHON_VERSION"; then
py_version=$PYTHON_VERSION
else
py_version=`$PYTHON -c "import sys; \
print sys.version[[:3]]"`
fi
fi
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print '-L' + get_python_lib(0,1), \
'-lpython';" 2> /dev/null`$py_version
fi
if test ! "$PYTHON_LDFLAGS" = "$py_version"; then
AC_MSG_RESULT([$PYTHON_LDFLAGS])
else
AC_MSG_RESULT([no])
fi
AC_SUBST([PYTHON_LDFLAGS])
#
# Check for site packages
#
AC_MSG_CHECKING([for python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_lib(0,0);" 2> /dev/null`
fi
if test -n "$PYTHON_SITE_PKG"; then
AC_MSG_RESULT([$PYTHON_SITE_PKG])
else
AC_MSG_RESULT([no])
fi
AC_SUBST([PYTHON_SITE_PKG])
#
# libraries which must be linked in when embedding
#
AC_MSG_CHECKING(python extra libraries)
if test -z "$PYTHON_EXTRA_LIBS"; then
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print conf('LOCALMODLIBS'), conf('LIBS')" 2> /dev/null`
fi
if test -n "$PYTHON_EXTRA_LIBS"; then
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(PYTHON_EXTRA_LIBS)
#
# linking flags needed when embedding
#
AC_MSG_CHECKING(python extra linking flags)
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print conf('LINKFORSHARED')" 2> /dev/null`
fi
if test -n "$PYTHON_EXTRA_LDFLAGS"; then
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
#
# final check to see if everything compiles alright
#
AC_MSG_CHECKING([consistency of all components of python development environment])
AC_LANG_PUSH([C])
# save current global flags
LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
AC_TRY_LINK([
#include <Python.h>
],[
Py_Initialize();
],[pythonexists=yes],[pythonexists=no])
AC_MSG_RESULT([$pythonexists])
if test ! "$pythonexists" = "yes"; then
AC_MSG_ERROR([Cannot find python development environment. You probably have to install the development version of the python package.])
PYTHON_VERSION=""
fi
AC_LANG_POP
# turn back to default flags
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
#get the paths where to install the package
AC_SUBST([pkgpythondir],
['${prefix}'/lib/python${py_version}/site-packages/otf])
AC_SUBST([pkgpyexecdir],
['${exec_prefix}'/lib/python${py_version}/site-packages/otf])
fi
])
AC_DEFUN([AC_PROG_SWIG],[
AC_PATH_PROG([SWIG],[swig])
if test -z "$SWIG" ; then
AC_MSG_ERROR([Cannot find 'swig' program.])
elif test -n "$1" ; then
AC_MSG_CHECKING([for swig version])
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
AC_MSG_RESULT([$swig_version])
if test -n "$swig_version" ; then
# Calculate the required version number components
[required=$1]
[required_major=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_major" ; then
[required_major=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
fi
# Calculate the available version number components
[available=$swig_version]
[available_major=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_major" ; then
[available_major=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_minor" ; then
[available_minor=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_patch" ; then
[available_patch=0]
fi
if test $available_major -ne $required_major \
-o $available_minor -ne $required_minor \
-o $available_patch -lt $required_patch ; then
AC_MSG_ERROR([swig version >= $1 is required. You have $swig_version.])
else
swigexists=yes
fi
else
AC_MSG_ERROR([Cannot determine swig version])
fi
fi
])

Просмотреть файл

@ -3,9 +3,9 @@
AC_PREREQ(2.57)
AC_INIT(OTF, 1.3.11, andreas.knuepfer@tu-dresden.de )
AC_INIT(OTF, 1.3.12, andreas.knuepfer@tu-dresden.de )
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(OTF, 1.3.11)
AM_INIT_AUTOMAKE(OTF, 1.3.12)
AC_CONFIG_SRCDIR([config.h.in])
AM_CONFIG_HEADER(config.h)
@ -35,10 +35,6 @@ if test x"$force_zlib" = "xyes" -a x"$zlib_error" = "xyes"; then exit 1; fi
AM_CONDITIONAL(AMHAVEZLIB, test x"$have_zlib" = xyes)
AM_CONDITIONAL(AMDEPZLIB, test x"$have_zlib" = xyes -a x"$enable_shared" = xyes)
# Checks for swig and python-dev.
SWIG_PYTHON
AM_CONDITIONAL(AMHAVEPYTHONSWIG, [test "$pythonexists" = yes -a "$swigexists" = yes] )
WITH_DEBUG
WITH_VERBOSE
@ -82,12 +78,12 @@ AC_SUBST([sizeof_long])
AC_CONFIG_FILES([Makefile
otflib/Makefile
otflib/OTF_inttypes_unix.h
otflib_py/Makefile
tools/Makefile
tools/otfaux/Makefile
tools/otfcompress/Makefile
tools/otfconfig/Makefile
tools/otfdump/Makefile
tools/otfinfo/Makefile
tools/otfmerge/Makefile
tools/otf2vtf/Makefile
tools/vtf2otf/Makefile

Просмотреть файл

@ -20,7 +20,7 @@
#define OTF_VERSION_MAYOR 1
#define OTF_VERSION_MINOR 3
#define OTF_VERSION_SUB 11
#define OTF_VERSION_SUB 12
#define OTF_VERSION_STRING "jellyfish"
/* version history:

Просмотреть файл

@ -1,4 +1,4 @@
TMP1 = otfaux otfconfig otfdump otfmerge
TMP1 = otfaux otfconfig otfdump otfinfo otfmerge
if AMHAVEVTF3
TMP2 = otf2vtf vtf2otf

Просмотреть файл

@ -0,0 +1,21 @@
INCLUDES = -I$(top_builddir)/otflib -I$(top_srcdir)/otflib
if AMBUILDBINARIES
bin_PROGRAMS = \
otfinfo
endif
otfinfo_LDADD = $(top_builddir)/otflib/libotf.la
if ! AMDEPZLIB
otfinfo_LDADD += $(ZLIB_LIB_LINE)
endif
otfinfo_SOURCES = \
handler.h \
hash.h \
otfinfo_error.h \
handler.c \
hash.c \
otfinfo.c \
otfinfo_error.c

Просмотреть файл

@ -0,0 +1,369 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#include "handler.h"
#include "otfinfo_error.h"
#include "otf.h"
#include <stdlib.h>
#include <string.h>
#define MAXINFOLEVEL 4
/* Level 1/4 handles */
int handleUnknownRecord( void *userData, uint64_t time, uint32_t process,
const char *record )
{
otfinfo_assert(0);
return OTF_RETURN_ABORT;
}
int handleDefCreator( void *userData, uint32_t stream, const char *creator )
{
((definitionInfoT*)userData)->creatorName = strdup(creator);
return OTF_RETURN_OK;
}
int handleDefVersion( void *userData, uint32_t stream, uint8_t major,
uint8_t minor, uint8_t sub, const char *string )
{
definitionInfoT *info = userData;
info->otfVersionMajor = major;
info->otfVersionMinor = minor;
info->otfVersionSub = sub;
info->otfVersionString = strdup(string);
return OTF_RETURN_OK;
}
int handleDefProcess( void *userData, uint32_t stream, uint32_t process,
const char *name, uint32_t parent )
{
/* in a low info level, increment the process counter */
if( MAXINFOLEVEL > ((definitionInfoT*)userData)->infoLevel )
{
((definitionInfoT*)userData)->counterProcessDefinition++;
}
else
{
/* in the max info level, get the process names */
int index=0;
definitionInfoT *info = (definitionInfoT*)userData;
while(info->processNames[index])
index++;
(info->processNames)[index] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleDefTimerResolution( void *userData, uint32_t stream,
uint64_t ticksPerSecond )
{
((definitionInfoT*)userData)->timerResolution = ticksPerSecond;
return OTF_RETURN_OK;
}
int handleDefinitionComment( void *userData, uint32_t stream,
const char *comment )
{
definitionInfoT *info = (definitionInfoT*)userData;
uint32_t index = (info->counterDefinitionComment)++;
(info->definitionComments) = (char**)realloc(info->definitionComments,(index + 1) * sizeof(char**));
(info->definitionComments)[index] = strdup(comment);
return OTF_RETURN_OK;
}
/* Level 2 handles */
int handleDefFunction( void *userData, uint32_t stream, uint32_t func,
const char *name, uint32_t funcGroup, uint32_t source )
{
/*in a low info level, increment the function counter*/
if( MAXINFOLEVEL > ((definitionInfoT*)userData)->infoLevel )
{
((definitionInfoT*)userData)->counterFunctionDefinition++;
}
else
{
/*in the max info level, get the function names*/
int index = 0;
definitionInfoT *info = (definitionInfoT*)userData;
while(info->functionNames[index])
index++;
(info->functionNames)[index] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleDefCounter( void *userData, uint32_t stream, uint32_t counter,
const char *name, uint32_t properties,
uint32_t counterGroup, const char *unit )
{
/*in a low info level, increment the counter counter*/
if( 3 > ((definitionInfoT*)userData)->infoLevel)
{
((definitionInfoT*)userData)->counterCounterDefinition++;
}
else
{
/*in the max info level, get the counter names*/
definitionInfoT *info = (definitionInfoT*)userData;
uint64_t i = 0;
while( ((info->counters)[i].name) && (i < info->counterCounterDefinition) )
i++;
(info->counters)[i].name = strdup(name);
(info->counters)[i].id = counter;
(info->counters)[i].properties = properties;
}
return OTF_RETURN_OK;
}
int handleDefProcessGroup( void *userData, uint32_t stream, uint32_t procGroup,
const char *name, uint32_t numberOfProcs, const uint32_t *procs )
{
/*in a low info level, increment the process group counter*/
if( MAXINFOLEVEL > ((definitionInfoT*)userData)->infoLevel )
{
((definitionInfoT*)userData)->counterProcessGroupDefinition++;
}
else
{
/*in the max info level, get the process group names*/
int index = 0;
definitionInfoT *info = (definitionInfoT*)userData;
while( info->processGroupNames[index] )
index++;
(info->processGroupNames)[index] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleDefFunctionGroup( void *userData, uint32_t stream,
uint32_t funcGroup, const char *name)
{
/*in a low info level, increment the function group counter*/
if( MAXINFOLEVEL > ((definitionInfoT*)userData)->infoLevel )
{
((definitionInfoT*)userData)->counterFunctionGroupDefinition++;
}
else
{
/*in the max info level, get the function group names*/
int index = 0;
definitionInfoT *info = (definitionInfoT*)userData;
while(info->functionGroupNames[index])
index++;
(info->functionGroupNames)[index] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleDefCounterGroup( void *userData, uint32_t stream,
uint32_t counterGroup, const char *name )
{
/*in a low info level, increment the counter group counter*/
if( MAXINFOLEVEL > ((definitionInfoT*)userData)->infoLevel )
{
((definitionInfoT*)userData)->counterCounterGroupDefinition++;
}
else
{
/*in the max info level, get the counter group names*/
int index = 0;
definitionInfoT *info = (definitionInfoT*)userData;
while(info->counterGroupNames[index])
index++;
(info->counterGroupNames)[index] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleDefSclFile( void *userData, uint32_t stream, uint32_t sourceFile,
const char *name)
{
definitionInfoT *info = (definitionInfoT*)userData;
uint32_t index = (info->counterSourceFileName)++;
(info->sourceFileNames) = (char**)realloc( info->sourceFileNames,(index + 1)
* sizeof(char**) );
(info->sourceFileNames)[index] = strdup(name);
return OTF_RETURN_OK;
}
/* Level 3 handles */
int handleEnter( void *userData, uint64_t time, uint32_t function,
uint32_t process, uint32_t source )
{
((definitionInfoT*)userData)->counterEnter++;
return OTF_RETURN_OK;
}
int handleLeave( void *userData, uint64_t time, uint32_t function,
uint32_t process, uint32_t source )
{
((definitionInfoT*)userData)->counterLeave++;
return OTF_RETURN_OK;
}
int handleSendMsg( void *userData, uint64_t time, uint32_t sender,
uint32_t receiver, uint32_t group, uint32_t type,
uint32_t length, uint32_t source )
{
((definitionInfoT*)userData)->counterSend++;
return OTF_RETURN_OK;
}
int handleRecvMsg( void *userData, uint64_t time, uint32_t recvProc,
uint32_t sendProc, uint32_t group, uint32_t type,
uint32_t length, uint32_t source )
{
((definitionInfoT*)userData)->counterReceive++;
return OTF_RETURN_OK;
}
int handleDefCollectiveOperation( void *userData, uint32_t stream,
uint32_t collOp, const char *name,
uint32_t type )
{
/*in a low info level, increment the collective counter*/
((definitionInfoT*)userData)->counterCollectiveOperation++;
if( MAXINFOLEVEL <= ((definitionInfoT*)userData)->infoLevel )
{
/*in the max info level, get the collective operation names*/
definitionInfoT *info = (definitionInfoT*)userData;
int index = ((definitionInfoT*)userData)->counterCollectiveOperation;
(info->collectiveOperationNames) = (char**)realloc(
info->collectiveOperationNames,
(index) * sizeof(char**) );
(info->collectiveOperationNames)[index-1] = strdup(name);
}
return OTF_RETURN_OK;
}
int handleFileOperation( void *userData, uint64_t time, uint32_t fileid,
uint32_t process, uint64_t handleid,
uint32_t operation, uint64_t bytes, uint64_t duration,
uint32_t source )
{
((definitionInfoT*)userData)->counterFileOperation++;
return OTF_RETURN_OK;
}
int handleEnterSnapshot( void *userData, uint64_t time, uint64_t originaltime,
uint32_t function, uint32_t process, uint32_t source )
{
((definitionInfoT*)userData)->counterSnapshot++;
return OTF_RETURN_OK;
}
int handleCounter( void* userData, uint64_t time, uint32_t process,
uint32_t counter, uint64_t value )
{
uint64_t i = 0;
double valueDif = 0.0;
double timeDif = 0.0;
double rate = 0.0;
mapInfoProcessT *currentElement = NULL;
definitionInfoT *info = (definitionInfoT*)userData;
while( (info->counters[i].id != counter) &&
(i < info->counterCounterDefinition) )
{
i++;
}
if( i >= info->counterCounterDefinition )
return OTF_RETURN_ABORT;
/*for the counter type*/
if( ((info->counters[i].properties) & OTF_COUNTER_TYPE_BITS)
== OTF_COUNTER_TYPE_ACC )
{
if( (info->counters)[i].processMap == NULL )
(info->counters)[i].processMap = hash_new();
/*calculate the current counter rate*/
currentElement = hash_search( info->counters[i].processMap, process );
if( !currentElement )
{
currentElement = hash_add( info->counters[i].processMap, process );
}
else
{
valueDif = value - currentElement->lastValue;
timeDif = time - currentElement->lastTime;
if( timeDif > 0 )
{
rate = (valueDif / timeDif) * (double)(info->timerResolution);
}
if( rate > currentElement->highestRate )
currentElement->highestRate = rate;
}
currentElement->lastValue = value;
currentElement->lastTime = time;
}
return OTF_RETURN_OK;
}
uint64_t process_get_sum_time( mapInfoProcessT *set )
{
uint64_t sumTime = 0;
uint32_t i;
mapInfoProcessT *currentElement = NULL;
for( i = 0; i < HASH_SIZE; i++ )
{
currentElement = &set[i];
while( currentElement )
{
if( (uint32_t)-1 != currentElement->process )
sumTime += currentElement->lastTime;
currentElement = currentElement->next;
}
}
return sumTime;
}
uint64_t process_get_sum_value( mapInfoProcessT *set )
{
uint64_t sumValue = 0;
uint32_t i;
mapInfoProcessT *currentElement = NULL;
for( i = 0; i < HASH_SIZE; i++ )
{
currentElement = &set[i];
while( currentElement )
{
if( (uint32_t)-1 != currentElement->process )
sumValue += currentElement->lastValue;
currentElement = currentElement->next;
}
}
return sumValue;
}
double process_get_highest_rate( mapInfoProcessT *set )
{
double highestRate = 0;
uint32_t i;
mapInfoProcessT *currentElement = NULL;
for( i = 0; i < HASH_SIZE; i++ )
{
currentElement = &set[i];
while( currentElement )
{
if( (uint32_t)-1 != currentElement->process )
{
if( highestRate < currentElement->highestRate )
highestRate = currentElement->highestRate;
}
currentElement = currentElement->next;
}
}
return highestRate;
}

Просмотреть файл

@ -0,0 +1,138 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#ifndef HANDLER_H
#define HANDLER_H
#include "hash.h"
#include "OTF_inttypes.h"
typedef struct counterS
{
char *name;
uint32_t id;
uint32_t properties;
mapInfoProcessT *processMap;
} counterT;
typedef struct definitionInfoS
{
char *filePrefix;
char *creatorName;
char **definitionComments;
char **sourceFileNames;
char **processNames;
char **processGroupNames;
char **functionNames;
char **functionGroupNames;
char **collectiveOperationNames;
counterT *counters;
char **counterGroupNames;
char *otfVersionString;
int infoLevel;
uint8_t otfVersionMajor;
uint8_t otfVersionMinor;
uint8_t otfVersionSub;
uint64_t traceFileSize;
uint64_t counterCollectiveOperation;
uint64_t counterDefinitionComment;
uint64_t counterSourceFileName;
uint64_t counterFunctionGroupDefinition;
uint64_t counterFunctionDefinition;
uint64_t counterProcessGroupDefinition;
uint64_t counterProcessDefinition;
uint64_t counterCounterDefinition;
uint64_t counterCounterGroupDefinition;
uint64_t counterLeave;
uint64_t counterEnter;
uint64_t counterSend;
uint64_t counterReceive;
uint64_t timerResolution;
uint64_t counterFileOperation;
uint64_t counterSnapshot;
} definitionInfoT;
/* Level 1/4 handles */
int handleUnknownRecord( void *userData, uint64_t time, uint32_t process,
const char *record );
int handleDefCreator( void *userData, uint32_t stream, const char *creator );
int handleDefVersion( void *userData, uint32_t stream, uint8_t major,
uint8_t minor, uint8_t sub, const char *string );
int handleDefProcess( void *userData, uint32_t stream, uint32_t process,
const char *name, uint32_t parent );
int handleDefTimerResolution( void *userData, uint32_t stream,
uint64_t ticksPerSecond );
int handleDefinitionComment( void *userData, uint32_t stream,
const char *comment );
/* Level 2 handles */
int handleDefFunction( void *userData, uint32_t stream, uint32_t func,
const char *name, uint32_t funcGroup, uint32_t source );
int handleDefCounter( void *userData, uint32_t stream, uint32_t counter,
const char *name, uint32_t properties,
uint32_t counterGroup, const char *unit );
int handleDefProcessGroup( void *userData, uint32_t stream, uint32_t procGroup,
const char *name, uint32_t numberOfProcs,
const uint32_t *procs );
int handleDefFunctionGroup( void *userData, uint32_t stream,
uint32_t funcGroup, const char *name );
int handleDefCounterGroup( void *userData, uint32_t stream,
uint32_t counterGroup, const char *name );
int handleDefSclFile( void *userData, uint32_t stream, uint32_t sourceFile,
const char *name );
/* Level 3 handles */
int handleEnter( void *userData, uint64_t time, uint32_t function,
uint32_t process, uint32_t source );
int handleLeave( void *userData, uint64_t time, uint32_t function,
uint32_t process, uint32_t source );
int handleSendMsg( void *userData, uint64_t time, uint32_t sender,
uint32_t receiver, uint32_t group, uint32_t type,
uint32_t length, uint32_t source );
int handleRecvMsg( void *userData, uint64_t time, uint32_t recvProc,
uint32_t sendProc, uint32_t group, uint32_t type,
uint32_t length, uint32_t source );
int handleDefCollectiveOperation( void *userData, uint32_t stream,
uint32_t collOp, const char *name,
uint32_t type );
int handleFileOperation( void *userData, uint64_t time, uint32_t fileid,
uint32_t process, uint64_t handleid,
uint32_t operation, uint64_t bytes, uint64_t duration,
uint32_t source );
int handleEnterSnapshot( void *userData, uint64_t time, uint64_t originaltime,
uint32_t function, uint32_t process,
uint32_t source );
int handleCounter( void* userData, uint64_t time, uint32_t process,
uint32_t counter, uint64_t value );
uint64_t process_get_sum_time( mapInfoProcessT *set );
uint64_t process_get_sum_value( mapInfoProcessT *set );
double process_get_highest_rate(mapInfoProcessT *set );
#endif /* HANDLER_H */

Просмотреть файл

@ -0,0 +1,96 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#include "hash.h"
#include <stdlib.h>
static mapInfoProcessT *add_inner( mapInfoProcessT **current, uint32_t process )
{
if( NULL != *current )
{
return add_inner( &((mapInfoProcessT*)(*current))->next, process );
}
else
{
*current = (mapInfoProcessT*)calloc( 1, sizeof(mapInfoProcessT) );
(*current)->process = process;
return *current;
}
return NULL;
}
static mapInfoProcessT *search_inner( mapInfoProcessT *current, uint32_t process )
{
if( current )
{
if( current->process == process )
return current;
return search_inner( current->next, process );
}
return NULL;
}
mapInfoProcessT *hash_new( )
{
mapInfoProcessT *ret;
ret = (mapInfoProcessT*)calloc( HASH_SIZE, sizeof(mapInfoProcessT) );
ret->process = (uint32_t)-1;
return ret;
}
mapInfoProcessT *hash_add( mapInfoProcessT *hash, uint32_t process)
{
uint32_t hashkey = process;
HASH_GET_KEY( hashkey );
if( hash[hashkey].process == (uint32_t)-1 )
{
hash[hashkey].process = process;
return &(hash[hashkey]);
}
else
{
return add_inner( &(hash[hashkey].next), process );
}
}
mapInfoProcessT *hash_search( mapInfoProcessT *hash, uint32_t process)
{
uint32_t hashkey = process;
HASH_GET_KEY( hashkey );
if( hash[hashkey].process == process )
{
return &(hash[hashkey]);
}
else
{
return search_inner( hash[hashkey].next, process );
}
return NULL;
}
void hash_delete( mapInfoProcessT *hash )
{
int i;
for( i = 0; i < HASH_SIZE; i++ )
{
mapInfoProcessT *currentElement = hash[i].next;
while( NULL != currentElement )
{
mapInfoProcessT *tmpElement = currentElement;
currentElement = currentElement->next;
free( tmpElement );
}
}
free( hash );
}

Просмотреть файл

@ -0,0 +1,45 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#ifndef HASH_H
#define HASH_H
#include "OTF_inttypes.h"
/* 0x1000 = 4096 */
#define HASH_SIZE 0X1000
#define HASH_GET_KEY(key) \
{ \
key += ~(key << 15); \
key ^= (key >> 10); \
key += (key << 3); \
key ^= (key >> 6); \
key += ~(key << 11); \
key ^= (key >> 16); \
key &= HASH_SIZE - 1; \
}
typedef struct mapInfoProcessS
{
uint32_t process;
uint64_t lastValue;
uint64_t lastTime;
double highestRate;
struct mapInfoProcessS *next;
} mapInfoProcessT;
/* initialize the hash */
mapInfoProcessT* hash_new( void );
/* add an entry to the hash */
mapInfoProcessT* hash_add( mapInfoProcessT *hash, uint32_t process );
/* search an entry in the hash */
mapInfoProcessT* hash_search( mapInfoProcessT *hash, uint32_t process );
/* free all mem of the hash */
void hash_delete( mapInfoProcessT *hash );
#endif /* HASH_H */

Просмотреть файл

@ -0,0 +1,800 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#include "handler.h"
#include "otfinfo_error.h"
#include "otf.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PROGRESSBARLEN 20
static void set_handles_level_1( OTF_HandlerArray *handles,
definitionInfoT *info );
static void set_handles_level_2( OTF_HandlerArray *handles,
definitionInfoT *info );
static void set_handles_level_3( OTF_HandlerArray *handles,
definitionInfoT *info );
static void set_handles_level_4( OTF_HandlerArray *handles,
definitionInfoT *info );
static void show_info_level_1( definitionInfoT info );
static void show_info_level_2( definitionInfoT info );
static void show_info_level_3( definitionInfoT info );
static void show_info_level_4( definitionInfoT info );
static void free_data_level_1( definitionInfoT info );
static void free_data_level_2( definitionInfoT info );
static void free_data_level_3( definitionInfoT info );
static void free_data_level_4( definitionInfoT info );
int main(int argc, char **argv)
{
definitionInfoT info; /*structur where the trace information are stored*/
int i = 0;
uint32_t numFileHandles = 1; /*number of filehandles */
uint64_t checkVal = 0; /*value used for asserts*/
uint64_t size = 0; /*size of the event files*/
uint64_t minRead = 0; /*variable for progress*/
uint64_t currRead = 0; /*count of current read bytes*/
char* parameter = NULL; /*reference to the parameters*/
char* fileLocation = NULL; /*path to the tracefiles*/
OTF_FileManager *manager = NULL;
OTF_Reader *reader = NULL;
OTF_HandlerArray *handles = NULL;
int showProgress = 0;
int infoLevel = 1; /*level for the output of information (local)*/
static const char* Helptext[] = {
" \n",
" otfinfo - program to get basic information of a trace. \n",
" \n",
" otfinfo [Options] <input file name> \n",
" \n",
" options: \n",
" -h, --help show this help message \n",
" -V show OTF version \n",
" -f <n> set max number of filehandles available \n",
" -l <ilevel> set the information level for the output \n",
" (0 - 4) the default level is 1 \n",
" -a set the information level to 4 \n",
" -p show progress bar for reading event files \n",
" \n",
" \n", NULL };
info.infoLevel = 1; /*level of information for the handles*/
/*if no parameter was given printing the helptext*/
if( 1 >= argc )
{
int l = 0;
while( Helptext[l] )
{
printf( "%s",Helptext[l++] );
}
return 0;
}
/*checking for additional parameters*/
for( i = 1 ; i < argc; i++ )
{
parameter = argv[i];
if( (strcmp(parameter,"-f") == 0) && (i+1 < argc) )
{
i++;
numFileHandles = atoi(argv[i]);
}
else if( (strcmp(parameter,"-l") == 0) && (i+1 < argc) )
{
i++;
infoLevel = atoi(argv[i]);
}
else if( strcmp(parameter,"-a") == 0 )
{
infoLevel = 4;
}
else if( strcmp(parameter,"-p") == 0 )
{
showProgress = 1;
}
else if( strcmp(parameter,"-V") == 0 )
{
printf( "%u.%u.%u \"%s\"\n", OTF_VERSION_MAYOR, OTF_VERSION_MINOR,
OTF_VERSION_SUB, OTF_VERSION_STRING );
return 0;
}
else if( (strcmp(parameter,"-h") == 0) ||
(strcmp(parameter,"--help") == 0) )
{
int l=0;
while(Helptext[l])
{
printf( "%s",Helptext[l++] );
}
return 0;
}
else if( '-' != parameter[0] )
{
char* p;
fileLocation = parameter;
p = strrchr( parameter, '.' );
if( p && strlen(p) >= 4 && strcmp(p, ".otf") == 0 )
*p = '\0';
}
else
{
fprintf(stderr,"ERROR: Unknown option: '%s'\n",argv[i]);
exit(1);
}
}
if( numFileHandles < 1 )
{
fprintf( stderr, "ERROR: less than 1 filehandle is not permitted\n" );
exit(1);
}
if( NULL == fileLocation )
{
fprintf( stderr, "ERROR: no trace file was specified\n" );
exit(1);
}
info.filePrefix = OTF_getFilename( fileLocation, 0, OTF_FILETYPE_MASTER,
0, NULL );
/*preparing the reader*/
manager = OTF_FileManager_open( numFileHandles );
otfinfo_assert( manager );
reader = OTF_Reader_open( fileLocation, manager );
otfinfo_assert( reader );
handles = OTF_HandlerArray_open();
otfinfo_assert( handles );
if( 0 < infoLevel )
{
info.infoLevel = 1;
set_handles_level_1( handles, &info );
if( 1 < infoLevel )
{
info.infoLevel = 2;
set_handles_level_2( handles,&info );
}
}
/*read definition file*/
checkVal = OTF_Reader_readDefinitions( reader, handles );
otfinfo_assert( checkVal != OTF_READ_ERROR );
/*getting the size of the event files*/
OTF_Reader_setRecordLimit( reader, 0 );
checkVal = OTF_Reader_readEvents( reader, handles );
otfinfo_assert(checkVal != OTF_READ_ERROR);
checkVal = OTF_Reader_eventBytesProgress( reader, &minRead,
&currRead, &size);
otfinfo_assert( checkVal != OTF_READ_ERROR );
info.traceFileSize = size;
/*printing the results and cleanup*/
if( 0 < infoLevel )
{
show_info_level_1( info );
free_data_level_1( info );
if( 1 < infoLevel )
{
show_info_level_2( info );
free_data_level_2( info );
}
}
checkVal = OTF_HandlerArray_close( handles );
otfinfo_assert( checkVal );
checkVal = OTF_Reader_close( reader );
otfinfo_assert( checkVal );
OTF_FileManager_close( manager );
/*if the info level is higher than two, we have to read again the files*/
if( 2 < infoLevel )
{
/*prepare for reading*/
manager = OTF_FileManager_open( numFileHandles );
otfinfo_assert( manager );
reader = OTF_Reader_open( fileLocation, manager );
otfinfo_assert( reader );
handles = OTF_HandlerArray_open();
otfinfo_assert( handles );
info.infoLevel = 3;
set_handles_level_3( handles, &info );
if( 3 < infoLevel )
{
info.infoLevel = 4;
set_handles_level_4( handles, &info );
}
/*read definitions*/
checkVal = OTF_Reader_readDefinitions( reader, handles );
otfinfo_assert( checkVal != OTF_READ_ERROR );
if( 1 == showProgress )
{
/*printing a kind of progress bar*/
OTF_Reader_setRecordLimit( reader, 10000 );
size = 1;
currRead = 0;
printf( "\n\n" );
printf( "reading events:\n" );
for( i = 0; i < PROGRESSBARLEN + 3; i++ )
printf( " " );
printf( "|100%%\r" );
printf( "0%%|" ); fflush( stdout );
i = 0;
while( (checkVal = OTF_Reader_readEvents( reader, handles )) == 10000 )
{
int current;
otfinfo_assert( checkVal != OTF_READ_ERROR )
OTF_Reader_eventBytesProgress( reader, &minRead, &currRead, &size );
current = ( PROGRESSBARLEN * currRead ) / size;
for( ; i < current; i++ )
printf( "#" ); fflush( stdout );
}
otfinfo_assert( checkVal != OTF_READ_ERROR )
for( ; i < PROGRESSBARLEN; i++ )
printf( "#" );
printf( "\n\n" );
}
else
{
checkVal = OTF_Reader_readEvents( reader, handles );
otfinfo_assert( checkVal != OTF_READ_ERROR );
}
/*printing the results and cleanup*/
show_info_level_3( info );
free_data_level_3( info );
if( 3 < infoLevel )
{
show_info_level_4( info );
free_data_level_4( info );
}
checkVal = OTF_HandlerArray_close( handles );
otfinfo_assert( checkVal );
checkVal = OTF_Reader_close( reader );
otfinfo_assert( checkVal );
OTF_FileManager_close( manager );
}
free( info.filePrefix );
return 0;
}
static void set_handles_level_1( OTF_HandlerArray *handles,
definitionInfoT *info )
{
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleUnknownRecord,
OTF_UNKNOWN_RECORD );
/*handler and inits for getting the creator name*/
info->creatorName = NULL;
OTF_HandlerArray_setHandler( handles, (OTF_FunctionPointer*)handleDefCreator,
OTF_DEFCREATOR_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCREATOR_RECORD );
/*handler and inits for getting the otf version*/
info->otfVersionString = NULL;
info->otfVersionMajor = 0;
info->otfVersionMinor = 0;
info->otfVersionSub = 0;
OTF_HandlerArray_setHandler( handles, (OTF_FunctionPointer*)handleDefVersion,
OTF_DEFVERSION_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFVERSION_RECORD );
/*handler and inits for getting the count of process definitions*/
info->counterProcessDefinition = 0;
OTF_HandlerArray_setHandler( handles, (OTF_FunctionPointer*)handleDefProcess,
OTF_DEFPROCESS_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFPROCESS_RECORD );
/*handler and inits for getting the timer resolution*/
info->timerResolution = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefTimerResolution,
OTF_DEFTIMERRESOLUTION_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFTIMERRESOLUTION_RECORD );
/*handler and inits for getting comments*/
info->definitionComments = NULL;
info->counterDefinitionComment = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefinitionComment,
OTF_DEFINITIONCOMMENT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFINITIONCOMMENT_RECORD );
}
static void show_info_level_1( definitionInfoT info )
{
uint32_t i = 0, index = 0;
double resolution = info.timerResolution;
double fileSize = info.traceFileSize;
char* unitTimer;
char* unitFileSize;
/*formating the timerresolution*/
while( (resolution / 1000 >= 1.0) && (i < 4) )
{
resolution /= 1000;
i++;
}
switch( i )
{
case 0: unitTimer = "s";break;
case 1: unitTimer = "ms";break;
case 2: unitTimer = "µs";break;
default: unitTimer = "ns";break;
}
/*formating the size of the event files*/
i = 0;
while( (fileSize / 1024 >= 1.0) && (i < 4) )
{
fileSize /= 1024;
i++;
}
switch( i )
{
case 0: unitFileSize = "Bytes"; break;
case 1: unitFileSize = "KB"; break;
case 2: unitFileSize = "MB"; break;
default: unitFileSize = "TB";break;
}
printf( "\n##############" );
printf( "\n#info level 1#" );
printf( "\n##############\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| general information \n" );
printf( "+----------------------+--------------------------------------------------------\n" );
printf( "| tracefile name | %s\n", info.filePrefix );
printf( "| creator of the trace | %s\n", info.creatorName );
printf( "| used OTF version | %i.%i.%i %s\n", info.otfVersionMajor,
info.otfVersionMinor, info.otfVersionSub, info.otfVersionString );
printf( "| event files size | %.2f %s\n", fileSize,unitFileSize );
printf( "| process definitions | %llu\n",
(unsigned long long)info.counterProcessDefinition );
printf( "| timer resolution | %.2f %s\n",resolution,unitTimer );
printf( "+----------------------+--------------------------------------------------------\n" );
index = info.counterDefinitionComment;
printf( "| definition comments\n" );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < index; i++ )
{
printf( "| %s\n", info.definitionComments[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
}
static void free_data_level_1( definitionInfoT info )
{
uint32_t i, index;
free( info.creatorName );
index = info.counterDefinitionComment;
for( i = 0; i < index; i++ )
{
free( info.definitionComments[i] );
}
free( info.definitionComments );
free( info.otfVersionString );
}
static void set_handles_level_2( OTF_HandlerArray *handles, definitionInfoT *info )
{
/*handler and inits for getting the count of function definitions*/
info->counterFunctionDefinition = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefFunction,
OTF_DEFFUNCTION_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFFUNCTION_RECORD );
/*handler and inits for getting the count of counter definitions*/
info->counterCounterDefinition = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefCounter,
OTF_DEFCOUNTER_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTER_RECORD );
/*handler and inits for getting the count of process group definitions*/
info->counterProcessGroupDefinition = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefProcessGroup,
OTF_DEFPROCESSGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFPROCESSGROUP_RECORD );
/*handler and inits for getting the count of function group definitions*/
info->counterFunctionGroupDefinition = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefFunctionGroup,
OTF_DEFFUNCTIONGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFFUNCTIONGROUP_RECORD );
/*handler and inits for getting the count of counter group definitions*/
info->counterCounterGroupDefinition = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefCounterGroup,
OTF_DEFCOUNTERGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTERGROUP_RECORD );
/*handler and inits for getting the source files*/
info->sourceFileNames = NULL;
info->counterSourceFileName = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefSclFile,
OTF_DEFSCLFILE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFSCLFILE_RECORD );
}
static void show_info_level_2( definitionInfoT info )
{
int index,i;
printf( "\n##############" );
printf( "\n#info level 2#" );
printf( "\n##############\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| trace content\n" );
printf( "+----------------------------+--------------------------------------------------\n" );
printf( "| function definitions | %llu\n",
(unsigned long long)info.counterFunctionDefinition );
printf( "| counter definitions | %llu\n",
(unsigned long long)info.counterCounterDefinition );
printf( "| |\n" );
printf( "| process group definitions | %llu\n",
(unsigned long long)info.counterProcessGroupDefinition );
printf( "| function group definitions | %llu\n",
(unsigned long long)info.counterFunctionGroupDefinition );
printf( "| counter group definitions | %llu\n",
(unsigned long long)info.counterCounterGroupDefinition );
printf( "+----------------------------+--------------------------------------------------\n" );
index = info.counterSourceFileName;
printf( "| source file names\n" );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < index; i++)
{
printf( "| %s\n", info.sourceFileNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
}
static void free_data_level_2( definitionInfoT info )
{
int i, index;
index = info.counterSourceFileName;
for( i = 0; i < index; i++ )
{
free( (info.sourceFileNames)[i] );
}
free( info.sourceFileNames );
}
static void set_handles_level_3( OTF_HandlerArray *handles,
definitionInfoT *info )
{
uint64_t i = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleUnknownRecord,
OTF_UNKNOWN_RECORD );
/*handler and inits for getting the count of enters*/
info->counterEnter = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleEnter,
OTF_ENTER_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_ENTER_RECORD );
/*handler and inits for getting the count of leaves*/
info->counterLeave = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleLeave,
OTF_LEAVE_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_LEAVE_RECORD );
/*handler and inits for getting the count of sends*/
info->counterSend = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleSendMsg,
OTF_SEND_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_SEND_RECORD );
/*handler and inits for getting the count of receives*/
info->counterReceive = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleRecvMsg,
OTF_RECEIVE_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_RECEIVE_RECORD );
/*handler and inits for getting the count of collective operations*/
info->counterCollectiveOperation = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefCollectiveOperation,
OTF_DEFCOLLOP_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOLLOP_RECORD );
/*handler and inits for getting the count of file operations*/
info->counterFileOperation = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleFileOperation,
OTF_FILEOPERATION_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_FILEOPERATION_RECORD );
/*handler and inits for getting the count of snapshots*/
info->counterSnapshot = 0;
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleEnterSnapshot,
OTF_ENTERSNAPSHOT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_ENTERSNAPSHOT_RECORD );
(info->counters) = (counterT*)malloc( info->counterCounterDefinition *
sizeof(counterT) );
for( i = 0; i < info->counterCounterDefinition; i++ )
{
(info->counters)[i].name = NULL;
(info->counters)[i].id = 0;
(info->counters)[i].properties = 3;
(info->counters)[i].processMap = NULL;
}
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefCounter,
OTF_DEFCOUNTER_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTER_RECORD );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleCounter,
OTF_COUNTER_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_COUNTER_RECORD );
}
static void show_info_level_3( definitionInfoT info )
{
uint64_t i;
printf( "\n##############" );
printf( "\n#info level 3#" );
printf( "\n##############\n" );
printf( "+-----------------------+-------------------------------------------------------\n" );
printf( "| enters | %llu\n",
(unsigned long long)info.counterEnter );
printf( "| leaves | %llu\n",
(unsigned long long)info.counterLeave );
printf( "| sends | %llu\n",
(unsigned long long)info.counterSend );
printf( "| receives | %llu\n",
(unsigned long long)info.counterReceive );
printf( "| collective operations | %llu\n",
(unsigned long long)info.counterCollectiveOperation );
printf( "| file operations | %llu\n",
(unsigned long long)info.counterFileOperation );
printf( "| snapshots | %llu\n",
(unsigned long long)info.counterSnapshot );
printf( "+-----------------------+-------------------------------------------------------\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| counters[%llu]\n",
(unsigned long long)info.counterCounterDefinition );
printf( "+---------------+---------------------------------------------------------------\n" );
for( i = 0; i < info.counterCounterDefinition; i++ )
{
printf( "| name | %s\n", info.counters[i].name );
if( ((info.counters[i].properties) & OTF_COUNTER_TYPE_BITS) ==
OTF_COUNTER_TYPE_ACC )
{
uint64_t lastValue =
process_get_sum_value( info.counters[i].processMap );
uint64_t lastTime =
process_get_sum_time( info.counters[i].processMap );
double average =
((double)(lastValue)) * ((double)(info.timerResolution)) /
((double)(lastTime));
double highestRate =
process_get_highest_rate(info.counters[i].processMap);
printf( "| last value | %llu\n", (unsigned long long)lastValue );
printf( "| average rate | %7.4E per sec\n", average );
printf( "| highest rate | %7.4E per sec\n", highestRate );
}
printf( "| |\n" );
}
printf( "+---------------+---------------------------------------------------------------\n" );
printf( "\n" );
}
static void free_data_level_3( definitionInfoT info )
{
uint64_t i;
for( i = 0; i < info.counterCounterDefinition; i++ )
{
free( (info.counters)[i].name );
if( NULL != (info.counters)[i].processMap )
hash_delete( (info.counters)[i].processMap );
}
free( info.counters );
}
static void set_handles_level_4( OTF_HandlerArray *handles,
definitionInfoT *info )
{
/*handler and inits for getting the names of processes*/
info->processNames = NULL;
info->processNames = (char**)calloc( info->counterProcessDefinition,
sizeof(char*) );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefProcess,
OTF_DEFPROCESS_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFPROCESS_RECORD );
/*handler and inits for getting the names of functions*/
info->functionNames = NULL;
info->functionNames = (char**)calloc( info->counterFunctionDefinition,
sizeof(char*) );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefFunction,
OTF_DEFFUNCTION_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFFUNCTION_RECORD );
/*handler and inits for getting the names of processe groups*/
info->processGroupNames = NULL;
info->processGroupNames = (char**)calloc( info->counterProcessGroupDefinition,
sizeof(char*) );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefProcessGroup,
OTF_DEFPROCESSGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFPROCESSGROUP_RECORD );
info->collectiveOperationNames = NULL;
/*handler and inits for getting the names of function groups*/
info->functionGroupNames = NULL;
info->functionGroupNames = (char**)calloc( info->counterFunctionGroupDefinition,
sizeof(char*) );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefFunctionGroup,
OTF_DEFFUNCTIONGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFFUNCTIONGROUP_RECORD );
/*handler and inits for getting the names of counter groupss*/
info->counterGroupNames = NULL;
info->counterGroupNames = (char**)calloc( info->counterCounterGroupDefinition,
sizeof(char*) );
OTF_HandlerArray_setHandler( handles,
(OTF_FunctionPointer*)handleDefCounterGroup,
OTF_DEFCOUNTERGROUP_RECORD);
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTERGROUP_RECORD );
}
static void show_info_level_4( definitionInfoT info )
{
uint64_t i;
printf( "\n##############" );
printf( "\n#info level 4#" );
printf( "\n##############\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| process definitions[%llu]\n",
(unsigned long long)info.counterProcessDefinition );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterProcessDefinition; i++ )
{
printf( "| %s\n", info.processNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| function definitions[%llu]\n",
(unsigned long long)info.counterFunctionDefinition );
printf( "+-------------------------------------------------------------------------------\n" );
for(i = 0; i < info.counterFunctionDefinition; i++ )
{
printf( "| %s\n",info.functionNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| collective operation definitions[%llu]\n",
(unsigned long long)info.counterCollectiveOperation );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterCollectiveOperation; i++ )
{
printf( "| %s\n", info.collectiveOperationNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| process group definitions[%llu]\n",
(unsigned long long)info.counterProcessGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterProcessGroupDefinition; i++ )
{
printf( "| %s\n", info.processGroupNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| function group definitions[%llu]\n",
(unsigned long long)info.counterFunctionGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterFunctionGroupDefinition; i++ )
{
printf( "| %s\n", info.functionGroupNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" );
printf( "| counter group definitions[%llu]\n",
(unsigned long long)info.counterCounterGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterCounterGroupDefinition; i++ )
{
printf( "| %s\n", info.counterGroupNames[i] );
}
printf( "+-------------------------------------------------------------------------------\n" );
}
static void free_data_level_4( definitionInfoT info )
{
uint64_t i;
if( info.processNames != NULL )
{
for( i = 0; i < info.counterProcessDefinition; i++ )
{
free( (info.processNames)[i] );
}
free( info.processNames );
}
if( info.processGroupNames != NULL )
{
for( i = 0; i < info.counterProcessGroupDefinition; i++ )
{
free( (info.processGroupNames)[i] );
}
free( info.processGroupNames );
}
if( info.functionNames != NULL )
{
for( i = 0; i < info.counterFunctionDefinition; i++ )
{
free( (info.functionNames)[i] );
}
free( info.functionNames );
}
if( info.functionGroupNames != NULL )
{
for( i = 0; i < info.counterFunctionGroupDefinition; i++ )
{
free( (info.functionGroupNames)[i] );
}
free( info.functionGroupNames );
}
for(i = 0; i < info.counterCollectiveOperation; i++ )
{
free( (info.collectiveOperationNames)[i] );
}
free( info.collectiveOperationNames );
for(i = 0; i < info.counterCounterGroupDefinition; i++ )
{
free( (info.counterGroupNames)[i] );
}
free( info.counterGroupNames );
}

Просмотреть файл

@ -0,0 +1,15 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#include "otfinfo_error.h"
#include <stdio.h>
#include <stdlib.h>
void otfinfo_assert_impl(const char* file, int line, const char* expr)
{
fprintf(stderr, "FATAL: %s:%d: Assertion `%s' failed\n",file, line, expr);
exit(1);
}

Просмотреть файл

@ -0,0 +1,12 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2009.
Authors: Michael Heyde
*/
#ifndef OTFINFO_ERROR_H
#define OTFINFO_ERROR_H
#define otfinfo_assert(expr) if(!(expr)) otfinfo_assert_impl(__FILE__, __LINE__, #expr);
void otfinfo_assert_impl(const char* f, int l, const char* expr);
#endif /* OTFINFO_ERROR_H */