1
1
This commit was SVN r26743.
Этот коммит содержится в:
Matthias Jurenz 2012-07-04 12:46:53 +00:00
родитель 552f17fe82
Коммит a579b74ebc
257 изменённых файлов: 25066 добавлений и 9764 удалений

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

@ -7,6 +7,7 @@ Andreas Knuepfer
Ronny Brendel
Matthias Lieber
Jens Doleschal
Thomas Ilsche
Joachim Protze
Holger Mickler
Michael Heyde

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

@ -1,5 +1,59 @@
5.12.2openmpi
- updated version of internal OTF to 1.10.2openmpi
5.13openmpi
- updated version of internal OTF to 1.11.1openmpi
(see extlib/otf/ChangeLog)
- added support for highly parallel trace writing using the
I/O Forwarding Scalability Layer (IOFSL) with atomic append
aggregation
- added support for generating snapshots which allows Vampir to load
subsets of the resulting trace
- introduced new vtfort compiler wrapper for compiling *any* Fortran
code (Fortran 77, 90, 2003, etc.)
(vtf77 and vtf90 still exist, but they are symlinks to vtfort)
- added support for automatic instrumentation with Cray CCE compiler
- improved compiler instrumentation support for IBM XLC/XLF compilers
version 11/13
- introduced environment variable VT_GPUTRACE, which replaces several
CUDA tracing environment variables
- expose flush of CUPTI activities as measurement overhead
- added CUDA runtime API functions to CUDA runtime API wrapper, which
are new in CUDA 4.2 and 5.0.7 (preview release)
- extended function filter capabilities by
- recursive filtering (disables recording callees of
filtered function)
- function group filtering
- stack level filtering
- vtunify[-mpi]:
- removed strict order of command line parameters
- added compatibility check for input trace file generated
by a different VampirTrace version
- drop/adapt records which have references to processes
disabled by the process filter
- count message matching irregularities
(i.e. number of unmatched and reversed messages)
- fixed a Heisenbug in conversion of local to global timestamps
(occurred when using the Intel compiler with O2 or higher
optimization)
- compiler wrappers:
- added option '-vt:reusefiles' to reuse kept intermediate
files generated by a previous run of OPARI and/or PDT/TAU
- added option '-vt:keepfiles' as synonym for '-vt:nocleanup'
- vtnvcc: fixed forwarding of compiler/linker options
- fixed handling of 'errno' in LIBC[-I/O] wrappers on AIX
- fixed handling of MPI_Aint in MPI-2 Fortran wrappers
(MPI_Aint=INTEGER(KIND=MPI_ADDRESS_KIND))
- do not abort if the application requests the MPI thread support level
MPI_THREAD_SERIALIZED (no MPI communication events will be recorded)
- fixed GPU compute idle time measurement with CUPTI activity tracing
- fixed installation issue when prefix is set to the source directory
(e.g. ./configure --prefix=$PWD)
- fixed handling of unidirectional collective operations (e.g. broad-
cast, gather, scatter) using intercommunicators
- fixed hanging mutatee when using binary instrumentation from an
Intel-built VampirTrace installation
- OPARI: (see tools/opari/ChangeLog:23)
5.12.2
- updated version of internal OTF to 1.10.2coelacanth
(see extlib/otf/ChangeLog)
- added support for CUDA tracing via CUPTI callbacks and activities
(runtime and driver API, kernels, memory copies and GPU memory usage)
@ -47,7 +101,7 @@
MPI/CUDA mixed programs
- OPARI: (see tools/opari/ChangeLog:22)
5.12.1openmpi
5.12.1
- updated version of internal OTF to 1.10.1coelacanth
(see extlib/otf/ChangeLog)
- fixed detection of Open64 compilers for automatic instrumentation

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

@ -56,7 +56,8 @@ How to install and configure VampirTrace
--enable-compinst=LIST
enable support for compiler instrumentation,
(gnu,intel,pathscale,pgi,sun,xl,ftrace,openuh)
(gnu,intel,pathscale,pgi,pgi9,craycce,xl,necsx,
open64,openuh)
A VampirTrace installation can handle different
compilers. The first item in the list is the
run-time default.
@ -65,7 +66,7 @@ How to install and configure VampirTrace
--enable-dyninst
enable support for Dyninst instrumentation,
default: enable if found by configure
Note: Requires Dyninst version 5.1 or higher!
Note: Requires Dyninst version 6.1 or higher!
--enable-dyninst-attlib
build shared library which attaches Dyninst to
@ -331,7 +332,7 @@ How to install and configure VampirTrace
vtfilter are built for the back-end (host system). Some configure options which are
of interest for cross compilation are shown below:
* Set CC, CXX, F77, and FC to the cross compilers installed on the front-end.
* Set CC, CXX, and FC to the cross compilers installed on the front-end.
* Set CC_FOR_BUILD and CXX_FOR_BUILD to the native compilers of the front-end.

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

@ -7,10 +7,14 @@ SUBDIRS = \
vtlib \
tools \
include \
doc \
etc
doc
vtdata_DATA = \
$(top_builddir)/config.log
vtdata_SCRIPTS = \
$(top_builddir)/libtool
vtdata_SCRIPTS = $(top_builddir)/libtool
vtdatadir = $(datadir)
EXTRA_DIST = \

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

@ -1 +1 @@
5.12.2openmpi
5.13openmpi

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

@ -14,10 +14,12 @@ m4_include(config/m4/acinclude.dl.m4)
m4_include(config/m4/acinclude.dyninst.m4)
m4_include(config/m4/acinclude.etimesync.m4)
m4_include(config/m4/acinclude.getcpu.m4)
m4_include(config/m4/acinclude.iofsl.m4)
m4_include(config/m4/acinclude.iowrap.m4)
m4_include(config/m4/acinclude.java.m4)
m4_include(config/m4/acinclude.jvmti.m4)
m4_include(config/m4/acinclude.libcwrap.m4)
m4_include(config/m4/acinclude.liberty.m4)
m4_include(config/m4/acinclude.libwrap.m4)
m4_include(config/m4/acinclude.ltmpdir.m4)
m4_include(config/m4/acinclude.math.m4)

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

@ -1,6 +1,5 @@
CC="blrts_xlc"
CXX="blrts_xlC"
F77="blrts_xlf90"
FC="blrts_xlf90"
MPICC="mpixlc"
MPICXX="mpixlcxx"

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

@ -1,6 +1,5 @@
CC="bgxlc_r"
CXX="bgxlC_r"
F77="bgxlf_r"
FC="bgxlf95_r"
MPICC="mpixlc_r"
MPICXX="mpixlcxx_r"
@ -14,5 +13,5 @@ enable_shared="no"
enable_cpuidtrace="no"
with_cross_prefix="bg"
with_mpibgp="yes"
with_cxxrtlib="-L/opt/ibmcmp/lib/bg/bglib -L/opt/ibmcmp/lib/bg/9.0/bglib -libmc++ -lstdc++"
with_cxxrtlib="-L/opt/ibmcmp/lib/bg/bglib -L/opt/ibmcmp/vacpp/bg/9.0/bglib -libmc++ -lstdc++"
with_shlibc=/lib/libc.so.6

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

@ -1,15 +1,12 @@
CC="cc"
CXX="CC"
F77="ftn"
FC="ftn"
CFLAGS="-O3"
CXXFLAGS="-O3"
FFLAGS="-O3"
FCFLAGS="-O3"
if test x"$XTPE_COMPILE_TARGET" != x; then
CFLAGS="$CFLAGS -target=$XTPE_COMPILE_TARGET"
CXXFLAGS="$CXXFLAGS -target=$XTPE_COMPILE_TARGET"
FFLAGS="$FFLAGS -target=$XTPE_COMPILE_TARGET"
FCFLAGS="$FCFLAGS -target=$XTPE_COMPILE_TARGET"
fi
CC_FOR_BUILD="gcc"

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

@ -1,15 +1,12 @@
CC="cc"
CXX="CC"
F77="ftn"
FC="ftn"
CFLAGS="-O3"
CXXFLAGS="-O3"
FFLAGS="-O3"
FCFLAGS="-O3"
if test x"$XTPE_COMPILE_TARGET" != x; then
CFLAGS="$CFLAGS -target=$XTPE_COMPILE_TARGET"
CXXFLAGS="$CXXFLAGS -target=$XTPE_COMPILE_TARGET"
FFLAGS="$FFLAGS -target=$XTPE_COMPILE_TARGET"
FCFLAGS="$FCFLAGS -target=$XTPE_COMPILE_TARGET"
fi
enable_shared="no"

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

@ -1,11 +1,9 @@
CC="xlc_r"
CXX="xlC_r"
F77="xlf_r"
FC="xlf90_r"
CFLAGS="-O2 -qsuppress=1500-030"
CXXFLAGS="-O2 -qstaticinline -qrtti -qsuppress=1500-029:1500-030"
FFLAGS="-O2 -qsuppress=cmpmsg"
FCFLAGS="-O2"
FCFLAGS="-O2 -qsuppress=cmpmsg"
OPENMP_CFLAGS="-qsmp=omp"
PTHREAD_CFLAGS="-D_THREAD_SAFE"
PTHREAD_LIBS="-lpthreads"

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

@ -2,12 +2,10 @@ AR="ar -X64"
NM="nm -B -X64"
CC="xlc_r"
CXX="xlC_r"
F77="xlf_r"
FC="xlf90_r"
CFLAGS="-q64 -O2 -qsuppress=1500-030"
CXXFLAGS="-q64 -O2 -qstaticinline -qrtti -qsuppress=1500-029:1500-030:1501-201"
FFLAGS="-q64 -O2 -qsuppress=cmpmsg"
FCFLAGS="-q64 -O2"
FCFLAGS="-q64 -O2 -qsuppress=cmpmsg"
OPENMP_CFLAGS="-qsmp=omp"
PTHREAD_CFLAGS="-D_THREAD_SAFE"
PTHREAD_LIBS="-lpthreads"

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

@ -1,18 +1,16 @@
AR="sxar"
CC="sxcc"
CXX="sxc++"
F77="sxf90"
FC="sxf90"
CCAS="sxas"
MPICC="sxmpicc"
MPICXX="sxmpic++"
MPIF77="sxmpif90"
MPIFC="sxmpif90"
CC_FOR_BUILD="cc"
CXX_FOR_BUILD="c++"
RANLIB="echo"
CFLAGS="-Csopt"
CXXFLAGS="-Csopt"
FFLAGS="-Csopt"
FCFLAGS="-Csopt"
CFLAGS_FOR_BUILD="-O2"
CXXFLAGS_FOR_BUILD="-O2"

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

@ -1,9 +1,8 @@
CC="scpathcc"
CXX="scpathCC"
F77="scpathf95"
FC="scpathf95"
MPICC="scmpicc"
MPIF77="scmpif77"
MPIFC="scmpif77"
CC_FOR_BUILD="gcc"
CXX_FOR_BUILD="g++"
OPENMP_CFLAGS="-mp"

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

@ -1,12 +1,10 @@
CC="scpathcc32"
CXX="scpathCC32"
F77="scpathf9532"
FC="scpathf9532"
MPICC="scmpicc32"
MPIF77="scmpif7732"
MPIFC="scmpif7732"
CFLAGS="-mabi=n32"
CXXFLAGS="-mabi=n32"
FFLAGS="-mabi=n32"
FCFLAGS="-mabi=n32"
CC_FOR_BUILD="gcc"
CXX_FOR_BUILD="g++"

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

@ -1,10 +1,8 @@
CC="cc"
CXX="CC"
F77="f77"
FC="f95"
CFLAGS="-xO3"
CXXFLAGS="-xO3"
FFLAGS="-xO3"
FCFLAGS="-xO3"
OPENMP_CFLAGS="-xopenmp -xO3 -D_REENTRANT"
PTHREAD_CFLAGS="-D_REENTRANT"

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

@ -8,49 +8,45 @@ AC_DEFUN([ACVT_COMPINST],
compinst_type=
compinst_cflags=
compinst_cxxflags=
compinst_fflags=
compinst_fcflags=
compinst_gnu_cflags="-g -finstrument-functions"
compinst_gnu_cxxflags="$compinst_gnu_cflags"
compinst_gnu_fflags="$compinst_gnu_cflags"
compinst_gnu_fcflags="$compinst_gnu_cflags"
compinst_pgi_cflags="-Mprof=func"
compinst_pgi_cxxflags="$compinst_pgi_cflags"
compinst_pgi_fflags="$compinst_pgi_cflags"
compinst_pgi_fcflags="$compinst_pgi_cflags"
compinst_pgi9_cflags="-Minstrument=functions"
compinst_pgi9_cxxflags="$compinst_pgi9_cflags"
compinst_pgi9_fflags="$compinst_pgi9_cflags"
compinst_pgi9_fcflags="$compinst_pgi9_cflags"
compinst_craycce_cflags="-hfunc_trace"
compinst_craycce_cxxflags="$compinst_craycce_cflags"
compinst_craycce_fcflags="$compinst_craycce_cflags"
compinst_sun_cflags=""
compinst_sun_cxxflags=""
compinst_sun_fflags=""
compinst_sun_fcflags="-O -Qoption f90comp -phat"
compinst_xl_cflags="-qdebug=function_trace"
compinst_xl_cxxflags="$compinst_xl_cflags"
compinst_xl_fflags="$compinst_xl_cflags"
compinst_xl_fcflags="$compinst_xl_cflags"
compinst_necsx_cflags="-ftrace"
compinst_necsx_cxxflags="$compinst_necsx_cflags"
compinst_necsx_fflags="$compinst_necsx_cflags"
compinst_necsx_fcflags="$compinst_necsx_cflags"
compinst_openuh_cflags="-fb_create inst -fb_type=1 -fb_phase=0 -epilog -OPT:instr_proc"
compinst_openuh_cxxflags="$compinst_openuh_cflags"
compinst_openuh_fflags="$compinst_openuh_cflags"
compinst_openuh_fcflags="$compinst_openuh_cflags"
AC_REQUIRE([ACVT_PLATFORM])
AC_ARG_ENABLE(compinst,
AC_HELP_STRING([--enable-compinst=TYPE],
[enable support for compiler instrumentation (gnu,intel,pathscale,pgi,pgi9,sun,xl,necsx,open64,openuh), default: automatically by configure]),
[enable support for compiler instrumentation (gnu,intel,pathscale,pgi,pgi9,craycce,xl,necsx,open64,openuh), default: automatically by configure]),
[AS_IF([test x"$enableval" = "xno"], [check_compinst="no"], [enable_compinst="$enableval"])])
AS_IF([test x"$check_compinst" = "xyes"],
@ -74,6 +70,9 @@ AC_DEFUN([ACVT_COMPINST],
pgi9)
compinst_type="pgi9"
;;
craycce)
compinst_type="craycce"
;;
sun)
compinst_type="sun"
;;
@ -104,26 +103,17 @@ AC_DEFUN([ACVT_COMPINST],
[
compinst_type="gnu"
AC_MSG_RESULT([gnu (intel)])
],
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: the version of the Intel compiler ($compver) doesn't support instrumentation])
compinst_error="yes"
])
;;
pathcc*)
compver=`$CC -dumpversion`
compver_major=`echo $compver | cut -d '.' -f 1`
compver_minor=`echo $compver | cut -d '.' -f 2`
AS_IF([test $compver_major -ge 3 -a $compver_minor -ge 1],
AS_IF([test $compver_major -gt 3], [compinst_type="gnu"])
AS_IF([test x"$compinst_type" = x -a $compver_major -eq 3 -a $compver_minor -ge 1], [compinst_type="gnu"])
AS_IF([test x"$compinst_type" != x],
[
compinst_type="gnu"
AC_MSG_RESULT([gnu (pathscale)])
],
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: the version of the PathScale compiler ($compver) doesn't support instrumentation])
compinst_error="yes"
])
;;
scpathcc*)
@ -144,6 +134,10 @@ AC_DEFUN([ACVT_COMPINST],
])
CFLAGS=$sav_CFLAGS
;;
craycc*)
compinst_type="craycce"
AC_MSG_RESULT([craycce])
;;
xlc* | blrts_xlc* | bgxlc*)
compinst_type="xl"
AC_MSG_RESULT([xl])
@ -165,6 +159,10 @@ AC_DEFUN([ACVT_COMPINST],
compinst_type="pgi9"
AC_MSG_RESULT([pgi9])
;;
*Cray*)
compinst_type="craycce"
AC_MSG_RESULT([craycce])
;;
*PathScale*)
compinst_type="gnu"
AC_MSG_RESULT([gnu (pathscale)])
@ -190,26 +188,25 @@ AC_DEFUN([ACVT_COMPINST],
])
])
;;
opencc* | uhcc*)
case `$CC --version 2>&1` in
OpenUH*)
compver=`$CC -dumpversion 2>&1`
compver_major=`echo $compver | cut -d '.' -f 1`
AS_IF([test $compver_major -ge 4],
[
compinst_type="openuh"
AC_MSG_RESULT([openuh])
],
[
compinst_type="gnu"
AC_MSG_RESULT([gnu (open64)])
])
;;
*)
compinst_type="gnu"
AC_MSG_RESULT([gnu (open64)])
;;
esac
opencc*)
compver=`$CC -dumpversion | head -n1 2>&1`
compver_major=`echo $compver | cut -d '.' -f 1`
compver_minor=`echo $compver | cut -d '.' -f 2`
AS_IF([test $compver_major -gt 4], [compinst_type="gnu"])
AS_IF([test x"$compinst_type" = x -a $compver_major -eq 4 -a $compver_minor -ge 2], [compinst_type="gnu"])
AS_IF([test x"$compinst_type" != x],
[
AC_MSG_RESULT([gnu (open64)])
])
;;
uhcc*)
compver=`$CC -dumpversion | head -n1 2>&1`
compver_major=`echo $compver | cut -d '.' -f 1`
AS_IF([test $compver_major -ge 4],
[
compinst_type="openuh"
AC_MSG_RESULT([openuh])
])
;;
sxcc*)
compinst_type="necsx"
@ -219,7 +216,7 @@ AC_DEFUN([ACVT_COMPINST],
;;
esac
AS_IF([test x"$compinst_error" = "xno" -a x"$compinst_type" = x],
AS_IF([test x"$compinst_type" = x],
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: the compiler '$base_CC' doesn't support instrumentation])
@ -229,7 +226,7 @@ AC_DEFUN([ACVT_COMPINST],
AS_IF([test x"$compinst_error" = "xno"],
[
AS_IF([test x"$compinst_type" = "xgnu" -o x"$compinst_type" = "xpgi9"],
AS_IF([test x"$compinst_type" = "xgnu" -o x"$compinst_type" = "xpgi9" -o x"$compinst_type" = "xcraycce"],
[
ACVT_DL
])
@ -243,43 +240,41 @@ AC_DEFUN([ACVT_COMPINST],
gnu)
compinst_cflags=$compinst_gnu_cflags
compinst_cxxflags=$compinst_gnu_cxxflags
compinst_fflags=$compinst_gnu_fflags
compinst_fcflags=$compinst_gnu_fcflags
;;
pgi)
compinst_cflags=$compinst_pgi_cflags
compinst_cxxflags=$compinst_pgi_cxxflags
compinst_fflags=$compinst_pgi_fflags
compinst_fcflags=$compinst_pgi_fcflags
;;
pgi9)
compinst_cflags=$compinst_pgi9_cflags
compinst_cxxflags=$compinst_pgi9_cxxflags
compinst_fflags=$compinst_pgi9_fflags
compinst_fcflags=$compinst_pgi9_fcflags
;;
craycce)
compinst_cflags=$compinst_craycce_cflags
compinst_cxxflags=$compinst_craycce_cxxflags
compinst_fcflags=$compinst_craycce_fcflags
;;
sun)
compinst_cflags=$compinst_sun_cflags
compinst_cxxflags=$compinst_sun_cxxflags
compinst_fflags=$compinst_sun_fflags
compinst_fcflags=$compinst_sun_fcflags
;;
xl)
compinst_cflags=$compinst_xl_cflags
compinst_cxxflags=$compinst_xl_cxxflags
compinst_fflags=$compinst_xl_fflags
compinst_fcflags=$compinst_xl_fcflags
;;
necsx)
compinst_cflags=$compinst_necsx_cflags
compinst_cxxflags=$compinst_necsx_cxxflags
compinst_fflags=$compinst_necsx_fflags
compinst_fcflags=$compinst_necsx_fcflags
;;
openuh)
compinst_cflags=$compinst_openuh_cflags
compinst_cxxflags=$compinst_openuh_cxxflags
compinst_fflags=$compinst_openuh_fflags
compinst_fcflags=$compinst_openuh_fcflags
;;
esac

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

@ -26,19 +26,6 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_CXX_COMPINST_COMPILER_FLAGS=
VT_WRAPPER_CXX_DEFAULT_PARTYPE="seq"
VT_WRAPPER_F77_COMPILER=$F77
VT_WRAPPER_F77_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_F77_EXTRA_LINKER_FLAGS=
VT_WRAPPER_F77_EXTRA_LIBS=
VT_WRAPPER_F77_CPP=$CPP
VT_WRAPPER_F77_EXTRA_CPPFLAGS=
VT_WRAPPER_F77_DYNINST_COMPILER_FLAGS=
VT_WRAPPER_F77_TAUINST_OPTS=
VT_WRAPPER_F77_TAUINST_PARSE_BIN=
VT_WRAPPER_F77_TAUINST_PARSE_OPTS=
VT_WRAPPER_F77_COMPINST_COMPILER_FLAGS=
VT_WRAPPER_F77_DEFAULT_PARTYPE="seq"
VT_WRAPPER_FC_COMPILER=$FC
VT_WRAPPER_FC_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_FC_EXTRA_LINKER_FLAGS=
@ -172,83 +159,39 @@ AC_DEFUN([ACVT_COMPWRAP],
esac
])
AC_ARG_WITH(wrapper-f77-compiler,
AC_HELP_STRING([--with-wrapper-f77-compiler=WRAPPERF77],
[underlying Fortran 77 compiler command for vtf77, default: F77]),
[VT_WRAPPER_F77_COMPILER=$withval])
AC_ARG_WITH(wrapper-f77-compiler-flags,
AC_HELP_STRING([--with-wrapper-f77-compiler-flags=WRAPPERF77CFLAGS],
[extra compiler flags to add when using vtf77]),
[VT_WRAPPER_F77_EXTRA_COMPILER_FLAGS=$withval])
AC_ARG_WITH(wrapper-f77-linker-flags,
AC_HELP_STRING([--with-wrapper-f77-linker-flags=WRAPPERF77LDFLAGS],
[extra linker flags to add when using vtf77]),
[VT_WRAPPER_F77_EXTRA_LINKER_FLAGS=$withval])
AC_ARG_WITH(wrapper-f77-libs,
AC_HELP_STRING([--with-wrapper-f77-libs=WRAPPERF77LIBS],
[extra libraries to link when using vtf77]),
[VT_WRAPPER_F77_EXTRA_LIBS=$withval])
AC_ARG_WITH(wrapper-f77-cpp,
AC_HELP_STRING([--with-wrapper-f77-cpp=WRAPPERF77CPP],
[C preprocessor command for vtf77, default: CPP]),
[VT_WRAPPER_F77_CPP=$withval])
AC_ARG_WITH(wrapper-f77-cppflags,
AC_HELP_STRING([--with-wrapper-f77-cppflags=WRAPPERF77CPPFLAGS],
[extra preprocessor flags to add when using vtf77 -vt:preprocess]),
[VT_WRAPPER_F77_EXTRA_CPPFLAGS=$withval])
AC_ARG_WITH(wrapper-f77-default-partype,
AC_HELP_STRING([--with-wrapper-f77-default-partype=TYPE],
[default parallelization type for vtf77 (seq,mt,mpi,hyb), default: $VT_WRAPPER_F77_DEFAULT_PARTYPE]),
[
case $withval in
seq | mt | mpi | hyb)
VT_WRAPPER_F77_DEFAULT_PARTYPE=$withval
;;
*)
AC_MSG_ERROR([value of '--with-wrapper-f77-default-partype' not properly set])
;;
esac
])
AC_ARG_WITH(wrapper-fc-compiler,
AC_HELP_STRING([--with-wrapper-fc-compiler=WRAPPERFC],
[underlying Fortran compiler command for vtf90, default: FC]),
[underlying Fortran compiler command for vtfort, default: FC]),
[VT_WRAPPER_FC_COMPILER=$withval])
AC_ARG_WITH(wrapper-fc-compiler-flags,
AC_HELP_STRING([--with-wrapper-fc-compiler-flags=WRAPPERFCCFLAGS],
[extra compiler flags to add when using vtf90]),
[extra compiler flags to add when using vtfort]),
[VT_WRAPPER_FC_EXTRA_COMPILER_FLAGS=$withval])
AC_ARG_WITH(wrapper-fc-linker-flags,
AC_HELP_STRING([--with-wrapper-fc-linker-flags=WRAPPERFCLDFLAGS],
[extra linker flags to add when using vtf90]),
[extra linker flags to add when using vtfort]),
[VT_WRAPPER_FC_EXTRA_LINKER_FLAGS=$withval])
AC_ARG_WITH(wrapper-fc-libs,
AC_HELP_STRING([--with-wrapper-fc-libs=WRAPPERFCLIBS],
[extra libraries to link when using vtf90]),
[extra libraries to link when using vtfort]),
[VT_WRAPPER_FC_EXTRA_LIBS=$withval])
AC_ARG_WITH(wrapper-fc-cpp,
AC_HELP_STRING([--with-wrapper-fc-cpp=WRAPPERFCCPP],
[C preprocessor command for vtf90, default: CPP]),
[C preprocessor command for vtfort, default: CPP]),
[VT_WRAPPER_FC_CPP=$withval])
AC_ARG_WITH(wrapper-fc-cppflags,
AC_HELP_STRING([--with-wrapper-fc-cppflags=WRAPPERFCCPPFLAGS],
[extra preprocessor flags to add when using vtf90 -vt:preprocess]),
[extra preprocessor flags to add when using vtfort -vt:preprocess]),
[VT_WRAPPER_fC_EXTRA_CPPFLAGS=$withval])
AC_ARG_WITH(wrapper-fc-default-partype,
AC_HELP_STRING([--with-wrapper-fc-default-partype=TYPE],
[default parallelization type for vtf90 (seq,mt,mpi,hyb), default: $VT_WRAPPER_FC_DEFAULT_PARTYPE]),
[default parallelization type for vtfort (seq,mt,mpi,hyb), default: $VT_WRAPPER_FC_DEFAULT_PARTYPE]),
[
case $withval in
seq | mt | mpi | hyb)
@ -308,7 +251,6 @@ AC_DEFUN([ACVT_COMPWRAP],
[
VT_WRAPPER_CC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_CC_EXTRA_LINKER_FLAGS -Wl,-force_flat_namespace"
VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS="$VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS -Wl,-force_flat_namespace"
VT_WRAPPER_F77_EXTRA_LINKER_FLAGS="$VT_WRAPPER_F77_EXTRA_LINKER_FLAGS -Wl,-force_flat_namespace"
VT_WRAPPER_FC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_FC_EXTRA_LINKER_FLAGS -Wl,-force_flat_namespace"
VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS -Wl,-force_flat_namespace"
])
@ -317,12 +259,11 @@ AC_DEFUN([ACVT_COMPWRAP],
[
VT_WRAPPER_CC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_CC_EXTRA_LINKER_FLAGS -Wl,-dy"
VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS="$VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS -Wl,-dy"
VT_WRAPPER_F77_EXTRA_LINKER_FLAGS="$VT_WRAPPER_F77_EXTRA_LINKER_FLAGS -Wl,-dy"
VT_WRAPPER_FC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_FC_EXTRA_LINKER_FLAGS -Wl,-dy"
VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS="$VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS -Wl,-dy"
])
AS_IF([test x"$compinst_type" = "xpgi9"],
AS_IF([test x"$compinst_type" = "xpgi9" -o x"$compinst_type" = "xcraycce"],
[
VT_WRAPPER_VTLIB="-Wl,--whole-archive $VT_WRAPPER_VTLIB -Wl,--no-whole-archive"
VT_WRAPPER_VTMPILIB="-Wl,--whole-archive $VT_WRAPPER_VTMPILIB -Wl,--no-whole-archive"
@ -351,7 +292,6 @@ AC_DEFUN([ACVT_COMPWRAP],
[
VT_WRAPPER_CC_COMPINST_COMPILER_FLAGS="$compinst_cflags"
VT_WRAPPER_CXX_COMPINST_COMPILER_FLAGS="$compinst_cxxflags"
VT_WRAPPER_F77_COMPINST_COMPILER_FLAGS="$compinst_fflags"
VT_WRAPPER_FC_COMPINST_COMPILER_FLAGS="$compinst_fcflags"
VT_WRAPPER_NVCC_COMPINST_COMPILER_FLAGS="$compinst_cflags"
VT_WRAPPER_AVAIL_INST="$VT_WRAPPER_AVAIL_INST compinst"
@ -362,7 +302,6 @@ AC_DEFUN([ACVT_COMPWRAP],
[
VT_WRAPPER_CC_DYNINST_COMPILER_FLAGS="-g"
VT_WRAPPER_CXX_DYNINST_COMPILER_FLAGS="-g"
VT_WRAPPER_F77_DYNINST_COMPILER_FLAGS="-g"
VT_WRAPPER_FC_DYNINST_COMPILER_FLAGS="-g"
VT_WRAPPER_NVCC_DYNINST_COMPILER_FLAGS="-g"
VT_WRAPPER_AVAIL_INST="$VT_WRAPPER_AVAIL_INST dyninst"
@ -373,12 +312,12 @@ AC_DEFUN([ACVT_COMPWRAP],
AS_IF([test x"$have_mpi" = "xyes"],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
AS_IF([test x"$inside_openmpi" != "xno"],
[mpiincdir="-I\${includedir}/.."],
[mpiincdir="$MPIINCDIR"])
AS_IF([test x"$have_fmpi" = "xyes"],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
AS_IF([test x"$inside_openmpi" != "xno"],
[fmpiincdir="$mpiincdir"],
[fmpiincdir="$FMPIINCDIR"])
])
@ -386,7 +325,6 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_CC_EXTRA_CPPFLAGS="$VT_WRAPPER_EXTRA_CPPFLAGS $mpiincdir"
VT_WRAPPER_CXX_EXTRA_CPPFLAGS="$VT_WRAPPER_EXTRA_CPPFLAGS $mpiincdir"
VT_WRAPPER_F77_EXTRA_CPPFLAGS="$VT_WRAPPER_EXTRA_CPPFLAGS $fmpiincdir"
VT_WRAPPER_FC_EXTRA_CPPFLAGS="$VT_WRAPPER_EXTRA_CPPFLAGS $fmpiincdir"
VT_WRAPPER_NVCC_EXTRA_CPPFLAGS="$VT_WRAPPER_EXTRA_CPPFLAGS $mpiincdir"
@ -399,12 +337,9 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_CXX_TAUINST_OPTS="-c++ -spec \${datadir}/TAUINST.SPEC"
VT_WRAPPER_CXX_TAUINST_PARSE_BIN="$tauinst_cxxparse_cmd"
VT_WRAPPER_CXX_TAUINST_PARSE_OPTS="$VT_WRAPPER_CC_TAUINST_PARSE_OPTS"
VT_WRAPPER_F77_TAUINST_OPTS="-fortran -spec \${datadir}/TAUINST.SPEC"
VT_WRAPPER_F77_TAUINST_PARSE_BIN="$tauinst_fparse_cmd"
VT_WRAPPER_F77_TAUINST_PARSE_OPTS="$fmpiincdir"
VT_WRAPPER_FC_TAUINST_OPTS="$VT_WRAPPER_F77_TAUINST_OPTS"
VT_WRAPPER_FC_TAUINST_PARSE_BIN="$VT_WRAPPER_F77_TAUINST_PARSE_BIN"
VT_WRAPPER_FC_TAUINST_PARSE_OPTS="$VT_WRAPPER_F77_TAUINST_PARSE_OPTS"
VT_WRAPPER_FC_TAUINST_OPTS="-fortran -spec \${datadir}/TAUINST.SPEC"
VT_WRAPPER_FC_TAUINST_PARSE_BIN="$tauinst_fparse_cmd"
VT_WRAPPER_FC_TAUINST_PARSE_OPTS="$fmpiincdir"
VT_WRAPPER_NVCC_TAUINST_OPTS="$VT_WRAPPER_CC_TAUINST_OPTS"
VT_WRAPPER_NVCC_TAUINST_PARSE_BIN="$VT_WRAPPER_CC_TAUINST_PARSE_BIN"
VT_WRAPPER_NVCC_TAUINST_PARSE_OPTS="$VT_WRAPPER_CC_TAUINST_PARSE_OPTS"
@ -437,19 +372,6 @@ AC_DEFUN([ACVT_COMPWRAP],
AC_SUBST(VT_WRAPPER_CXX_COMPINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_CXX_DEFAULT_PARTYPE)
AC_SUBST(VT_WRAPPER_F77_COMPILER)
AC_SUBST(VT_WRAPPER_F77_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_F77_EXTRA_LINKER_FLAGS)
AC_SUBST(VT_WRAPPER_F77_EXTRA_LIBS)
AC_SUBST(VT_WRAPPER_F77_CPP)
AC_SUBST(VT_WRAPPER_F77_EXTRA_CPPFLAGS)
AC_SUBST(VT_WRAPPER_F77_DYNINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_F77_TAUINST_OPTS)
AC_SUBST(VT_WRAPPER_F77_TAUINST_PARSE_BIN)
AC_SUBST(VT_WRAPPER_F77_TAUINST_PARSE_OPTS)
AC_SUBST(VT_WRAPPER_F77_COMPINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_F77_DEFAULT_PARTYPE)
AC_SUBST(VT_WRAPPER_FC_COMPILER)
AC_SUBST(VT_WRAPPER_FC_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_FC_EXTRA_LINKER_FLAGS)

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

@ -4,7 +4,7 @@ AC_DEFUN([ACVT_CONF_INIT],
AC_HELP_STRING([--enable-config-summary],
[show summary of configuration, default: enabled]), [],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
AS_IF([test x"$inside_openmpi" != "xno"],
[enable_config_summary="no"], [enable_config_summary="yes"])
])
@ -12,7 +12,7 @@ AC_DEFUN([ACVT_CONF_INIT],
AC_HELP_STRING([--enable-config-titles],
[show titles for each configure section, default: enabled]), [],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
AS_IF([test x"$inside_openmpi" != "xno"],
[enable_config_titles="no"], [enable_config_titles="yes"])
])
])
@ -150,8 +150,7 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
AS_IF([test x"$cross_compiling" = "xyes"],
[echo " C++ Compiler (H|B): $CXX | $CXX_FOR_BUILD"],
[echo " C++ compiler: $CXX"])
echo " Fortran 77 compiler: $F77"
echo " Fortran 90 compiler: $FC"
echo " Fortran compiler: $FC"
AS_IF([test x"$cross_compiling" = "xyes"],
[echo " C preprocessor (H|B): $CPP | $CPP_FOR_BUILD"],
[echo " C preprocessor: $CPP"])
@ -165,7 +164,6 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
AS_IF([test x"$cross_compiling" = "xyes"],
[echo " CXXFLAGS (H|B): $CXXFLAGS | $CXXFLAGS_FOR_BUILD"],
[echo " CXXFLAGS: $CXXFLAGS"])
echo " FFLAGS: $FFLAGS"
echo " FCFLAGS: $FCFLAGS"
AS_IF([test x"$cross_compiling" = "xyes"],
[echo " LDFLAGS (H|B): $LDFLAGS | $LDFLAGS_FOR_BUILD"],
@ -179,11 +177,11 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
[
echo " MPI C compiler: $MPICC"
echo " MPI C++ compiler: $MPICXX"
echo " MPI Fortran 77 compiler: $MPIF77"
echo " MPI Fortran compiler: $MPIFC"
echo ""
echo " MPICFLAGS (append to CFLAGS): $MPICFLAGS"
echo " MPICXXFLAGS (append to CXXFLAGS): $MPICXXFLAGS"
echo " MPIFFLAGS (append to FFLAGS): $MPIFFLAGS"
echo " MPIFCFLAGS (append to FCFLAGS): $MPIFCFLAGS"
echo ""
])
@ -197,7 +195,18 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
AS_IF([test x"$have_zlib" = "xyes"],
[answer="yes"], [answer="no"])
echo " ZLIB trace compression support: $answer"
echo " Build ZLIB trace compression support: $answer"
AS_IF([test x"$have_iofsl" = "xyes"],
[answer="yes"], [answer="no"])
echo " Build IOFSL I/O forwarding support: $answer"
AS_IF([test x"$have_iofsl" = "xyes"],
[
AS_IF([test x"$IOFSLSCRIPTS" != x],
[answer="yes ($IOFSLSCRIPTS)"], [answer="no"])
echo " Build IOFSL scripts: $answer"
])
AS_IF([test x"$have_mpi" = "xyes"],
[answer="yes"], [answer="no"])
@ -306,6 +315,13 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
], [answer="no"])
echo " Build Library trace support: $answer"
AS_IF([test x"$have_libwrap" = "xyes"],
[
AS_IF([test x"$build_libwrapgen" = "xyes"],
[answer="yes"], [answer="no"])
echo " Build Library wrapper generator: $answer"
])
AS_IF([test x"$have_cupti" = "xyes"],
[
answer=
@ -322,15 +338,8 @@ AC_DEFUN([ACVT_CONF_SUMMARY],
[answer="$answer, Events"],
[answer="Events"])])
answer="yes ($answer)"
echo " Build CUPTI support: $answer"
])
AS_IF([test x"$have_libwrap" = "xyes"],
[
AS_IF([test x"$build_libwrapgen" = "xyes"],
[answer="yes"], [answer="no"])
echo " Build Library wrapper generator: $answer"
])
], [answer=no])
echo " Build CUPTI support: $answer"
AS_IF([test x"$have_compinst" != x],
[answer=`echo $compinst_type | sed s/gnu/gnu*/g`],

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

@ -106,7 +106,7 @@ See \`config.log' for more details.])])
cross_prefix="cross-"
AC_ARG_WITH(cross-prefix,
AC_HELP_STRING([--with-cross-prefix=PREFIX],
[prefix for cross-tool's executables (e.g. PREFIXvtcc, PREFIXvtf77), default: cross-]),
[prefix for cross-tool's executables (e.g. PREFIXvtcc, PREFIXvtfort), default: cross-]),
[
AS_IF([test x"$withval" = "xno"], [cross_prefix=],
[AS_IF([test x"$withval" != "xyes"], [cross_prefix=$withval])])

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

@ -129,6 +129,7 @@ See \`config.log' for more details.])
have_cuda="yes"
])
AC_SUBST(CUDATKDIR)
AC_SUBST(CUDATKINCDIR)
AC_SUBST(CUDATKLIBDIR)
])

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

@ -23,7 +23,8 @@ AC_DEFUN([ACVT_CUPTI],
AC_ARG_WITH(cupti-dir,
AC_HELP_STRING([--with-cupti-dir=CUPTIDIR],
[give the path for CUPTI, default: /usr]),
[CUPTIDIR="$withval/"])
[CUPTIDIR="$withval/"],
[AS_IF([test x"$CUDATKDIR" != x], [CUPTIDIR="$CUDATKDIR/extras/CUPTI/"])])
AC_ARG_WITH(cupti-inc-dir,
AC_HELP_STRING([--with-cupti-inc-dir=CUPTIINCDIR],
@ -107,6 +108,11 @@ AC_DEFUN([ACVT_CUPTI],
])
])
dnl if no CUPTI found, remove content of CUPTILIBDIR to prevent adding the
dnl '-LCUPTILIBDIR' linker flag by the VT compiler wrappers
AS_IF([test x"$have_cupti" = "xno"],
[CUPTILIBDIR=])
AC_SUBST(CUPTIINCDIR)
AC_SUBST(CUPTILIBDIR)
AC_SUBST(CUPTILIB)

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

@ -0,0 +1,155 @@
AC_DEFUN([ACVT_IOFSL],
[
iofsl_error="no"
check_iofsl="yes"
force_iofsl="no"
have_iofsl="no"
zoidfs_lib_default="-lzoidfsclient -lzoidfs-util -lzoidfshints -liofsl-c-util"
bmi_lib_default="-lbmi -lpthread"
ZOIDFSDIR=
ZOIDFSINCDIR=
ZOIDFSLIBDIR=
ZOIDFSLIB=
BMIDIR=
BMIINCDIR=
BMILIBDIR=
BMILIB=
IOFSLSCRIPTS=
AC_ARG_ENABLE(iofsl,
AC_HELP_STRING([--enable-iofsl],
[enable IOFSL support, default: enable if found by configure]),
[AS_IF([test x"$enableval" = "xyes"], [force_iofsl="yes"], [check_iofsl="no"])])
AC_ARG_WITH(zoidfs-dir,
AC_HELP_STRING([--with-zoidfs-dir=ZOIDFSDIR], [give the path for ZOIDFS, default: /usr]),
[ZOIDFSDIR="$withval/"])
AC_ARG_WITH(zoidfs-inc-dir,
AC_HELP_STRING([--with-zoidfs-inc-dir=ZOIDFSINCDIR],
[give the path for ZOIDFS-include files, default: ZOIDFSDIR/include]),
[ZOIDFSINCDIR="-I$withval/"],
[AS_IF([test x"$ZOIDFSDIR" != x], [ZOIDFSINCDIR="-I$ZOIDFSDIR"include/])])
AC_ARG_WITH(zoidfs-lib-dir,
AC_HELP_STRING([--with-zoidfs-lib-dir=ZOIDFSLIBDIR],
[give the path for ZOIDFS-libraries, default: ZOIDFSDIR/lib]),
[ZOIDFSLIBDIR="-L$withval/"],
[AS_IF([test x"$ZOIDFSDIR" != x], [ZOIDFSLIBDIR="-L$ZOIDFSDIR"lib/])])
AC_ARG_WITH(zoidfs-lib,
AC_HELP_STRING([--with-zoidfs-lib=ZOIDFSLIB], [use given zoidfs lib, default: $zoidfs_lib_default BMILIBDIR BMILIB]),
[ZOIDFSLIB="$withval"])
AC_ARG_WITH(bmi-dir,
AC_HELP_STRING([--with-bmi-dir=BMIDIR], [give the path for BMI, default: ZOIDFSDIR]),
[BMIDIR="$withval/"])
AC_ARG_WITH(bmi-inc-dir,
AC_HELP_STRING([--with-bmi-inc-dir=BMIINCDIR],
[give the path for BMI-include files, default: BMIDIR/include]),
[BMIINCDIR="-I$withval/"],
[AS_IF([test x"$BMIDIR" != x], [BMIINCDIR="-I$BMIDIR"include/])])
AC_ARG_WITH(bmi-lib-dir,
AC_HELP_STRING([--with-bmi-lib-dir=BMILIBDIR],
[give the path for BMI-libraries, default: BMIDIR/lib]),
[BMILIBDIR="-L$withval/"],
[AS_IF([test x"$BMIDIR" != x], [BMILIBDIR="-L$BMIDIR"lib/])])
AC_ARG_WITH(bmi-lib,
AC_HELP_STRING([--with-bmi-lib=BMILIB], [use given bmi lib, default: $bmi_lib_default]),
[BMILIB="$withval"])
AC_ARG_ENABLE(iofsl-scripts,
AC_HELP_STRING([--enable-iofsl-scripts=PLATFORM],
[build IOFSL scripts for given platform, possible values: crayxk6, default: disabled]),
[
AS_IF([test x"$enableval" != "xno"],
[
AS_IF([test x"$enableval" != "xcrayxk6"],
[AC_MSG_ERROR([value of '--enable-iofsl-scripts' not properly set])],
[IOFSLSCRIPTS=$enableval])
])
])
AS_IF([test x"$check_iofsl" = "xyes"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $ZOIDFSINCDIR $BMIINCDIR"
AC_CHECK_HEADER([bmi.h], [],
[
AC_MSG_NOTICE([error: no bmi.h found; check path for BMI package first...])
iofsl_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
AS_IF([test x"$BMILIB" = x -a x"$iofsl_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $ZOIDFSLIBDIR $BMILIBDIR $bmi_lib_default"
AC_MSG_CHECKING([whether linking with $bmi_lib_default works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); BMILIB=$bmi_lib_default],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$BMILIB" = x -a x"$iofsl_error" = "xno"],
[
AC_MSG_NOTICE([error: no libbmi found; check path for BMI package first...])
iofsl_error="yes"
])
AS_IF([test x"$iofsl_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $ZOIDFSINCDIR"
AC_CHECK_HEADER([zoidfs.h], [],
[
AC_MSG_NOTICE([error: no zoidfs.h found; check path for ZOIDFS package first...])
iofsl_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
AS_IF([test x"$ZOIDFSLIB" = x -a x"$iofsl_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $ZOIDFSLIBDIR $zoidfs_lib_default $BMILIBDIR $BMILIB"
AC_MSG_CHECKING([whether linking with $zoidfs_lib_default $BMILIBDIR $BMILIB works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); ZOIDFSLIB=$zoidfs_lib_default],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$ZOIDFSLIB" = x -a x"$iofsl_error" = "xno"],
[
AC_MSG_NOTICE([error: no zoidfs library found; check path for ZOIDFS package first...])
iofsl_error="yes"
])
])
AS_IF([test x"$iofsl_error" = "xno"],
[
have_iofsl="yes"
AC_DEFINE([HAVE_IOFSL], [1], [Define to 1 if VT is configured with IOFSL support.])
],
[
AS_IF([test x"$force_iofsl" = "xyes"], [exit 1])
])
])
AC_SUBST(ZOIDFSDIR)
AC_SUBST(ZOIDFSINCDIR)
AC_SUBST(ZOIDFSLIBDIR)
AC_SUBST(ZOIDFSLIB)
AC_SUBST(BMIDIR)
AC_SUBST(BMIINCDIR)
AC_SUBST(BMILIBDIR)
AC_SUBST(BMILIB)
AC_SUBST(IOFSLSCRIPTS)
])

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

@ -0,0 +1,74 @@
AC_DEFUN([ACVT_LIBERTY],
[
liberty_error="no"
have_liberty="no"
LIBERTYDIR=
LIBERTYINCDIR=
LIBERTYLIBDIR=
LIBERTYLIB=
AC_ARG_WITH(liberty-dir,
AC_HELP_STRING([--with-liberty-dir=LIBERTYDIR], [give the path for LIBERTY, default: /usr]),
[LIBERTYDIR="$withval/"])
AC_ARG_WITH(liberty-inc-dir,
AC_HELP_STRING([--with-liberty-inc-dir=LIBERTYINCDIR],
[give the path for LIBERTY-include files, default: LIBERTYDIR/include]),
[LIBERTYINCDIR="-I$withval/"],
[AS_IF([test x"$LIBERTYDIR" != x], [LIBERTYINCDIR="-I$LIBERTYDIR"include/])])
AC_ARG_WITH(liberty-lib-dir,
AC_HELP_STRING([--with-liberty-lib-dir=LIBERTYLIBDIR],
[give the path for LIBERTY-libraries, default: LIBERTYDIR/lib]),
[LIBERTYLIBDIR="-L$withval/"],
[AS_IF([test x"$LIBERTYDIR" != x], [LIBERTYLIBDIR="-L$LIBERTYDIR"lib/])])
AC_ARG_WITH(liberty-lib,
AC_HELP_STRING([--with-liberty-lib=LIBERTYLIB], [use given liberty lib, default: -liberty]),
[LIBERTYLIB="$withval"])
AS_IF([test x"$LIBERTYLIB" = x -a x"$liberty_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $LIBERTYLIBDIR -liberty_pic"
AC_MSG_CHECKING([whether linking with -liberty_pic works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); LIBERTYLIB=-liberty_pic],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$LIBERTYLIB" = x -a x"$liberty_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $LIBERTYLIBDIR -liberty"
AC_MSG_CHECKING([whether linking with -liberty works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); LIBERTYLIB=-liberty],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$LIBERTYLIB" = x -a x"$liberty_error" = "xno"],
[
AC_MSG_NOTICE([error: no libiberty found; check path for LIBERTY package first...])
liberty_error="yes"
])
AS_IF([test x"$LIBERTYLIB" != x -a x"$liberty_error" = "xno"],
[have_liberty="yes"])
AS_IF([test x"$liberty_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LIBERTYINCDIR"
HAVE_DEMANGLE_H=0
AC_CHECK_HEADERS([demangle.h])
AS_IF([test x"$ac_cv_header_demangle_h"], [HAVE_DEMANGLE_H=1])
AC_SUBST(HAVE_DEMANGLE_H)
CPPFLAGS=$sav_CPPFLAGS
])
AC_SUBST(LIBERTYINCDIR)
AC_SUBST(LIBERTYLIBDIR)
AC_SUBST(LIBERTYLIB)
])

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

@ -97,7 +97,8 @@ AC_DEFUN([ACVT_LIBWRAP],
AC_DEFINE_UNQUOTED([SHLIBC_PATHNAME],
["$shlibc_pathname"], [pathname of shared LIBC])
AC_CHECK_DECLS([__errno_location], [], [], [#include <errno.h>])
AC_CHECK_DECLS([__errno_location], [],
[AC_CHECK_DECLS([_Errno], [], [], [#include <errno.h>])], [#include <errno.h>])
],
[
AC_MSG_RESULT([unknown])

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

@ -33,18 +33,18 @@ AC_DEFUN([ACVT_MPI],
AC_ARG_VAR(MPICC, [MPI C compiler command])
AC_ARG_VAR(MPICXX, [MPI C++ compiler command])
AC_ARG_VAR(MPIF77, [MPI Fortran 77 compiler command])
AC_ARG_VAR(MPIFC, [MPI Fortran compiler command])
AC_ARG_VAR(MPICFLAGS, [MPI C compiler flags (append to CFLAGS)])
AC_ARG_VAR(MPICXXFLAGS, [MPI C++ compiler flags (append to CXXFLAGS)])
AC_ARG_VAR(MPIFFLAGS, [MPI Fortran 77 compiler flags (append to FFLAGS)])
AC_ARG_VAR(MPIFCFLAGS, [MPI Fortran compiler flags (append to FCFLAGS)])
AS_IF([test x"$inside_openmpi" = "xyes"],
AS_IF([test x"$inside_openmpi" != "xno"],
[
AC_MSG_NOTICE([we are configuring inside Open MPI; presetting cache to skip MPI related tests])
ac_cv_prog_MPICC="$CC"
ac_cv_prog_MPICXX="$CXX"
ac_cv_prog_MPIF77="$F77"
ac_cv_prog_MPIFC="$FC"
MPIINCDIR="-I$top_vt_srcdir/../../../include -I$top_vt_builddir/../../../include"
FMPIINCDIR="$MPIINCDIR"
@ -52,7 +52,8 @@ AC_DEFUN([ACVT_MPI],
LDFLAGS="$LDFLAGS -L$top_vt_builddir/../../../.libs"
enable_mpi="yes"
with_openmpi="yes"
AS_IF([test "$inside_openmpi" = "1.7"],
[with_openmpi17="yes"], [with_openmpi="yes"])
check_mpi2_io="no"; have_mpi2_io="yes"
AC_ARG_ENABLE(mpi-io,
@ -102,6 +103,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -118,6 +120,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_extcoll="no"; have_mpi2_extcoll="no"
check_mpi2_io="no"; have_mpi2_io="no"
ac_cv_have_decl_MPI_IN_PLACE="no"
ac_cv_have_decl_MPI_ROOT="no"
])
])
@ -133,6 +136,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -175,6 +179,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -191,6 +196,8 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="no"
check_mpi2_extcoll="no"; have_mpi2_extcoll="no"
check_mpi2_io="no"; have_mpi2_io="no"
ac_cv_have_decl_MPI_IN_PLACE="no"
ac_cv_have_decl_MPI_ROOT="no"
])
])
@ -207,6 +214,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -223,6 +231,8 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="no"
check_mpi2_extcoll="no"; have_mpi2_extcoll="no"
check_mpi2_io="no"; have_mpi2_io="no"
ac_cv_have_decl_MPI_IN_PLACE="no"
ac_cv_have_decl_MPI_ROOT="no"
])
])
@ -239,6 +249,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -255,6 +266,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
check_mpi2_io="no"; have_mpi2_io="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -273,43 +285,46 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
check_mpi2_io="no"; have_mpi2_io="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
AC_ARG_WITH(openmpi,
AC_HELP_STRING([--with-openmpi], [set MPI-libs for Open MPI]),
AC_HELP_STRING([--with-openmpi], [set MPI-libs for Open MPI version < 1.7]))
AC_ARG_WITH(openmpi17,
AC_HELP_STRING([--with-openmpi17], [set MPI-libs for Open MPI version >= 1.7]))
AS_IF([test x"$with_openmpi" = "xyes" -o x"$with_openmpi17" = "xyes"],
[
AS_IF([test x"$withval" = "xyes"],
MPILIB="-lmpi"
PMPILIB="$MPILIB"
AS_IF([test x"$with_openmpi" = "xyes"],
[FMPILIB="-lmpi_f77"], [FMPILIB="-lmpi_mpifh"])
check_mpi2_thread="no"; have_mpi2_thread="yes"
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_func_MPI_Add_error_class="yes"
ac_cv_func_MPI_Add_error_code="yes"
ac_cv_func_MPI_Add_error_string="yes"
ac_cv_func_MPI_Get_address="yes"
ac_cv_func_MPI_Finalized="yes"
ac_cv_func_MPI_Type_create_f90_complex="yes"
ac_cv_func_MPI_Type_create_f90_integer="yes"
ac_cv_func_MPI_Type_create_f90_real="yes"
ac_cv_func_MPI_Type_create_struct="yes"
ac_cv_func_MPI_Type_match_size="yes"
ac_cv_func_PMPI_Win_test="yes"
ac_cv_func_PMPI_Win_lock="yes"
ac_cv_func_PMPI_Win_unlock="yes"
AS_IF([test x"$inside_openmpi" != "xno" -a x"$have_mpi2_io" = "xyes"],
[
MPILIB="-lmpi"
PMPILIB="$MPILIB"
FMPILIB="-lmpi_mpifh"
check_mpi2_thread="no"; have_mpi2_thread="yes"
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_func_MPI_Add_error_class="yes"
ac_cv_func_MPI_Add_error_code="yes"
ac_cv_func_MPI_Add_error_string="yes"
ac_cv_func_MPI_Get_address="yes"
ac_cv_func_MPI_Finalized="yes"
ac_cv_func_MPI_Type_create_f90_complex="yes"
ac_cv_func_MPI_Type_create_f90_integer="yes"
ac_cv_func_MPI_Type_create_f90_real="yes"
ac_cv_func_MPI_Type_create_struct="yes"
ac_cv_func_MPI_Type_match_size="yes"
ac_cv_func_PMPI_Win_test="yes"
ac_cv_func_PMPI_Win_lock="yes"
ac_cv_func_PMPI_Win_unlock="yes"
AS_IF([test x"$inside_openmpi" = "xyes" -a x"$have_mpi2_io" = "xyes"],
[
ac_cv_func_PMPI_File_read_ordered="yes"
ac_cv_func_PMPI_File_read_ordered_begin="yes"
ac_cv_func_PMPI_File_write_ordered="yes"
ac_cv_func_PMPI_File_write_ordered_begin="yes"
ac_cv_func_MPI_Register_datarep="yes"
])
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_func_PMPI_File_read_ordered="yes"
ac_cv_func_PMPI_File_read_ordered_begin="yes"
ac_cv_func_PMPI_File_write_ordered="yes"
ac_cv_func_PMPI_File_write_ordered_begin="yes"
ac_cv_func_MPI_Register_datarep="yes"
])
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
AC_ARG_WITH(sgimpt,
@ -325,6 +340,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="no"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -340,6 +356,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -355,6 +372,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -375,6 +393,7 @@ AC_DEFUN([ACVT_MPI],
check_mpi2_1sided="no"; have_mpi2_1sided="yes"
check_mpi2_extcoll="no"; have_mpi2_extcoll="yes"
ac_cv_have_decl_MPI_IN_PLACE="yes"
ac_cv_have_decl_MPI_ROOT="yes"
])
])
@ -618,7 +637,7 @@ dnl check for PMPILIB
dnl check for FMPILIB
AS_IF([test x"$F77" != x],
AS_IF([test x"$FC" != x],
[
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
@ -630,6 +649,16 @@ dnl check for FMPILIB
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lmpi_mpifh $MPILIB"
AC_MSG_CHECKING([whether linking with -lmpi_mpifh works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB="-lmpi_mpifh"],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
@ -676,7 +705,7 @@ dnl check for FMPILIB
[
AS_IF([test x"$check_fmpiwraplib" = "xyes"],
[
AC_MSG_WARN([no libmpi_f77, libmpibinding_f77, libfmpich, liblamf77mpi, or libfmpi found; build libvt-fmpi])
AC_MSG_WARN([no libmpi_f77, libmpi_mpifh, libmpibinding_f77, libfmpich, liblamf77mpi, or libfmpi found; build libvt-fmpi])
FMPILIB="-lvt-fmpi"
])
],
@ -710,6 +739,7 @@ dnl check for MPI-2 constants
ACVT_CONF_SUBTITLE([MPI-2 constants])
AC_CHECK_DECLS([MPI_IN_PLACE], [], [], [#include "mpi.h"])
AC_CHECK_DECLS([MPI_ROOT], [], [], [#include "mpi.h"])
dnl check for MPI-2 functions
@ -829,11 +859,11 @@ dnl check for Fortran interoperability
ACVT_CONF_SUBTITLE([Fortran interoperability])
ACVT_FMPIWRAPLIB
AS_IF([test x"$fmpiwraplib_error" = "xno"],
[build_fmpiwraplib="yes"], [MPIF77="$F77"; FMPILIB=])
[build_fmpiwraplib="yes"], [MPIFC="$FC"; FMPILIB=])
])
AS_IF([test x"$mpi_error" = "xno"], [have_mpi="yes"],
[MPICC="$CC"; MPICXX="$CXX"; MPIF77="$F77"])
[MPICC="$CC"; MPICXX="$CXX"; MPIFC="$FC"])
AS_IF([test x"$FMPILIB" != x], [have_fmpi="yes"])
AS_IF([test x"$have_mpi2_thread" = "xyes"], [VT_MPIGEN_HAVE_MPI2_THREAD=1])
AS_IF([test x"$have_mpi2_1sided" = "xyes"], [VT_MPIGEN_HAVE_MPI2_1SIDED=1])
@ -841,6 +871,8 @@ dnl check for Fortran interoperability
AS_IF([test x"$have_mpi2_io" = "xyes"], [VT_MPIGEN_HAVE_MPI2_IO=1])
])
AC_DEFINE([MPI_TRACE_INSIDE], [0], [Define to 1 to record MPI functions called within MPI functions.])
AS_IF([test x"$have_mpi" = "xyes"],
[AC_DEFINE([HAVE_MPI], [1], [Define to 1 if VT is configured with MPI support.])])
@ -889,18 +921,18 @@ AC_DEFUN([ACVT_FMPIWRAPLIB],
VT_MPIGEN_HAVE_FC_CONV_WIN=0
VT_MPIGEN_HAVE_FC_CONV_MPI2CONST=0
AS_IF([test x"$F77" != x],
AS_IF([test x"$FC" != x],
[
AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c)
AS_IF([test x"$MPIF77" != x],
AC_CHECK_PROGS(MPIFC, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc mpifort mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c)
AS_IF([test x"$MPIFC" != x],
[
AS_IF([test x"$inside_openmpi" = "xno"],
[
mpif77=`echo $MPIF77 | cut -d ' ' -f 1`
which_mpif77=`which $mpif77 2>/dev/null`
AS_IF([test x"$which_mpif77" = x], [AC_MSG_ERROR([$mpif77 not found])])
mpifc=`echo $MPIFC | cut -d ' ' -f 1`
which_mpifc=`which $mpifc 2>/dev/null`
AS_IF([test x"$which_mpifc" = x], [AC_MSG_ERROR([$mpifc not found])])
mpi_bin_dir=`dirname $which_mpif77`
mpi_bin_dir=`dirname $which_mpifc`
AS_IF([test "$mpi_bin_dir" != "/usr/bin" -a "$mpi_bin_dir" != "/SX/usr/bin" -a x"$FMPIINCDIR" != x-I"$mpi_inc_dir"],
[
mpi_inc_dir=-I`echo $mpi_bin_dir | sed -e 's/bin/include/'`
@ -910,7 +942,7 @@ AC_DEFUN([ACVT_FMPIWRAPLIB],
])
],
[
MPIF77="$F77"
MPIFC="$FC"
AC_MSG_CHECKING([for mpif.h])
rm -f conftest.f conftest.o
cat > conftest.f << EOF
@ -918,7 +950,7 @@ AC_DEFUN([ACVT_FMPIWRAPLIB],
INCLUDE 'mpif.h'
END
EOF
eval "$F77 $FFLAGS $MPIFFLAGS $FMPIINCDIR -c conftest.f" >/dev/null 2>&1
eval "$FC $FCFLAGS $MPIFCFLAGS $FMPIINCDIR -c conftest.f" >/dev/null 2>&1
AS_IF([test "$?" = "0" -a -s conftest.o], [AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
@ -929,7 +961,7 @@ EOF
])
],
[
AC_MSG_NOTICE([error: no Fortran 77 compiler command given])
AC_MSG_NOTICE([error: no Fortran compiler command given])
fmpiwraplib_error="yes"
])

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

@ -5,9 +5,11 @@ AC_DEFUN([ACVT_OTF],
OTFDIR=
OTFINCDIR=
OTFLIBDIR=
OTFLIB=
AC_REQUIRE([ACVT_MPI])
AC_REQUIRE([ACVT_ZLIB])
AC_REQUIRE([ACVT_IOFSL])
AC_ARG_WITH(extern-otf,
AC_HELP_STRING([--with-extern-otf], [use external OTF library, default: not set]),
@ -30,7 +32,7 @@ AC_DEFUN([ACVT_OTF],
[AS_IF([test x"$OTFDIR" != x], [OTFLIBDIR="-L$OTFDIR"lib/])])
AC_ARG_WITH(otf-lib,
AC_HELP_STRING([--with-otf-lib=OTFLIB], [use given otf lib, default: -lotf ZLIBLIBDIR ZLIBLIB]),
AC_HELP_STRING([--with-otf-lib=OTFLIB], [use given otf lib, default: -lotf ZLIBLIBDIR ZLIBLIB ZOIDFSLIBDIR ZOIDFSLIB BMILIBDIR BMILIB]),
[OTFLIB="$withval"])
AC_ARG_WITH(otf-flags,
@ -50,10 +52,10 @@ AC_DEFUN([ACVT_OTF],
AS_IF([test x"$OTFLIB" = x -a "$otf_error" = "no"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $OTFLIBDIR -lotf $ZLIBLIBDIR $ZLIBLIB"
AC_MSG_CHECKING([whether linking with -lotf $ZLIBLIBDIR $ZLIBLIB works])
LIBS="$LIBS $OTFLIBDIR -lotf $ZLIBLIBDIR $ZLIBLIB $ZOIDFSLIBDIR $ZOIDFSLIB $BMILIBDIR $BMILIB"
AC_MSG_CHECKING([whether linking with -lotf $ZLIBLIBDIR $ZLIBLIB $ZOIDFSLIBDIR $ZOIDFSLIB $BMILIBDIR $BMILIB works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); OTFLIB="-lotf $ZLIBLIBDIR $ZLIBLIB"],[AC_MSG_RESULT([no])])
[AC_MSG_RESULT([yes]); OTFLIB="-lotf $ZLIBLIBDIR $ZLIBLIB $ZOIDFSLIBDIR $ZOIDFSLIB $BMILIBDIR $BMILIB"],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
@ -144,9 +146,37 @@ dnl [otf_conf_args="$otf_conf_args --with-mpi-inc-dir=`echo $MPIINCDIR | sed
[
otf_conf_args="$otf_conf_args --without-zlib"
])
AS_IF([test x"$have_iofsl" = "xyes"],
[
AS_IF([test x"$force_iofsl" = "xyes"],
[otf_conf_args="$otf_conf_args --with-zoidfs"])
AS_IF([test x"$ZOIDFSDIR" != x],
[otf_conf_args="$otf_conf_args --with-zoidfs-dir=$ZOIDFSDIR"])
AS_IF([test x"$ZOIDFSINCDIR" != x],
[otf_conf_args="$otf_conf_args --with-zoidfs-inc-dir=`echo $ZOIDFSINCDIR | sed s/-I//`"])
AS_IF([test x"$ZOIDFSLIBDIR" != x],
[otf_conf_args="$otf_conf_args --with-zoidfs-lib-dir=`echo $ZOIDFSLIBDIR | sed s/-L//`"])
AS_IF([test x"$ZOIDFSLIB" != x],
[otf_conf_args="$otf_conf_args --with-zoidfs-lib=\"$ZOIDFSLIB\""])
AS_IF([test x"$BMIDIR" != x],
[otf_conf_args="$otf_conf_args --with-bmi-dir=$BMIDIR"])
AS_IF([test x"$BMIINCDIR" != x],
[otf_conf_args="$otf_conf_args --with-bmi-inc-dir=`echo $BMIINCDIR | sed s/-I//`"])
AS_IF([test x"$BMILIBDIR" != x],
[otf_conf_args="$otf_conf_args --with-bmi-lib-dir=`echo $BMILIBDIR | sed s/-L//`"])
AS_IF([test x"$BMILIB" != x],
[otf_conf_args="$otf_conf_args --with-bmi-lib=\"$BMILIB\""])
],
[
otf_conf_args="$otf_conf_args --without-zoidfs"
])
otf_conf_args="$otf_conf_args --prefix=\"$prefix\" --exec-prefix=\"$exec_prefix\" --bindir=\"$bindir\" --libdir=\"$libdir\" --includedir=\"$includedir\" --docdir=\"$docdir/otf\" $OTFFLAGS --cache-file=\"/dev/null\" --srcdir=\"$otf_srcdir\""
export CPPFLAGS
AC_MSG_NOTICE([running $SHELL $otf_conf_cmd $otf_conf_args])
eval "$SHELL '$otf_conf_cmd' $otf_conf_args"
AS_IF([test $? != "0"], [AC_MSG_ERROR([$otf_conf_cmd failed for $otf_dir])])
@ -157,7 +187,7 @@ dnl [otf_conf_args="$otf_conf_args --with-mpi-inc-dir=`echo $MPIINCDIR | sed
OTFINCDIR=
OTFLIBDIR=
AS_IF([test x"$OTFLIB" = x], [OTFLIB="-lotf $ZLIBLIBDIR $ZLIBLIB"])
AS_IF([test x"$OTFLIB" = x], [OTFLIB="-lotf $ZLIBLIBDIR $ZLIBLIB $ZOIDFSLIBDIR $ZOIDFSLIB $BMILIBDIR $BMILIB"])
])
AC_SUBST(OTFDIR)

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

@ -68,7 +68,7 @@ AC_DEFUN([ACVT_TAUINST],
AC_CHECK_PROG(tauinst_cxxparse_cmd, cxxparse, cxxparse)
AS_IF([test x"$tauinst_cxxparse_cmd" = x],
[AC_MSG_WARN([no cxxparse found; C++ source code cannot be instrumented by TAU])])
AS_IF([test x"$F77" != x],
AS_IF([test x"$FC" != x],
[
AC_CHECK_PROGS(tauinst_fparse_cmd, f95parse f90parse gfparse)
AS_IF([test x"$tauinst_fparse_cmd" = x],

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

@ -10,15 +10,12 @@ AC_DEFUN([ACVT_UNIMCI],
unimci_checker_version=
unimci_cc=
unimci_cxx=
unimci_f77=
unimci_f90=
unimci_fc=
UNIMCI_CFLAGS=
UNIMCI_CLIBS=
UNIMCI_CXXFLAGS=
UNIMCI_CXXLIBS=
UNIMCI_FFLAGS=
UNIMCI_FLIBS=
UNIMCI_FCFLAGS=
UNIMCI_FCLIBS=
UNIMCI_LDFLAGS=
@ -154,54 +151,26 @@ dnl check for C++ compiler flags and libs
], [unimci_error="yes"])
])
dnl check for Fortran 77 support
AS_IF([test x"$unimci_error" = "xno" -a x"$F77" != x],
[
AC_MSG_CHECKING([whether UniMCI's checker supports Fortran 77])
unimci_f77=`eval "$unimci_config_cmd --f77"`
AS_IF([test "$?" = "0"],
[
AS_IF([test x"$unimci_f77" != x],
[
AC_MSG_RESULT([yes])
dnl check for Fortran 77 compiler flags and libs
AC_MSG_CHECKING([for UniMCI's Fortran 77 compiler flags])
UNIMCI_FFLAGS=`eval "$unimci_config_cmd --f77flags"`
AS_IF([test "$?" = "0"],
[
AC_MSG_RESULT([$UNIMCI_FFLAGS])
AC_MSG_CHECKING([for UniMCI's Fortran 77 libs])
UNIMCI_FLIBS=`eval "$unimci_config_cmd --f77lib-dirs --f77libs"`
AS_IF([test "$?" = "0"],
[AC_MSG_RESULT([$UNIMCI_FLIBS])], [unimci_error="yes"])
], [unimci_error="yes"])
], [AC_MSG_RESULT([no])])
], [unimci_error="yes"])
])
dnl check for Fortran 90 support
dnl check for Fortran support
AS_IF([test x"$unimci_error" = "xno" -a x"$FC" != x],
[
AC_MSG_CHECKING([whether UniMCI's checker supports Fortran 90])
unimci_f90=`eval "$unimci_config_cmd --f90"`
AC_MSG_CHECKING([whether UniMCI's checker supports Fortran])
unimci_fc=`eval "$unimci_config_cmd --f90"`
AS_IF([test "$?" = "0"],
[
AS_IF([test x"$unimci_f90" != x],
AS_IF([test x"$unimci_fc" != x],
[
AC_MSG_RESULT([yes])
dnl check for Fortran 90 compiler flags and libs
dnl check for Fortran compiler flags and libs
AC_MSG_CHECKING([for UniMCI's Fortran 90 compiler flags])
AC_MSG_CHECKING([for UniMCI's Fortran compiler flags])
UNIMCI_FCFLAGS=`eval "$unimci_config_cmd --f90flags"`
AS_IF([test "$?" = "0"],
[
AC_MSG_RESULT([$UNIMCI_FCFLAGS])
AC_MSG_CHECKING([for UniMCI's Fortran 90 libs])
AC_MSG_CHECKING([for UniMCI's Fortran libs])
UNIMCI_FCLIBS=`eval "$unimci_config_cmd --f90lib-dirs --f90libs"`
AS_IF([test "$?" = "0"],
[AC_MSG_RESULT([$UNIMCI_FCLIBS])], [unimci_error="yes"])
@ -210,7 +179,7 @@ dnl check for Fortran 90 compiler flags and libs
], [unimci_error="yes"])
])
AS_IF([test x"$unimci_cc" = x -a x"$unimci_cxx" = x -a x"$unimci_f77" = x -a x"$unimci_f90" = x],
AS_IF([test x"$unimci_cc" = x -a x"$unimci_cxx" = x -a x"$unimci_fc" = x],
[unimci_error="yes"])
dnl check for linker flags
@ -233,7 +202,7 @@ dnl check for MPI Fortran interoperability
AS_IF([test x"$unimci_error" = "xno" -a x"$have_fmpi" = "xyes" -a x"$build_fmpiwraplib" = "xno"],
[
AS_IF([test x"$F77" != x -o x"$FC" != x],
AS_IF([test x"$FC" != x],
[
ACVT_CONF_SUBSUBTITLE([MPI Fortran interoperability])
ACVT_FMPIWRAPLIB
@ -264,8 +233,6 @@ dnl check for MPI Fortran interoperability
AC_SUBST(UNIMCI_CLIBS)
AC_SUBST(UNIMCI_CXXFLAGS)
AC_SUBST(UNIMCI_CXXLIBS)
AC_SUBST(UNIMCI_FFLAGS)
AC_SUBST(UNIMCI_FLIBS)
AC_SUBST(UNIMCI_FCFLAGS)
AC_SUBST(UNIMCI_FCLIBS)
AC_SUBST(UNIMCI_LDFLAGS)

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

@ -22,6 +22,7 @@ AC_DEFUN([ACVT_SETUP],
VT_SETUP_PLUGIN_CNTR=0
VT_SETUP_PTHREAD=0
VT_SETUP_RUSAGE=0
VT_SETUP_IOFSL=0
AC_ARG_ENABLE(vtsetup,
AC_HELP_STRING([--enable-vtsetup],
@ -58,6 +59,7 @@ AC_DEFUN([ACVT_SETUP],
AS_IF([test x"$have_plugin_cntr" = "xyes"], [VT_SETUP_PLUGIN_CNTR=1])
AS_IF([test x"$have_pthread" = "xyes"], [VT_SETUP_PTHREAD=1])
AS_IF([test x"$have_rusage" = "xyes"], [VT_SETUP_RUSAGE=1])
AS_IF([test x"$have_iofsl" = "xyes"], [VT_SETUP_IOFSL=1])
build_vtsetup="yes"
])
@ -80,5 +82,6 @@ AC_DEFUN([ACVT_SETUP],
AC_SUBST(VT_SETUP_PLUGIN_CNTR)
AC_SUBST(VT_SETUP_PTHREAD)
AC_SUBST(VT_SETUP_RUSAGE)
AC_SUBST(VT_SETUP_IOFSL)
])

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

@ -95,14 +95,17 @@ cat <<End-of-File >$tmp.awk
next
}
aint_convert=1
aint_convert=0
if (index(mpicall,"MPI_Get_address") != 0 ||
index(mpicall,"MPI_Type_create_hindexed") != 0 ||
index(mpicall,"MPI_Type_create_hvector") != 0 ||
index(mpicall,"MPI_Type_create_struct") != 0)
if (index(mpicall,"MPI_Address") != 0 ||
index(mpicall,"MPI_Type_extent") != 0 ||
index(mpicall,"MPI_Type_hindexed") != 0 ||
index(mpicall,"MPI_Type_hvector") != 0 ||
index(mpicall,"MPI_Type_lb") != 0 ||
index(mpicall,"MPI_Type_struct") != 0 ||
index(mpicall,"MPI_Type_ub") != 0)
{
aint_convert=0
aint_convert=1
}
optional=0

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

@ -4,13 +4,6 @@
#include "util/util.h"
/* use own implementation of assert() to work around a compiler bug
(seen on MacOS using GCC v4.2.1):
The linker results in an undefined reference to ___builtin_expect()
when using assert() within OpenMP-parallel regions. */
#undef assert
#define assert vt_assert
#if !(defined(HAVE_ASPRINTF) && HAVE_ASPRINTF)
# undef asprintf
# define asprintf vt_asprintf

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

@ -15,10 +15,14 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
inside_openmpi="no"
AC_ARG_WITH(openmpi-inside, [],
[
AS_IF([test x"$withval" != "xno"],
AS_IF([test x"$withval" = "xyes" -o x"$withval" = "x1.7"],
[
inside_openmpi="yes"
inside_openmpi="$withval"
CPPFLAGS="-DINSIDE_OPENMPI $CPPFLAGS"
# Set FC to F77 if Open MPI version < 1.7
AS_IF([test x"$withval" = "xyes" -a x"$FC" = x -a x"$F77" != x],
[FC="$F77"])
])
])
@ -73,9 +77,9 @@ AM_CONDITIONAL(AMHAVECSFS, test x"$have_csfs" = "xyes")
# Correct install paths
AS_IF([test x"$prefix" = x -o x"$prefix" = "xNONE"], [prefix="$ac_default_prefix"])
AS_IF([test x"$exec_prefix" = x -o x"$exec_prefix" = "xNONE"], [exec_prefix="\${prefix}"])
AS_IF([test x"$inside_openmpi" = "xyes" -o "$includedir" = "\${prefix}/include"],
AS_IF([test x"$inside_openmpi" != "xno" -o "$includedir" = "\${prefix}/include"],
[includedir="$includedir/vampirtrace"])
AS_IF([test x"$inside_openmpi" = "xyes" -o "$datarootdir" = "\${prefix}/share"],
AS_IF([test x"$inside_openmpi" != "xno" -o "$datarootdir" = "\${prefix}/share"],
[datarootdir="$datarootdir/vampirtrace"])
AS_IF([test "$docdir" = "\${datarootdir}/doc/\${PACKAGE_TARNAME}"],
[docdir="\${datarootdir}/doc"])
@ -108,7 +112,6 @@ AC_ARG_ENABLE(fortran,
],
[
check_fortran="no"
F77=
FC=
])
])
@ -116,26 +119,20 @@ AC_ARG_ENABLE(fortran,
# Check for Fortran compiler
AS_IF([test x"$check_fortran" = "xyes"],
[
AS_IF([test x"$F77" = x -a x"$FC" != x], [F77=$FC])
AC_PROG_F77
AS_IF([test x"$F77" = x],
# Exclude F77-only compiler names when searching Fortran compiler
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90])
AS_IF([test x"$FC" = x],
[
AC_MSG_NOTICE([error: no Fortran 77 compiler found])
AC_MSG_NOTICE([error: no Fortran compiler found])
AS_IF([test x"$force_fortran" = "xyes"], [exit 1])
])
AC_PROG_FC
])
AC_LANG([C])
AS_IF([test x"$F77" != x],
[AC_DEFINE([HAVE_F77], [1], [Define to 1 if VT is configured with Fortran 77 support.])])
AM_CONDITIONAL(AMHAVEF77, test x"$F77" != x)
AS_IF([test x"$FC" != x],
[AC_DEFINE([HAVE_F90], [1], [Define to 1 if VT is configured with Fortran 90 support.])])
AM_CONDITIONAL(AMHAVEF90, test x"$FC" != x)
[AC_DEFINE([HAVE_FC], [1], [Define to 1 if VT is configured with Fortran support.])])
AM_CONDITIONAL(AMHAVEFC, test x"$FC" != x)
# Check cross-build related stuff
ACVT_CROSS
@ -239,6 +236,7 @@ AS_IF([test x"$enable_config_titles" = "xyes" -a x"$check_compinst" = "xno"],
AM_CONDITIONAL(AMHAVECOMPINST, test x"$have_compinst" = "xyes")
AM_CONDITIONAL(AMBUILDCOMPINST_GNU, test x"$compinst_type" = "xgnu" -o x"$compinst_type" = "xpgi9")
AM_CONDITIONAL(AMBUILDCOMPINST_PGI, test x"$compinst_type" = "xpgi")
AM_CONDITIONAL(AMBUILDCOMPINST_CRAYCCE, test x"$compinst_type" = "xcraycce")
AM_CONDITIONAL(AMBUILDCOMPINST_PHAT, test x"$compinst_type" = "xsun")
AM_CONDITIONAL(AMBUILDCOMPINST_XL, test x"$compinst_type" = "xxl")
AM_CONDITIONAL(AMBUILDCOMPINST_FTRACE, test x"$compinst_type" = "xnecsx")
@ -381,10 +379,15 @@ AS_IF([test x"$enable_config_titles" = "xyes" -a x"$check_getcpu" = "xno"],
AS_IF([test x"$force_getcpu" = "xyes" -a x"$getcpu_error" = "xyes"], [exit 1])
AM_CONDITIONAL(AMHAVEGETCPU, test x"$have_getcpu" = "xyes")
#Check for NVIDIA CUDA support
# Check for NVIDIA CUDA support
ACVT_CONF_TITLE([NVIDIA CUDA])
#Check for CUDA Toolkit
# Check for symbol demangling support by libiberty
ACVT_CONF_SUBTITLE([Symbol demangling])
ACVT_LIBERTY
AM_CONDITIONAL(AMHAVELIBERTY, test x"$have_liberty" = "xyes")
# Check for CUDA Toolkit
ACVT_CONF_SUBTITLE([CUDA Toolkit])
ACVT_CUDA
AS_IF([test x"$enable_config_titles" = "xyes" -a x"$check_cuda" = "xno"],
@ -436,6 +439,8 @@ ACVT_CONF_TITLE([Open Trace Format (OTF)])
ACVT_OTF
AS_IF([test x"$use_extern_otf" = "xyes" -a x"$otf_error" = "xyes"], [exit 1])
AM_CONDITIONAL(AMEXTERNOTF, test x"$use_extern_otf" = "xyes")
AM_CONDITIONAL(AMHAVEIOFSL, test x"$have_iofsl" = "xyes")
AM_CONDITIONAL(AMBUILDIOFSLSCRIPTS, test x"$have_iofsl" = "xyes" -a x"$IOFSLSCRIPTS" != x)
# Check for capabilities of vtsetup
ACVT_CONF_TITLE([VTSetup])
@ -469,6 +474,10 @@ AC_CONFIG_FILES([Makefile
tools/vtdyn/dynattlib/Makefile
tools/vtfilter/Makefile
tools/vtfilter/mpi/Makefile
tools/vtiofsl/Makefile
tools/vtiofsl/vtiofsl-common
tools/vtiofsl/vtiofsl-start
tools/vtiofsl/vtiofsl-stop
tools/vtjava/Makefile
tools/vtjava/vtjava
tools/vtlibwrapgen/Makefile
@ -485,13 +494,11 @@ AC_CONFIG_FILES([Makefile
tools/vtwrapper/Makefile
tools/vtwrapper/vtcc-wrapper-data.txt
tools/vtwrapper/vtc++-wrapper-data.txt
tools/vtwrapper/vtf77-wrapper-data.txt
tools/vtwrapper/vtf90-wrapper-data.txt
tools/vtwrapper/vtfort-wrapper-data.txt
tools/vtwrapper/vtnvcc-wrapper-data.txt
include/Makefile
include/vt_inttypes.h
doc/Makefile
etc/Makefile
])
# Add MPI wrapper generator scripts to output files
@ -521,6 +528,27 @@ for makefile in $makefile_to_patch; do
mv $makefile.tmp $makefile
done
# Patch the compiler wrapper configuration file for vtnvcc in order to pass
# compiler/linker options directly to the compiler/linker using the option
# -Xcompiler/-Xlinker.
wrapper_data_file="tools/vtwrapper/vtnvcc-wrapper-data.txt"
# keywords containing compiler/linker options
# (<compiler options> -- <linker options>)
wrapper_data_keys="compiler_flags compinst_compiler_flags dyninst_compiler_flags -- linker_flags libs vtlib vtmpilib vtmtlib vthyblib vtpomplib vtdynattlib"
value_prefix="-Xcompiler"
for key in $wrapper_data_keys; do
if test $key = "--"; then
value_prefix="-Xlinker"
else
value=`grep "^$key=" $wrapper_data_file | sed "s/^$key=//;s/^ *//;s/ *$//;s/ \{1,\}/ /g;s/ /,/g"`
if test x"$value" != x; then
sed -e "s@^$key=.*@$key=$value_prefix $value@" $wrapper_data_file >$wrapper_data_file.tmp
mv $wrapper_data_file.tmp $wrapper_data_file
fi
fi
done
# Generate MPI wrappers
AS_IF([test x"$have_mpi" = "xyes"],
[

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

@ -1,20 +1,53 @@
# VampirTrace region filter specification
# VampirTrace function filter specification
#
# call limit definitions and region assignments
# Syntax: <functions> -- <limit> [S:<[min-]max-stack-level>] [R]
# or: <groups> -- <limit> [S:<[min-]max-stack-level>] [R] G
#
# syntax: <regions> -- <limit>
# functions, groups Semicolon-separated list of functions/groups.
# (can contain wildcards)
#
# regions semicolon-seperated list of regions
# (can be wildcards)
# limit assigned call limit
# 0 = region(s) denied
# -1 = unlimited
# limit call limit
# Stop recording of function/group when the specified call
# limit is reached.
# (0 = don't record function/group, -1 = record unlimited)
#
# example:
# S:<[min-]max-stack-level>
# minimum/maximum call stack level
# Don't record function/group called beyond the specified
# stack level boundaries.
# (values must be > 0, only valid if call limit is != 0)
#
# add;sub;mul;div -- 1000
# * -- 3000000
# R Attribute for recursive filtering.
# Don't record callees of filtered function/group.
#
# These region filter directives cause that the functions "add", "sub",
# "mul" and "div" be recorded at most 1000 times. The remaining
# functions (*) will be recorded at most 3000000 times.
# G Attribute for filtering function groups.
#
# Example:
#
# add;sub;mul;div -- 1000
# MATH -- 500 G
# * -- 3000000 S:5-10
#
# These filter directives cause that the functions "add", "sub", "mul", and
# "div" will be recorded at most 1000 times and all the functions of the group
# "MATH" at most 500 times. The remaining functions (*) will only be recorded
# when they are called between call stack level 5 and 10 but at most 3000000
# times.
#
# Rank Specific Filtering:
#
# Use the '@' clauses to restrict all the following filter directives to the
# given ranks. The rank selection must be given as a list of <from> - <to>
# pairs or single values.
# The optional argument "-- OFF" disables the given ranks completely, regardless
# of following filter rules.
#
# Example:
#
# @ 35 - 42 -- OFF
# @ 4 - 10, 20 - 29, 34
# foo;bar -- 2000
# * -- 0
#
# This example defines two limits for the ranks 4 - 10, 20 - 29, and 34. The
# first line disables the ranks 35 - 42 completely.

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

@ -1,18 +1,18 @@
# VampirTrace region groups specification
# VampirTrace function group specification
#
# group definitions and region assignments
# Group definitions and region assignments:
#
# syntax: <group>=<regions>
# Syntax: <group>=<functions>
#
# group group name
# regions semicolon-seperated list of regions
# (can be wildcards)
# regions semicolon-seperated list of functions
# (can contain wildcards)
#
# example:
# Example:
#
# CALC=add;sub;mul;div
# USER=app_*
# MATH=add;sub;mul;div
# USER=app_*
#
# These group assignments make the functions "add", "sub", "mul" and "div"
# associated with group "CALC" and all functions with the prefix "app_" are
# associated with group "USER".
# These group assignments associate the functions "add", "sub", "mul" and "div"
# with group "MATH" and all functions with the prefix "app_" are associated with
# group "USER".

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичные данные
ompi/contrib/vt/vt/doc/UserManual.pdf

Двоичный файл не отображается.

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

@ -1,6 +0,0 @@
vtsysconf_DATA = \
vt-java-default-filter.spec
vtsysconfdir = $(sysconfdir)
EXTRA_DIST = $(vtsysconf_DATA)

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

@ -4,9 +4,12 @@ Johannes Spazier <johannes.spazier AT tu-dresden.de>
Matthias Jurenz <matthias.jurenz AT tu-dresden.de>
Bert Wesarg <bert.wesarg AT tu-dresden.de>
Robert Dietrich <robert.dietrich AT zih.tu-dresden.de>
Jens Doleschal <jens.doleschal AT tu-dresden.de>
Thomas Ilsche <thomas.ilsche AT tu-dresden.de>
Andre Groetzsch <andre.groetzsch AT tu-dresden.de>
Michael Heyde <michael.heyde AT tu-dresden.de>
Michael Kluge <michael.kluge AT tu-dresden.de>
Holger Mickler <holger.mickler AT tu-dresden.de>
Holger Brunst <holger.brunst AT tu-dresden.de>
Johannes Ziegenbalg <johannes.ziegenbalg AT mailbox.tu-dresden.de>
Hartmut Mix <hartmut.mix AT tu-dresden.de>

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

@ -1,20 +1,68 @@
1.10.2openmpi
1.11.1openmpi
- new 'OTF_MasterControl_clone()' function to simplify making a copy
of a master control object
- otfaux:
- keep the stream assignments of the input trace,
when using the '-o' option
- otfmerge[-mpi]:
- keep inline snapshots
1.11goldfish
- added support for highly parallel trace writing using the
I/O Forwarding Scalability Layer (IOFSL) with atomic append
aggregation
- added unique id record
- added new snapshot records which complete them by now
- added new definition record to indicates at which
timestamps are snapshots or statistics available
- new 'OTF_KeyValueList_clone()' function to simplify making a copy
of a key-value list
- updated python interface
- lib OTFAUX:
- learned to generate and read a thumbnail
- learned to generate snapshots
- otfaux:
- uses the new snapshot and thumbnail generating features
from lib OTFAUX
- does not generate statistics by default now (use the new
'--all' option to get the old behavior)
- new '-o' option to make a copy of the trace
- can attach message matching information suitable for Vampir
(requires the '-o' option)
- can produce the new inline snapshots
(requires the '-o' option)
- otfcompress:
- fixed link error using the GNU gold linker
- otfdump:
- fixed '-o' option
- otfmerge[-mpi]:
- fixed merging markers
- otfshrink:
- do not remove definitions of replaced processes
- keep original name of representing process
- otfprofile:
- added support for detecting irregularities and to present
them as markers
1.10.2coelacanth
- otfdump:
- don't abort when reading events fails - the input tracefile
might only have statistics
- otfinfo:
- fixed file size calculation
- otfprofile:
- removed leading '=' from CSV lines to make it loadable into
spreadsheets (e.g. Open Office)
- fixed process naming in CSV output of collective operation
statistics
1.10.1openmpi
1.10.1coelacanth
- fixed build issues in otfprofile[-mpi]:
- added missing header includes for WEXITSTATUS
- moved 'using namespace std' under the header includes to solve
compile error with PGI compiler
1.10openmpi
1.10coelacanth
- added process substitute record
- added process group attribute 'OTF_ATTR_IsCommunicator'
- renamed OTF_fprintf to OTF_Error which sets the error variables

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

@ -6,8 +6,8 @@
# <major>.<minor>.<sub>. If sub is zero, then it is omitted.
major=1
minor=10
sub=2
minor=11
sub=1
# string is used for alpha, beta, or release tags. If it is non-empty, it will
# be appended to the version number.
@ -23,7 +23,8 @@ sub=2
# 1.7.* catfish
# 1.8.* sturgeon
# 1.9.* sawfish
# 1.a.* coelacanth
# 1.10.* coelacanth
# 1.11.* goldfish
#
string=openmpi
@ -48,5 +49,5 @@ string=openmpi
# release, age must be incremented. Otherwise, reset age
# to '0'.
library=4:2:3
library=6:0:5

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

@ -7,5 +7,6 @@ m4_include(config/m4/acinclude.swig_python.m4)
m4_include(config/m4/acinclude.vtf3.m4)
m4_include(config/m4/acinclude.verbose.m4)
m4_include(config/m4/acinclude.zlib.m4)
m4_include(config/m4/acinclude.zoidfs.m4)
m4_include(config/m4/acarchive/ax_mpi.m4)
m4_include(config/m4/acarchive/ax_openmp.m4)

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

@ -0,0 +1,177 @@
dnl have the ZOIDFS dirs specified
AC_DEFUN([CHECK_ZOIDFS],
[
zoidfs_error="no"
check_zoidfs="yes"
force_zoidfs="no"
have_zoidfs="no"
zoidfs_lib_default="-lzoidfsclient -lzoidfs-util -lzoidfshints -liofsl-c-util"
bmi_lib_default="-lbmi -lpthread"
AH_TEMPLATE(HAVE_ZOIDFS, [], [defined if ZOIDFS library is to be used])
AC_ARG_WITH([zoidfs],
AC_HELP_STRING([--with-zoidfs],
[use ZOIDFS, default: yes if found by configure]),
[if test "$withval" = "yes"; then force_zoidfs="yes"; else check_zoidfs="no"; fi])
AC_ARG_WITH([zoidfs-dir],
AC_HELP_STRING([--with-zoidfs-dir],
[give the path for ZOIDFS, default: /usr]),
[zoidfs_dir="$withval/"])
AC_ARG_WITH([zoidfs-inc-dir],
AC_HELP_STRING([--with-zoidfs-inc-dir],
[give the path dir ZOIDFS-include files, default: ZOIDFSDIR/include]),
[zoidfs_inc_dir="$withval/"],
[if test x"$zoidfs_dir" != x; then zoidfs_inc_dir="$zoidfs_dir"include/; fi])
AC_ARG_WITH([zoidfs-lib-dir],
AC_HELP_STRING([--with-zoidfs-lib-dir],
[give the path for ZOIDFS-libraries, default: ZOIDFSDIR/lib]),
[zoidfs_lib_dir="$withval/"],
[if test x"$zoidfs_dir" != x; then zoidfs_lib_dir="$zoidfs_dir"lib/; fi])
AC_ARG_WITH([zoidfs-lib],
AC_HELP_STRING([--with-zoidfs-lib],
[use given ZOIDFS-lib, default: $zoidfs_lib_default BMILIBDIR BMILIB]),
[zoidfs_lib="$withval"])
AC_ARG_WITH([bmi-dir],
AC_HELP_STRING([--with-bmi-dir],
[give the path for BMI, default: ZOIDFSDIR]),
[bmi_dir="$withval/"])
AC_ARG_WITH([bmi-inc-dir],
AC_HELP_STRING([--with-bmi-inc-dir],
[give the path dir BMI-include files, default: BMIDIR/include]),
[bmi_inc_dir="$withval/"],
[if test x"$bmi_dir" != x; then bmi_inc_dir="$bmi_dir"include/; fi])
AC_ARG_WITH([bmi-lib-dir],
AC_HELP_STRING([--with-bmi-lib-dir],
[give the path for BMI-libraries, default: BMIDIR/lib]),
[bmi_lib_dir="$withval/"],
[if test x"$bmi_dir" != x; then bmi_lib_dir="$bmi_dir"lib/; fi])
AC_ARG_WITH([bmi-lib],
AC_HELP_STRING([--with-bmi-lib],
[use given BMI-lib, default: $bmi_lib_default]),
[bmi_lib="$withval"])
if test "$check_zoidfs" = "yes"; then
sav_CPPFLAGS=$CPPFLAGS
if test x"$bmi_inc_dir" != x; then
CPPFLAGS="$CPPFLAGS -I$bmi_inc_dir"
elif test x"$zoidfs_inc_dir" != x; then
CPPFLAGS="$CPPFLAGS -I$zoidfs_inc_dir"
fi
AC_CHECK_HEADER([bmi.h], [],
[
AC_MSG_NOTICE([error: no bmi.h found; check path for BMI package first...])
zoidfs_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
if test x"$bmi_lib" = x -a "$zoidfs_error" = "no"; then
sav_LIBS=$LIBS
cl=$bmi_lib_default
if test x"$bmi_lib_dir" != x; then
cl="-L$bmi_lib_dir $cl"
elif test x"$zoidfs_lib_dir" != x; then
cl="-L$zoidfs_lib_dir $cl"
fi
LIBS="$LIBS $cl"
AC_MSG_CHECKING([whether linking with $bmi_lib_default works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); bmi_lib=$bmi_lib_default],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
fi
if test x"$bmi_lib" = x -a "$zoidfs_error" = "no"; then
AC_MSG_NOTICE([error: no libbmi found; check path for BMI package first...])
zoidfs_error="yes"
fi
if test "$zoidfs_error" = "no"; then
sav_CPPFLAGS=$CPPFLAGS
if test x"$zoidfs_inc_dir" != x; then
CPPFLAGS="$CPPFLAGS -I$zoidfs_inc_dir"
fi
AC_CHECK_HEADER([zoidfs.h], [],
[
AC_MSG_NOTICE([error: no zoidfs.h found; check path for ZOIDFS package first...])
zoidfs_error="yes"
])
AC_CHECK_HEADER([zoidfs-hints.h], [],
[
AC_MSG_NOTICE([error: no zoidfs-hints.h found; check path for ZOIDFS package first...])
zoidfs_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
fi
if test x"$zoidfs_lib" = x -a "$zoidfs_error" = "no"; then
sav_LIBS=$LIBS
cl=$zoidfs_lib_default
if test x"$zoidfs_lib_dir" != x; then
cl="-L$zoidfs_lib_dir $cl"
fi
if test x"$bmi_lib_dir" != x; then
cl="$cl -L$bmi_lib_dir"
fi
cl="$cl $bmi_lib"
LIBS="$LIBS $cl"
AC_MSG_CHECKING([whether linking with $zoidfs_lib_default $bmi_lib works])
AC_TRY_LINK([],[],
[
AC_MSG_RESULT([yes])
zoidfs_lib=$zoidfs_lib_default
],
[
AC_MSG_RESULT([no])
])
LIBS=$sav_LIBS
fi
if test x"$zoidfs_lib" = x -a "$zoidfs_error" = "no"; then
AC_MSG_NOTICE([error: no zoidfs library found; check path for ZOIDFS package first...])
zoidfs_error="yes"
fi
if test $zoidfs_error = "no"; then
AC_DEFINE(HAVE_ZOIDFS)
have_zoidfs="yes"
fi
fi
ZOIDFS_LIB_DIR=$zoidfs_lib_dir
ZOIDFS_INCLUDE_DIR=$zoidfs_inc_dir
BMI_LIB_DIR=$zoidfs_lib_dir
BMI_INCLUDE_DIR=$zoidfs_inc_dir
ZOIDFS_LIB_LINE=$zoidfs_lib
if test x"$zoidfs_lib_dir" != x; then
ZOIDFS_LIB_LINE="-L$zoidfs_lib_dir $ZOIDFS_LIB_LINE"
fi
if test x"$bmi_lib_dir" != x; then
ZOIDFS_LIB_LINE="$ZOIDFS_LIB_LINE -L$bmi_lib_dir"
fi
ZOIDFS_LIB_LINE="$ZOIDFS_LIB_LINE $bmi_lib"
ZOIDFS_INCLUDE_LINE=
if test x"$zoidfs_inc_dir" != x; then
ZOIDFS_INCLUDE_LINE="-I$zoidfs_inc_dir"
fi
if test x"$bmi_inc_dir" != x; then
ZOIDFS_INCLUDE_LINE="$ZOIDFS_INCLUDE_LINE -I$bmi_inc_dir"
fi
AC_SUBST(ZOIDFS_LIB_DIR)
AC_SUBST(ZOIDFS_LIB_LINE)
AC_SUBST(ZOIDFS_INCLUDE_DIR)
AC_SUBST(ZOIDFS_INCLUDE_LINE)
AC_SUBST(BMI_LIB_DIR)
AC_SUBST(BMI_INCLUDE_DIR)
])

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

@ -74,6 +74,11 @@ CHECK_ZLIB
if test x"$force_zlib" = "xyes" -a x"$zlib_error" = "xyes"; then exit 1; fi
AM_CONDITIONAL(AMHAVEZLIB, test x"$have_zlib" = xyes)
# Checks for zoidfs support.
CHECK_ZOIDFS
if test x"$force_zoidfs" = "xyes" -a x"$zoidfs_error" = "xyes"; then exit 1; fi
AM_CONDITIONAL(AMHAVEZOIDFS, test x"$have_zoidfs" = xyes)
# Checks for math library.
CHECK_MATH
@ -92,7 +97,7 @@ WITH_VERBOSE
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/param.h sys/select.h sys/time.h unistd.h])
AC_CHECK_HEADERS([ctype.h fcntl.h stddef.h stdlib.h string.h sys/param.h sys/select.h sys/time.h unistd.h])
AC_CHECK_HEADER([stdint.h], [have_stdint_h=1], [have_stdint_h=0])
AC_CHECK_HEADER([inttypes.h], [have_inttypes_h=1], [have_inttypes_h=0])
AC_SUBST([have_stdint_h])
@ -157,7 +162,6 @@ AC_CONFIG_FILES([Makefile
tests/generic_streams-mpi/Makefile
tests/progress/Makefile
tests/read_from_buffer/Makefile
tests/thumbnail/Makefile
docu/Makefile
])

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

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

@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libotf", "otflib\libotf_vs08.vcproj", "{6B9B49C9-75CD-400D-B736-5EACA04D0A82}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libotfaux", "otfauxlib\libotfaux_vs08.vcproj", "{6B9B49C9-75CD-400D-B736-5EACA04D0A83}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "otfaux", "tools\otfaux\otfaux_vs08.vcproj", "{24587836-ED5E-49DF-A7AD-419FDC208C08}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "otfcompress", "tools\otfcompress\otfcompress_vs08.vcproj", "{B6BBC220-1492-4BEA-A299-9D062133ABAA}"

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

@ -1,8 +1,11 @@
include_HEADERS = otfaux.h \
OTFAUX_State.h \
OTFAUX_MsgMatching.h \
OTFAUX_Thumbnail.h
noinst_HEADERS =
noinst_HEADERS = OTFAUX_SharedState.h \
OTFAUX_Process.h \
OTFAUX_Stack.h
lib_LTLIBRARIES = libotfaux.la
@ -16,6 +19,9 @@ libotfaux_la_CFLAGS = -prefer-pic
libotfaux_la_LIBADD = $(top_builddir)/vendor/jenkins_hash/libjenkins_hash.la
libotfaux_la_SOURCES = \
OTFAUX_MsgMatching.c \
OTFAUX_Thumbnail.c
OTFAUX_Thumbnail.c \
OTFAUX_Process.c \
OTFAUX_State.c
EXTRA_DIST =
EXTRA_DIST = \
libotfaux_vs08.vcproj

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

@ -1,4 +1,6 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stddef.h>
@ -6,173 +8,18 @@
#include <otf.h>
#include <jenkins_hash.h>
#include "otfaux.h"
typedef struct OTFAUX_MsgMatching_Recv {
/** next in queue */
struct OTFAUX_MsgMatching_Recv* next;
uint64_t time;
uint32_t size, scl;
} OTFAUX_MsgMatching_Recv;
typedef struct OTFAUX_MsgMatching_Queue {
/** for hash chaining */
struct OTFAUX_MsgMatching_Queue* next;
uint64_t sender, receiver;
uint32_t tag, comm;
/** cached hash value of this queue */
uint32_t hash;
/** queue of receives */
OTFAUX_MsgMatching_Recv* head;
OTFAUX_MsgMatching_Recv** tail;
} OTFAUX_MsgMatching_Queue;
#define QUEUE_HASH_SHIFT 10
#define QUEUE_HASH_SIZE (1 << QUEUE_HASH_SHIFT)
#define QUEUE_HASH_MASK (QUEUE_HASH_SIZE - 1)
struct OTFAUX_MsgMatching_Context {
/** The messages queues, identified by the quadtrupel
(sender, receiver, tag, comm) */
OTFAUX_MsgMatching_Queue* queues[ QUEUE_HASH_SIZE ];
/** unused OTFAUX_MsgMatching_Recv objects */
OTFAUX_MsgMatching_Recv* free_list;
};
OTFAUX_MsgMatching_Context*
OTFAUX_MsgMatching_create( void )
{
OTFAUX_MsgMatching_Context* new_context = calloc( 1, sizeof( *new_context ) );
/* nothing to initialize */
return new_context;
}
static void
free_recv_list( OTFAUX_MsgMatching_Recv** recv_list )
{
while ( *recv_list )
{
OTFAUX_MsgMatching_Recv* next = ( *recv_list )->next;
free( *recv_list );
*recv_list = next;
}
return OTFAUX_State_create();
}
void
OTFAUX_MsgMatching_destroy( OTFAUX_MsgMatching_Context* mm_context )
{
int i;
for ( i = 0; i < QUEUE_HASH_SIZE; i++ )
{
while ( mm_context->queues[ i ] )
{
OTFAUX_MsgMatching_Queue* next = mm_context->queues[ i ]->next;
free_recv_list( &mm_context->queues[ i ]->head );
free( mm_context->queues[ i ] );
mm_context->queues[ i ] = next;
}
}
free_recv_list( &mm_context->free_list );
free( mm_context );
}
/* hashing of queues */
static uint32_t
hash_queue( uint64_t sender,
uint64_t receiver,
uint32_t tag,
uint32_t comm )
{
uint32_t queue_hash = 0;
queue_hash += hash( &sender, sizeof( sender ), queue_hash );
queue_hash += hash( &receiver, sizeof( receiver ), queue_hash );
queue_hash += hash( &tag, sizeof( tag ), queue_hash );
queue_hash += hash( &comm, sizeof( comm ), queue_hash );
return queue_hash;
}
static OTFAUX_MsgMatching_Queue*
create_queue( uint32_t queue_hash,
uint64_t sender,
uint64_t receiver,
uint32_t tag,
uint32_t comm )
{
OTFAUX_MsgMatching_Queue* new_queue = calloc( 1, sizeof( *new_queue ) );
if ( new_queue )
{
/* store queue atttributes */
new_queue->sender = sender;
new_queue->receiver = receiver;
new_queue->tag = tag;
new_queue->comm = comm;
/* cache hash value for this queue */
new_queue->hash = queue_hash;
/* initialize the recv queue */
new_queue->tail = &new_queue->head;
}
return new_queue;
}
static OTFAUX_MsgMatching_Queue*
get_queue( OTFAUX_MsgMatching_Context* mm_context,
uint64_t sender,
uint64_t receiver,
uint32_t tag,
uint32_t comm,
int create )
{
uint32_t queue_hash = hash_queue( sender, receiver, tag, comm );
OTFAUX_MsgMatching_Queue** queue_bucket = &mm_context->queues[ queue_hash & QUEUE_HASH_MASK ];
OTFAUX_MsgMatching_Queue* queue = *queue_bucket;
/* search in hash chain */
while ( queue )
{
if ( queue->hash == queue_hash
&& queue->sender == sender
&& queue->receiver == receiver
&& queue->tag == tag
&& queue->comm == comm )
{
/* found */
return queue;
}
queue = queue->next;
}
if ( create )
{
queue = create_queue( queue_hash, sender, receiver, tag, comm );
if ( !queue )
{
return NULL;
}
/* chain into hash table */
queue->next = *queue_bucket;
*queue_bucket = queue;
}
return queue;
OTFAUX_State_destroy( mm_context );
}
void
@ -185,32 +32,14 @@ OTFAUX_MsgMatching_enqueueRecv( OTFAUX_MsgMatching_Context* mm_context,
uint32_t size,
uint32_t scl )
{
OTFAUX_MsgMatching_Queue* queue;
OTFAUX_MsgMatching_Recv* new_recv;
/* create this queue if its not present */
queue = get_queue( mm_context, sender, receiver, tag, comm, 1 );
/* create new recv entry, use free_list if possible */
if ( mm_context->free_list )
{
new_recv = mm_context->free_list;
mm_context->free_list = new_recv->next;
new_recv->next = NULL;
} else {
new_recv = calloc( 1, sizeof( *new_recv ) );
if ( !new_recv )
{
return;
}
}
new_recv->time = time;
new_recv->size = size;
new_recv->scl = scl;
/* enqueue recv into queue */
*queue->tail = new_recv;
queue->tail = &new_recv->next;
OTFAUX_State_enqueueRecvMsg( mm_context,
time,
receiver,
sender,
comm,
tag,
size,
scl );
}
int
@ -223,73 +52,28 @@ OTFAUX_MsgMatching_matchSend( OTFAUX_MsgMatching_Context* mm_context,
uint32_t* psize,
uint32_t* pscl )
{
OTFAUX_MsgMatching_Queue* queue;
OTFAUX_MsgMatching_Recv* recv;
/* don't create this queue if its not present */
queue = get_queue( mm_context, sender, receiver, tag, comm, 0 );
/* no queue -> no recv || no recv in queue */
if ( !queue || !queue->head )
{
return 0;
}
/* unqeue recv */
recv = queue->head;
queue->head = recv->next;
if ( !queue->head )
{
queue->tail = &queue->head;
}
if ( ptime )
{
*ptime = recv->time;
}
if ( psize )
{
*psize = recv->size;
}
if ( pscl )
{
*pscl = recv->scl;
}
/* put the now unused recv object into free list */
recv->next = mm_context->free_list;
mm_context->free_list = recv;
return 1;
/*
* return 0 if no matching receive was found,
* which is 2 from OTFAUX_State_processSendMsg
*/
return 1 == OTFAUX_State_processSendMsg( mm_context,
0,
sender,
receiver,
comm,
tag,
0,
0,
ptime,
psize,
pscl,
NULL );
}
/** release empty queues and recv in free list */
void
OTFAUX_MsgMatching_releaseMemory( OTFAUX_MsgMatching_Context* mm_context )
{
int i;
for ( i = 0; i < QUEUE_HASH_SIZE; i++ )
{
OTFAUX_MsgMatching_Queue* full_queue = NULL;
OTFAUX_MsgMatching_Queue* queue = mm_context->queues[ i ];
while ( queue )
{
OTFAUX_MsgMatching_Queue* next = queue->next;
/* release this queue if no recv are enqueued */
if ( queue->head )
{
queue->next = full_queue;
full_queue = queue;
}
else
{
free( queue );
}
queue = next;
}
mm_context->queues[ i ] = full_queue;
}
free_recv_list( &mm_context->free_list );
( void )mm_context;
/* nothing to do */
}

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

@ -3,6 +3,8 @@
#include <otf.h>
#include <OTFAUX_State.h>
/**
* @file otfauxlib/OTFAUX_MsgMatching.h
*
@ -20,7 +22,7 @@ extern "C" {
*/
/** Opaque type for using the matching module. */
typedef struct OTFAUX_MsgMatching_Context OTFAUX_MsgMatching_Context;
typedef OTFAUX_State OTFAUX_MsgMatching_Context;
/** Create a context for matching messages. */
OTFAUX_MsgMatching_Context* OTFAUX_MsgMatching_create( void );

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,199 @@
#ifndef OTFAUX_PROCESS_H
#define OTFAUX_PROCESS_H
#include "OTFAUX_SharedState.h"
#include "OTFAUX_Stack.h"
#define QUEUE_HASH_SHIFT 10
#define QUEUE_HASH_SIZE (1 << QUEUE_HASH_SHIFT)
#define QUEUE_HASH_MASK (QUEUE_HASH_SIZE - 1)
#define COLLOPCOUNT_HASH_SHIFT 8
#define COLLOPCOUNT_HASH_SIZE (1 << COLLOPCOUNT_HASH_SHIFT)
#define COLLOPCOUNT_HASH_MASK (COLLOPCOUNT_HASH_SIZE - 1)
#define COUNTER_HASH_SHIFT 4
#define COUNTER_HASH_SIZE (1 << COUNTER_HASH_SHIFT)
#define COUNTER_HASH_MASK (COUNTER_HASH_SIZE - 1)
typedef struct OTFAUX_ReciveQueue OTFAUX_ReciveQueue;
typedef struct OTFAUX_CollOpCount OTFAUX_CollOpCount;
typedef struct OTFAUX_Counter OTFAUX_Counter;
typedef struct OTFAUX_Process OTFAUX_Process;
struct OTFAUX_Process
{
/* For hash chaining in OTFAUX_State */
OTFAUX_Process* next;
uint64_t id;
uint32_t* thumbnail;
/* function stack */
Stack functionStack;
/* cache of recived messages */
OTFAUX_ReciveQueue* receiveQueues[ QUEUE_HASH_SIZE ];
/* list of pending messages */
Stack pendingSends;
/* list of open files */
Stack openFiles;
/* map of begun collective operations */
Stack pendingCollOps;
/* cache of recived messages */
OTFAUX_CollOpCount* collOpCounts[ COLLOPCOUNT_HASH_SIZE ];
/* unfinished file operations */
Stack pendingFileOps;
/* last value of counter */
OTFAUX_Counter* counters[ COUNTER_HASH_SIZE ];
/* Shared data among all processes from the OTFAUX_State */
OTFAUX_SharedState* sharedState;
};
OTFAUX_Process*
OTFAUX_Process_create( uint64_t processId,
OTFAUX_SharedState* sharedState );
void
OTFAUX_Process_destroy( OTFAUX_Process* process );
int
OTFAUX_Process_enableThumbnail( OTFAUX_Process* process,
uint32_t thumbnailSize );
void
OTFAUX_Process_updateThumbnail( OTFAUX_Process* process,
uint32_t timestampsPosition );
void
OTFAUX_Process_writeThumbnail( OTFAUX_Process* process,
uint32_t timestampsSize,
FILE* out );
int
OTFAUX_Process_enqueueRecv( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t receiverProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl );
int
OTFAUX_Process_enterFunction( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t function,
uint32_t scl,
void* eventData );
int
OTFAUX_Process_leaveFunction( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t function );
int
OTFAUX_Process_sendMessage( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t receiverProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl,
uint64_t* recvTime,
uint32_t* recvLength,
uint32_t* recvScl,
void* eventData );
int
OTFAUX_Process_beginCollOp( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t comm,
uint32_t root,
uint32_t collOp,
uint64_t matchingId,
uint64_t bytesSent,
uint64_t bytesRecv,
uint32_t scl,
void* eventData );
int
OTFAUX_Process_endCollOp( OTFAUX_Process* process,
uint64_t eventTime,
uint64_t matchingId );
int
OTFAUX_Process_countCollOp( OTFAUX_Process* process,
uint32_t comm );
int
OTFAUX_Process_openFile( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t fileId,
uint64_t handleId,
uint32_t scl,
void* eventData );
int
OTFAUX_Process_closeFile( OTFAUX_Process* process,
uint64_t eventTime,
uint64_t handleId );
int
OTFAUX_Process_beginFileOp( OTFAUX_Process* process,
uint64_t eventTime,
uint64_t matchingId,
uint32_t scl,
void* eventData );
int
OTFAUX_Process_endFileOp( OTFAUX_Process* process,
uint64_t eventTime,
uint64_t matchingId );
int
OTFAUX_Process_updateCounter( OTFAUX_Process* process,
uint64_t eventTime,
uint32_t counterId,
uint64_t value,
void* eventData );
int
OTFAUX_Process_writeStack( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
int
OTFAUX_Process_writeSends( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
int
OTFAUX_Process_writeOpenFiles( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
int
OTFAUX_Process_writeCollOps( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
int
OTFAUX_Process_writeFileOps( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
int
OTFAUX_Process_writeCounters( OTFAUX_Process* process,
uint64_t snapshotTime,
void* userData );
#endif /* OTFAUX_PROCESS_H */

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

@ -0,0 +1,36 @@
#ifndef OTFAUX_SHARED_STATE_H
#define OTFAUX_SHARED_STATE_H 1
#include "OTFAUX_Stack.h"
typedef struct OTFAUX_SharedState OTFAUX_SharedState;
struct OTFAUX_SharedState
{
/* unused OTFAUX_FunctionCall objects */
Stack functionCalls;
/* unused OTFAUX_File objects */
Stack files;
/* unused OTFAUX_CollOp objects */
Stack collOps;
/* unused OTFAUX_FileOps objects */
Stack fileOps;
/* Snapshot writing callbacks */
OTFAUX_WriteEnterSnapshotCallback writeEnterSnapshot;
OTFAUX_WriteSendSnapshotCallback writeSendSnapshot;
OTFAUX_WriteOpenFileSnapshotCallback writeOpenFileSnapshot;
OTFAUX_WriteBeginCollopSnapshotCallback writeBeginCollopSnapshot;
OTFAUX_WriteBeginFileOpSnapshotCallback writeBeginFileOpSnapshot;
OTFAUX_WriteCollopCountSnapshotCallback writeCollopCountSnapshot;
OTFAUX_WriteCounterSnapshotCallback writeCounterSnapshot;
/* user provided callback to release an event data */
OTFAUX_ReleaseEventData releaseEventData;
void* userDataForReleaseEventData;
};
#endif /* OTFAUX_SHARED_STATE_H */

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

@ -0,0 +1,84 @@
#ifndef OTFAUX_STACK_H
#define OTFAUX_STACK_H 1
#include <stdlib.h>
typedef struct Stack
{
struct Stack* prev;
struct Stack* next;
} Stack;
static void
stack_init( Stack* stack )
{
stack->next = stack;
stack->prev = stack;
}
static Stack*
stack_next( Stack* stack )
{
return stack->next;
}
static Stack*
stack_prev( Stack* stack )
{
return stack->prev;
}
static void
stack_remove( Stack* stack )
{
stack->prev->next = stack->next;
stack->next->prev = stack->prev;
stack_init( stack );
}
static Stack*
stack_pop( Stack* stack )
{
Stack* pop = stack->next;
if ( pop == stack )
return NULL;
stack_remove( pop );
return pop;
}
static int
stack_empty( Stack* stack )
{
return stack == stack->next;
}
static void
stack_push( Stack* stack, Stack* entry )
{
entry->next = stack->next;
entry->prev = stack;
stack->next->prev = entry;
stack->next = entry;
}
static void
stack_add( Stack* stack, Stack* entry )
{
entry->prev = stack->prev;
entry->next = stack;
stack->prev->next = entry;
stack->prev = entry;
}
#endif /* OTFAUX_STACK_H */

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

@ -0,0 +1,758 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
#include <otf.h>
#include <jenkins_hash.h>
#include "OTFAUX_State.h"
#include "OTFAUX_Process.h"
#include "OTFAUX_SharedState.h"
#include "OTFAUX_Thumbnail.h"
#define PROCESSES_HASH_SHIFT 10
#define PROCESSES_HASH_SIZE (1 << PROCESSES_HASH_SHIFT)
#define PROCESSES_HASH_MASK (PROCESSES_HASH_SIZE - 1)
struct OTFAUX_State
{
/** The processes */
OTFAUX_Process* processes[ PROCESSES_HASH_SIZE ];
/** sampling timestamps */
uint32_t timestampsSize, timestampsPosition;
uint64_t* timestamps;
OTFAUX_SharedState sharedState;
};
OTFAUX_State*
OTFAUX_State_create( void )
{
OTFAUX_State* new_state = NULL;
/* Please unused funciton warning */
( void )stack_next;
( void )stack_prev;
( void )stack_empty;
( void )stack_push;
( void )stack_add;
new_state = calloc( 1, sizeof( *new_state ) );
if ( !new_state )
return NULL;
stack_init( &new_state->sharedState.functionCalls );
stack_init( &new_state->sharedState.files );
stack_init( &new_state->sharedState.collOps );
stack_init( &new_state->sharedState.fileOps );
return new_state;
}
void
OTFAUX_State_destroy( OTFAUX_State* auxState )
{
int i;
Stack* entry;
for ( i = 0; i < PROCESSES_HASH_SIZE; i++ )
{
while ( auxState->processes[ i ] )
{
OTFAUX_Process* next = auxState->processes[ i ]->next;
OTFAUX_Process_destroy( auxState->processes[ i ] );
auxState->processes[ i ] = next;
}
}
while ( ( entry = stack_pop( &auxState->sharedState.functionCalls ) ) )
{
/* entries do not have eventData attached */
free( entry );
}
while ( ( entry = stack_pop( &auxState->sharedState.files ) ) )
{
/* entries do not have eventData attached */
free( entry );
}
while ( ( entry = stack_pop( &auxState->sharedState.collOps ) ) )
{
/* entries do not have eventData attached */
free( entry );
}
while ( ( entry = stack_pop( &auxState->sharedState.fileOps ) ) )
{
/* entries do not have eventData attached */
free( entry );
}
free( auxState->timestamps );
free( auxState );
}
int
OTFAUX_State_setupThumbnail( OTFAUX_State* auxState,
uint64_t minTime,
uint64_t maxTime,
uint32_t width )
{
uint64_t timeDiff;
double timeStep;
uint32_t i;
if ( width == 0 || minTime >= maxTime || ( maxTime - minTime ) < width )
return 0;
auxState->timestamps = calloc( width, sizeof( uint64_t ) );
if ( !auxState->timestamps )
{
return 0;
}
/* callculate sample time stamps */
timeDiff = maxTime - minTime;
timeStep = ( double )timeDiff / ( double )width;
auxState->timestampsSize = width;
auxState->timestampsPosition = 0;
for ( i = 0; i < width; ++i )
{
auxState->timestamps[ i ] = minTime + i * timeStep;
}
return 1;
}
static OTFAUX_Process*
get_process( OTFAUX_State* auxState, uint64_t processId )
{
uint32_t process_hash;
OTFAUX_Process** process_bucket;
OTFAUX_Process* process;
process_hash = hash( &processId, sizeof( processId ), 0 );
process_bucket = &auxState->processes[ process_hash & PROCESSES_HASH_MASK ];
process = *process_bucket;
/* search in hash chain */
while ( process )
{
if ( process->id == processId )
{
/* found, is this an error? */
return process;
}
process = process->next;
}
/* create new process */
process = OTFAUX_Process_create( processId, &auxState->sharedState );
if ( !process )
return NULL;
/* chain into hash table */
process->next = *process_bucket;
*process_bucket = process;
return process;
}
static void
update_thumbnail( OTFAUX_State* auxState, uint64_t timestamp )
{
if ( !auxState || !auxState->timestamps )
return;
if ( auxState->timestampsPosition == auxState->timestampsSize )
return;
while ( auxState->timestampsPosition < auxState->timestampsSize
&& auxState->timestamps[ auxState->timestampsPosition ] < timestamp )
{
int i;
for ( i = 0; i < PROCESSES_HASH_SIZE; i++ )
{
OTFAUX_Process* process = auxState->processes[i];
while ( process )
{
OTFAUX_Process_updateThumbnail( process,
auxState->timestampsPosition );
process = process->next;
}
}
auxState->timestampsPosition++;
}
}
int
OTFAUX_State_declareProcess( OTFAUX_State* auxState,
uint64_t processId,
int isThumbnailProcess )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
if ( isThumbnailProcess )
return OTFAUX_Process_enableThumbnail( process,
auxState->timestampsSize );
return 1;
}
int
OTFAUX_State_setReleaseEventDataCallback( OTFAUX_State* auxState,
OTFAUX_ReleaseEventData releaseEventDataCallback,
void* userData )
{
if ( !auxState )
return 0;
auxState->sharedState.releaseEventData = releaseEventDataCallback;
auxState->sharedState.userDataForReleaseEventData = userData;
return 1;
}
int
OTFAUX_State_setWriteEnterSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteEnterSnapshotCallback writeEnterSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeEnterSnapshot = writeEnterSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteSendSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteSendSnapshotCallback writeSendSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeSendSnapshot = writeSendSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteOpenFileSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteOpenFileSnapshotCallback writeOpenFileSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeOpenFileSnapshot = writeOpenFileSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteBeginCollopSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteBeginCollopSnapshotCallback writeBeginCollopSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeBeginCollopSnapshot = writeBeginCollopSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteBeginFileOpSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteBeginFileOpSnapshotCallback writeBeginFileOpSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeBeginFileOpSnapshot = writeBeginFileOpSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteCollopCountSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteCollopCountSnapshotCallback writeCollopCountSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeCollopCountSnapshot = writeCollopCountSnapshotCallback;
return 1;
}
int
OTFAUX_State_setWriteCounterSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteCounterSnapshotCallback writeCounterSnapshotCallback )
{
if ( !auxState )
return 0;
auxState->sharedState.writeCounterSnapshot = writeCounterSnapshotCallback;
return 1;
}
int
OTFAUX_State_enqueueRecvMsg( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t receiverProcessId,
uint64_t senderProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, senderProcessId );
if ( !process )
return 0;
return OTFAUX_Process_enqueueRecv( process,
eventTime,
receiverProcessId,
comm,
tag,
length,
scl );
}
int
OTFAUX_State_processEnter( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t function,
uint32_t scl,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
update_thumbnail( auxState, eventTime );
return OTFAUX_Process_enterFunction( process,
eventTime,
function,
scl,
eventData );
}
int
OTFAUX_State_processLeave( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t function )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
update_thumbnail( auxState, eventTime );
return OTFAUX_Process_leaveFunction( process,
eventTime,
function );
}
int
OTFAUX_State_processSendMsg( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t senderProcessId,
uint64_t receiverProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl,
uint64_t* recvTime,
uint32_t* recvLength,
uint32_t* recvScl,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, senderProcessId );
if ( !process )
return 0;
return OTFAUX_Process_sendMessage( process,
eventTime,
receiverProcessId,
comm,
tag,
length,
scl,
recvTime,
recvLength,
recvScl,
eventData );
}
int
OTFAUX_State_processBeginCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t comm,
uint32_t root,
uint32_t collOp,
uint64_t matchingId,
uint64_t bytesSent,
uint64_t bytesRecv,
uint32_t scl,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_beginCollOp( process,
eventTime,
comm,
root,
collOp,
matchingId,
bytesSent,
bytesRecv,
scl,
eventData );
}
int
OTFAUX_State_processEndCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_endCollOp( process,
eventTime,
matchingId );
}
int
OTFAUX_State_processCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t comm,
uint32_t root,
uint32_t collOp,
uint64_t bytesSent,
uint64_t bytesRecv,
uint32_t scl )
{
OTFAUX_Process* process;
( void )eventTime;
( void )processId;
( void )root;
( void )collOp;
( void )bytesSent;
( void )bytesRecv;
( void )scl;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_countCollOp( process,
comm );
}
int
OTFAUX_State_processFileOpen( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t fileId,
uint64_t handleId,
uint32_t scl,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_openFile( process,
eventTime,
fileId,
handleId,
scl,
eventData );
}
int
OTFAUX_State_processFileClose( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t handleId )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_closeFile( process,
eventTime,
handleId );
}
int
OTFAUX_State_processBeginFileOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId,
uint32_t scl,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_beginFileOp( process,
eventTime,
matchingId,
scl,
eventData );
}
int
OTFAUX_State_processEndFileOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_endFileOp( process,
eventTime,
matchingId );
}
int
OTFAUX_State_processCounter( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t counterId,
uint64_t value,
void* eventData )
{
OTFAUX_Process* process;
if ( !auxState )
return 0;
process = get_process( auxState, processId );
if ( !process )
return 0;
return OTFAUX_Process_updateCounter( process,
eventTime,
counterId,
value,
eventData );
}
int
OTFAUX_State_writeSnapshot( OTFAUX_State* auxState,
uint64_t snapshotTime,
void* userData )
{
int i, ret = 1;
for ( i = 0; ret && i < PROCESSES_HASH_SIZE; i++ )
{
OTFAUX_Process* process = auxState->processes[ i ];
while ( ret && process )
{
ret = ret && OTFAUX_Process_writeStack( process,
snapshotTime,
userData );
ret = ret && OTFAUX_Process_writeSends( process,
snapshotTime,
userData );
ret = ret && OTFAUX_Process_writeOpenFiles( process,
snapshotTime,
userData );
ret = ret && OTFAUX_Process_writeCollOps( process,
snapshotTime,
userData );
ret = ret && OTFAUX_Process_writeFileOps( process,
snapshotTime,
userData );
ret = ret && OTFAUX_Process_writeCounters( process,
snapshotTime,
userData );
process = process->next;
}
}
return ret;
}
int
OTFAUX_State_writeThumbnail( OTFAUX_State* auxState,
const char* namestub,
int create,
... )
{
int ret = 1;
char* filename;
FILE* file;
int i;
if ( !namestub || !auxState || !auxState->timestamps )
return 0;
/* finalize thumbnail sample points with one past the last timestamp */
update_thumbnail( auxState,
auxState->timestamps[ auxState->timestampsSize - 1 ] + 1 );
filename = OTFAUX_Thumbnail_getFilename( namestub );
if ( !filename )
return 0;
file = fopen( filename, create ? "w" : "a" );
free( filename );
if ( !file )
{
return 0;
}
/* write header */
if ( create ) {
uint32_t total_number_of_procs;
va_list args;
va_start( args, create );
total_number_of_procs = va_arg( args, uint32_t );
va_end( args );
fprintf( file, "0:%x,%x\n",
auxState->timestampsSize,
total_number_of_procs );
}
/* write processes */
for ( i = 0; i < PROCESSES_HASH_SIZE; i++ )
{
OTFAUX_Process* process = auxState->processes[ i ];
while ( process )
{
OTFAUX_Process_writeThumbnail( process,
auxState->timestampsSize,
file );
process = process->next;
}
}
ret = !ferror( file );
fclose( file );
return ret;
}

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

@ -0,0 +1,371 @@
#ifndef OTFAUX_STATE_H
#define OTFAUX_STATE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OTFAUX_State OTFAUX_State;
OTFAUX_State*
OTFAUX_State_create( void );
void
OTFAUX_State_destroy( OTFAUX_State* auxState );
/**
* Create a context for thumbnail generation.
*
* @param minTime Minimum timestamp of the trace file.
* @param maxTime Maximum timestamp of the trace file.
* @param width The width in pixels of the thumbnail.
*
* @return 1 on success.
*/
int
OTFAUX_State_setupThumbnail( OTFAUX_State* auxState,
uint64_t minTime,
uint64_t maxTime,
uint32_t width );
/**
* Only for processes declared with this function and isThumbnailProcess set
* record a thumbnail.
*
* @return 1 on success.
*/
int
OTFAUX_State_declareProcess( OTFAUX_State* auxState,
uint64_t processId,
int isThumbnailProcess );
/**
* Provide a release function for per-event data passed viw the @a eventData
* parameter.
*
* @return 1 on success.
*
* @{
*/
typedef void
( *OTFAUX_ReleaseEventData )( void* userData,
void* eventData );
int
OTFAUX_State_setReleaseEventDataCallback( OTFAUX_State* auxState,
OTFAUX_ReleaseEventData releaseEventDataCallback,
void* userData );
/**
* @}
*/
/**
* Provide callbacks when a snapshot will be triggered.
*
* @return 1 on success.
*
* @{
*/
typedef int
( *OTFAUX_WriteEnterSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint32_t function,
uint32_t scl,
void* eventData );
int
OTFAUX_State_setWriteEnterSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteEnterSnapshotCallback writeEnterSnapshotCallback );
typedef int
( *OTFAUX_WriteSendSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t senderProcessId,
uint64_t receiverProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl,
uint64_t recvTime,
uint32_t recvLength,
uint32_t recvScl,
void* eventData );
int
OTFAUX_State_setWriteSendSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteSendSnapshotCallback writeSendSnapshotCallback );
typedef int
( *OTFAUX_WriteOpenFileSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint32_t fileId,
uint64_t handleId,
uint32_t scl,
void* eventData );
int
OTFAUX_State_setWriteOpenFileSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteOpenFileSnapshotCallback writeOpenFileSnapshotCallback );
typedef int
( *OTFAUX_WriteBeginCollopSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint32_t collOp,
uint64_t matchingId,
uint32_t comm,
uint32_t root,
uint64_t sent,
uint64_t received,
uint32_t scl,
void* eventData );
int
OTFAUX_State_setWriteBeginCollopSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteBeginCollopSnapshotCallback writeBeginCollopSnapshotCallback );
typedef int
( *OTFAUX_WriteBeginFileOpSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId,
uint32_t scl,
void* eventData );
int
OTFAUX_State_setWriteBeginFileOpSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteBeginFileOpSnapshotCallback writeBeginFileOpSnapshotCallback );
typedef int
( *OTFAUX_WriteCollopCountSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t processId,
uint32_t comm,
uint64_t count );
int
OTFAUX_State_setWriteCollopCountSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteCollopCountSnapshotCallback writeCollopCountSnapshotCallback );
typedef int
( *OTFAUX_WriteCounterSnapshotCallback )( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint32_t counter,
uint64_t value,
void* eventData );
int
OTFAUX_State_setWriteCounterSnapshotCallback( OTFAUX_State* auxState,
OTFAUX_WriteCounterSnapshotCallback writeCounterSnapshotCallback );
/**
* @}
*/
/**
* Provide all receive events a-priori before any other sends.
*
* @return 1 on success.
*/
int
OTFAUX_State_enqueueRecvMsg( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t receiverProcessId,
uint64_t senderProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl );
/**
* @group Event input functions.
*
* Should be called from an event handler when reading the trace.
*
* @return 1 on success.
* 2 when no matching receive was available
* (for @a OTFAUX_State_processSendMsg())
*
* @{
*/
int
OTFAUX_State_processEnter( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t function,
uint32_t scl,
void* eventData );
int
OTFAUX_State_processLeave( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t function );
int
OTFAUX_State_processSendMsg( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t senderProcessId,
uint64_t receiverProcessId,
uint32_t comm,
uint32_t tag,
uint32_t length,
uint32_t scl,
uint64_t* recvTime,
uint32_t* recvLength,
uint32_t* recvScl,
void* eventData );
int
OTFAUX_State_processBeginCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t comm,
uint32_t root,
uint32_t collOp,
uint64_t matchingId,
uint64_t bytesSent,
uint64_t bytesRecv,
uint32_t scl,
void* eventData );
int
OTFAUX_State_processEndCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId );
int
OTFAUX_State_processCollectiveOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t comm,
uint32_t root,
uint32_t collOp,
uint64_t bytesSent,
uint64_t bytesRecv,
uint32_t scl );
int
OTFAUX_State_processFileOpen( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t fileId,
uint64_t handleId,
uint32_t scl,
void* eventData );
int
OTFAUX_State_processFileClose( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t handleId );
int
OTFAUX_State_processBeginFileOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId,
uint32_t scl,
void* eventData );
/*
* Also call OTFAUX_State_processFileOpen or OTFAUX_State_processFileClose
* if the operation was an open or close, respectivly.
*/
int
OTFAUX_State_processEndFileOperation( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint64_t matchingId );
int
OTFAUX_State_processCounter( OTFAUX_State* auxState,
uint64_t eventTime,
uint64_t processId,
uint32_t counterId,
uint64_t value,
void* eventData );
/**
* @}
*/
/**
* Trigger snapshot writing.
*
* @return 1 on success.
*/
int
OTFAUX_State_writeSnapshot( OTFAUX_State* auxState,
uint64_t snapshotTime,
void* userData );
/**
* Writes the processes data of the context to a file.
*
* The writing is designed so that the data of multuiple contexts can be
* written to one file to form a thumbnail. The @a create parameter alows
* this. The writing of the first context should set the @a create
* parameter and provide in the variable argument list the total number of
* processes which will be written, over all comming contexts as an uint32_t.
* If the @a create parameter is not set, no file will be created and no
* header will be written, only the data from the given context will be
* appended to the file. The width of the file should match the width of this
* context.
*
* @param tn_context The context.
* @param namestub The name of the file.
* @param create Create the thumb file, or append.
* @param ... The total number of processes as an uint32_t, if @a
* create is set.
*
* @return 1 on success.
*/
int
OTFAUX_State_writeThumbnail( OTFAUX_State* auxState,
const char* namestub,
int create,
... );
#ifdef __cplusplus
}
#endif
#endif /* OTFAUX_STATE_H */

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

@ -1,8 +1,11 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
#include <otf.h>
@ -13,223 +16,89 @@
#include "otfaux.h"
#define FUNCTION_STACK_INCREMENT 16
typedef struct OTFAUX_Thumbail_Process {
/** next in hash chain */
struct OTFAUX_Thumbail_Process* next;
/** the id of this process */
uint64_t token;
/** current function stack */
uint32_t* function_stack;
uint32_t stack_pos;
uint32_t stack_size;
uint32_t pos, alloc;
uint32_t* start_pixel;
uint32_t* function;
} OTFAUX_Thumbail_Process;
#define PROCESSES_HASH_SHIFT 10
#define PROCESSES_HASH_SIZE (1 << PROCESSES_HASH_SHIFT)
#define PROCESSES_HASH_MASK (PROCESSES_HASH_SIZE - 1)
struct OTFAUX_Thumbnail_Context {
/** The processes */
OTFAUX_Thumbail_Process* processes[ PROCESSES_HASH_SIZE ];
/* timestamps */
uint32_t* timestamps;
};
OTFAUX_Thumbnail_Context*
OTFAUX_Thumbnail_create( uint64_t minTime,
uint64_t maxTime,
uint32_t width )
OTFAUX_Thumbnail_create( uint64_t minTime, uint64_t maxTime, uint32_t width )
{
OTFAUX_Thumbnail_Context* new_context = calloc( 1, sizeof( *new_context ) );
OTFAUX_Thumbnail_Context* new_context = OTFAUX_State_create();
/* TODO: callculate sample time stamps */
if ( !new_context )
return NULL;
if ( !OTFAUX_State_setupThumbnail( new_context, minTime, maxTime, width ) )
{
OTFAUX_State_destroy( new_context );
return NULL;
}
return new_context;
}
void
OTFAUX_Thumbnail_destroy( OTFAUX_Thumbnail_Context* tn_context )
{
int i;
for ( i = 0; i < PROCESSES_HASH_SIZE; i++ ) {
while ( tn_context->processes[ i ] ) {
OTFAUX_Thumbail_Process* next = tn_context->processes[ i ]->next;
free( tn_context->processes[ i ]->function_stack );
free( tn_context->processes[ i ] );
tn_context->processes[ i ] = next;
}
}
free( tn_context );
OTFAUX_State_destroy( tn_context );
}
static OTFAUX_Thumbail_Process*
get_process( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process_token,
int create )
{
uint32_t process_hash = hash( &process_token, sizeof( process_token ), 0 );
OTFAUX_Thumbail_Process** process_bucket = &tn_context->processes[ process_hash & PROCESSES_HASH_MASK ];
OTFAUX_Thumbail_Process* process = *process_bucket;
/* search in hash chain */
while ( process ) {
if ( process->token == process_token ) {
/* found, is this an error? */
return process;
}
process = process->next;
}
if ( !create ) {
return process;
}
/* create new process */
process = calloc( 1, sizeof( *process ) );
if ( !process ) {
return NULL;
}
process->token = process_token;
process->function_stack = calloc( FUNCTION_STACK_INCREMENT,
sizeof( *process->function_stack ) );
if ( !process->function_stack ) {
free( process );
return NULL;
}
process->stack_size = FUNCTION_STACK_INCREMENT;
/* TODO: init arrays */
/* chain into hash table */
process->next = *process_bucket;
*process_bucket = process;
return process;
}
void
OTFAUX_Thumbnail_declareProcess( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process_token )
{
OTFAUX_Thumbail_Process* process = get_process( tn_context,
process_token,
1 );
if ( !process ) {
return;
}
/* TODO: enter the invalid */
}
void
OTFAUX_Thumbnail_handleEnter( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process_token,
uint32_t function_token )
{
OTFAUX_Thumbail_Process* process;
process = get_process( tn_context, process_token, 0 );
if ( !process ) {
return;
}
/* need to increase stack size? */
if ( process->stack_pos == process->stack_size ) {
uint32_t new_stack_size = process->stack_size + FUNCTION_STACK_INCREMENT;
uint32_t* new_function_stack = realloc( process->function_stack,
new_stack_size * sizeof( *process->function_stack ) );
if ( !new_function_stack ) {
return;
}
process->function_stack = new_function_stack;
process->stack_size = new_stack_size;
}
process->function_stack[ process->stack_pos++ ] = function_token;
/* TODO: check for pipxel */
}
void
OTFAUX_Thumbnail_handleLeave( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process_token )
{
OTFAUX_Thumbail_Process* process;
process = get_process( tn_context, process_token, 0 );
if ( !process || process->stack_pos == 0 ) {
return;
}
/* pop from function stack */
process->stack_pos--;
/* TODO: check for pipxel */
}
uint32_t
OTFAUX_Thumbnail_getSize( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process_token )
{
OTFAUX_Thumbail_Process* process;
process = get_process( tn_context, process_token, 0 );
if ( !process ) {
return 0;
}
/* TODO */
return 0;
}
int
OTFAUX_Thumbnail_getData( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process_token,
OTFAUX_Thumbnail_Data* data )
OTFAUX_Thumbnail_declareProcess( OTFAUX_Thumbnail_Context* tn_context, uint64_t process_token )
{
OTFAUX_Thumbail_Process* process;
process = get_process( tn_context, process_token, 0 );
if ( !process ) {
return 0;
}
/* TODO */
return 0;
return OTFAUX_State_declareProcess( tn_context,
process_token,
1 );
}
char*
OTFAUX_Thumbnail_getFilename( const char* namestub,
size_t length,
char* name_buffer )
{
if ( !namestub ) {
return NULL;
}
if ( ( NULL == name_buffer ) || ( 0 == length ) ) {
length = strlen( namestub ) + strlen( ".thumb" ) + 1;
name_buffer = (char*)malloc( length * sizeof( char ) );
}
int
OTFAUX_Thumbnail_handleEnter( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process_token,
uint32_t function_token )
{
return OTFAUX_State_processEnter( tn_context,
timestamp,
process_token,
function_token,
0,
NULL );
}
int
OTFAUX_Thumbnail_handleLeave( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process_token )
{
return OTFAUX_State_processLeave( tn_context,
timestamp,
process_token,
0 );
}
int
OTFAUX_Thumbnail_finalize( OTFAUX_Thumbnail_Context* tn_context )
{
( void )tn_context;
/* finaliztion happens when writing */
return 1;
}
char*
OTFAUX_Thumbnail_getFilename( const char* namestub )
{
int length;
char* name_buffer;
if (!namestub)
return NULL;
length = strlen( namestub ) + strlen( ".thumb" ) + 1;
name_buffer = (char*)malloc( length * sizeof(char));
if (!name_buffer)
return NULL;
strcpy( name_buffer, namestub );
strcat( name_buffer, ".thumb" );
@ -237,338 +106,159 @@ OTFAUX_Thumbnail_getFilename( const char* namestub,
return name_buffer;
}
struct OTFAUX_ThumbnailWriter {
char* namestub;
OTF_FileManager* manager;
uint32_t height, width;
OTF_WBuffer* buffer;
};
OTFAUX_ThumbnailWriter*
OTFAUX_ThumbnailWriter_create( const char* filename,
uint32_t height,
uint32_t width,
OTF_FileManager* manager )
{
OTFAUX_ThumbnailWriter* new_writer;
if ( !filename || !manager ) {
return NULL;
}
new_writer = calloc( 1, sizeof( *new_writer) );
if ( !new_writer ) {
return NULL;
}
new_writer->namestub = OTF_stripFilename( filename );
if ( !new_writer->namestub ) {
free( new_writer );
return NULL;
}
new_writer->height = height;
new_writer->width = width;
new_writer->manager = manager;
return new_writer;
}
int
OTFAUX_ThumbnailWriter_destroy( OTFAUX_ThumbnailWriter* tn_writer )
OTFAUX_Thumbnail_write( const OTFAUX_Thumbnail_Context* tn_context,
const char* namestub,
int create, ... )
{
int ret;
uint32_t total_number_of_procs = 0;
if ( !tn_writer ) {
return 0;
if ( create ) {
va_list args;
va_start( args, create );
total_number_of_procs = va_arg( args, uint32_t );
va_end( args );
}
ret = OTFAUX_ThumbnailWriter_close( tn_writer );
free( tn_writer->namestub );
free( tn_writer );
return ret;
return OTFAUX_State_writeThumbnail( ( OTFAUX_State* )tn_context,
namestub,
create,
total_number_of_procs );
}
int
OTFAUX_ThumbnailWriter_close( OTFAUX_ThumbnailWriter* tn_writer )
{
if ( !tn_writer ) {
return 0;
}
if ( tn_writer->buffer ) {
OTF_WBuffer_close( tn_writer->buffer );
}
tn_writer->buffer = NULL;
return 1;
}
int
OTFAUX_ThumbnailWriter_writeProcess( OTFAUX_ThumbnailWriter* tn_writer,
uint64_t process,
OTFAUX_Thumbnail_Data* data )
{
size_t i;
char sep = ':';
if ( !tn_writer || !data ) {
return 0;
}
if ( !tn_writer->buffer ) {
char* filename = OTFAUX_Thumbnail_getFilename( tn_writer->namestub,
0, NULL );
if ( !filename ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTFAUX_Thumbnail_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
}
tn_writer->buffer = OTF_WBuffer_open( filename, tn_writer->manager );
if ( !tn_writer->buffer ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_open( %s ) failed.\n",
__FUNCTION__, __FILE__, __LINE__, filename );
free( filename );
return 0;
}
OTF_WBuffer_setSize( tn_writer->buffer, tn_writer->width * 16 );
free( filename );
/* write header */
OTF_WBuffer_writeUint32( tn_writer->buffer, 0 );
OTF_WBuffer_writeChar( tn_writer->buffer, ':' );
OTF_WBuffer_writeUint32( tn_writer->buffer, tn_writer->height );
OTF_WBuffer_writeChar( tn_writer->buffer, ',' );
OTF_WBuffer_writeUint32( tn_writer->buffer, tn_writer->width );
OTF_WBuffer_writeNewline( tn_writer->buffer );
}
OTF_WBuffer_writeUint64( tn_writer->buffer, process );
for ( i = 0; i < data->size; i++ ) {
OTF_WBuffer_writeChar( tn_writer->buffer, sep );
sep = ';';
OTF_WBuffer_writeUint32( tn_writer->buffer, data->start_pixel[ i ] );
OTF_WBuffer_writeChar( tn_writer->buffer, ',' );
OTF_WBuffer_writeUint32( tn_writer->buffer, data->function[ i ] );
}
OTF_WBuffer_writeNewline( tn_writer->buffer );
return 1;
}
struct OTFAUX_ThumbnailReader
{
char* namestub;
OTF_FileManager* manager;
uint32_t height, width;
OTF_RBuffer* buffer;
FILE* file;
uint32_t width;
uint32_t nprocs;
};
OTFAUX_ThumbnailReader*
OTFAUX_ThumbnailReader_create( const char* filename,
OTF_FileManager* manager )
OTFAUX_ThumbnailReader_open( const char* namestub )
{
OTFAUX_ThumbnailReader* new_reader;
char* filename;
if ( !filename || !manager ) {
if (!namestub)
return NULL;
new_reader = calloc( 1, sizeof(*new_reader));
if (!new_reader)
return NULL;
filename = OTFAUX_Thumbnail_getFilename( namestub );
if (!filename) {
free(new_reader);
return NULL;
}
new_reader = calloc( 1, sizeof( *new_reader) );
if ( !new_reader ) {
new_reader->file = fopen( filename, "r" );
free(filename);
if (!new_reader->file) {
free(new_reader);
return NULL;
}
new_reader->namestub = OTF_stripFilename( filename );
if ( !new_reader->namestub ) {
free( new_reader );
/* read header */
if (2 != fscanf( new_reader->file, "0:%x,%x\n",
&new_reader->width,
&new_reader->nprocs )) {
fclose(new_reader->file);
free(new_reader);
return NULL;
}
new_reader->manager = manager;
return new_reader;
}
int
OTFAUX_ThumbnailReader_destroy( OTFAUX_ThumbnailReader* tn_reader )
{
int ret;
if ( !tn_reader ) {
return 0;
}
ret = OTFAUX_ThumbnailReader_close( tn_reader );
free( tn_reader->namestub );
free( tn_reader );
return ret;
}
int
OTFAUX_ThumbnailReader_close( OTFAUX_ThumbnailReader* tn_reader )
{
if ( !tn_reader ) {
if (!tn_reader)
return 0;
}
if ( tn_reader->buffer ) {
OTF_RBuffer_close( tn_reader->buffer );
}
tn_reader->buffer = NULL;
fclose( tn_reader->file );
free( tn_reader );
return 1;
}
int
OTFAUX_ThumbnailReader_getDimension( OTFAUX_ThumbnailReader* tn_reader,
uint32_t* height,
uint32_t* width )
OTFAUX_ThumbnailReader_getWidth( const OTFAUX_ThumbnailReader* tn_reader,
uint32_t* width )
{
if ( !tn_reader ) {
if (!tn_reader || !width)
return 0;
}
if ( !tn_reader->buffer ) {
uint32_t val;
char* filename = OTFAUX_Thumbnail_getFilename( tn_reader->namestub,
0, NULL );
if ( !filename ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
}
tn_reader->buffer = OTF_RBuffer_open( filename, tn_reader->manager );
if ( !tn_reader->buffer ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_open( %s ) failed.\n",
__FUNCTION__, __FILE__, __LINE__, filename );
free( filename );
return 0;
}
OTF_RBuffer_setSize( tn_reader->buffer, 1024 );
free( filename );
/* read header */
if ( !OTF_RBuffer_guaranteeRecord( tn_reader->buffer ) ) {
OTF_RBuffer_close( tn_reader->buffer );
tn_reader->buffer = NULL;
return 0;
}
val = OTF_RBuffer_readUint32( tn_reader->buffer );
if ( val != 0 || !OTF_RBuffer_testChar( tn_reader->buffer, ':' ) ) {
OTF_RBuffer_close( tn_reader->buffer );
tn_reader->buffer = NULL;
return 0;
}
tn_reader->height = OTF_RBuffer_readUint32( tn_reader->buffer );
if ( !OTF_RBuffer_testChar( tn_reader->buffer, ',' ) ) {
OTF_RBuffer_close( tn_reader->buffer );
tn_reader->buffer = NULL;
return 0;
}
tn_reader->width = OTF_RBuffer_readUint32( tn_reader->buffer );
OTF_RBuffer_readNewline( tn_reader->buffer );
}
if ( height ) {
*height = tn_reader->height;
}
if ( width ) {
*width = tn_reader->width;
}
*width = tn_reader->width;
return 1;
}
int
OTFAUX_ThumbnailReader_getNumberOfProcs( const OTFAUX_ThumbnailReader* tn_reader,
uint32_t* nprocs )
{
if (!tn_reader || !nprocs)
return 0;
*nprocs = tn_reader->nprocs;
return 1;
}
int
OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
void ( *handler )( void*,
uint64_t,
uint32_t,
uint32_t ),
void (* handler)( void*,
uint64_t /* process token */,
const uint32_t* /* function tokens */ ),
void* data )
{
uint64_t process;
uint32_t start_pixel, function;
unsigned long long process;
uint32_t* functions;
int status;
uint32_t i = 0, j = 0;
if ( !tn_reader ) {
if (!tn_reader || !tn_reader->file)
return 0;
}
if ( !tn_reader->buffer ) {
int ret;
functions = calloc( tn_reader->width, sizeof(*functions));
ret = OTFAUX_ThumbnailReader_getDimension( tn_reader, NULL, NULL );
if ( !ret ) {
return ret;
/* loop processes */
status = 1;
for (i = 0; i < tn_reader->nprocs; i++)
{
status = fscanf( tn_reader->file, "%llx:", &process );
if (1 != status)
goto out;
for (j = 0; j < tn_reader->width; ++j)
{
status = fscanf( tn_reader->file, "%x,", &functions[j] );
if (1 != status)
goto out;
}
if (handler)
{
handler( data, process, functions );
}
if ( fgetc( tn_reader->file ) != '\n' && !feof( tn_reader->file ) )
{
break;
}
}
while ( OTF_RBuffer_guaranteeRecord( tn_reader->buffer ) ) {
/* read process */
process = OTF_RBuffer_readUint64( tn_reader->buffer );
out:
free( functions );
if ( !OTF_RBuffer_testChar( tn_reader->buffer, ':' ) ) {
OTF_RBuffer_readNewline( tn_reader->buffer );
continue;
}
do {
start_pixel = OTF_RBuffer_readUint32( tn_reader->buffer );
if ( !OTF_RBuffer_testChar( tn_reader->buffer, ',' ) ) {
OTF_RBuffer_readNewline( tn_reader->buffer );
break;
}
function = OTF_RBuffer_readUint32( tn_reader->buffer );
if ( handler ) {
handler( data, process, start_pixel, function );
}
} while ( OTF_RBuffer_testChar( tn_reader->buffer, ';' ) );
OTF_RBuffer_readNewline( tn_reader->buffer );
}
return 1;
return i == tn_reader->nprocs
&& j == tn_reader->width
&& feof( tn_reader->file );
}

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

@ -3,6 +3,8 @@
#include <otf.h>
#include <OTFAUX_State.h>
/**
* @file otfauxlib/OTFAUX_Thumbnail.h
*
@ -38,7 +40,7 @@ extern "C" {
*/
/** Opaque type for using the thumbnail module. */
typedef struct OTFAUX_Thumbnail_Context OTFAUX_Thumbnail_Context;
typedef OTFAUX_State OTFAUX_Thumbnail_Context;
/**
* Create a context for thumbnail generation.
@ -66,10 +68,12 @@ OTFAUX_Thumbnail_destroy( OTFAUX_Thumbnail_Context* tn_context );
* Declares that the process @a process should be handled by this context.
*
* @param tn_context The context.
*
* @return 1 on success.
*/
void
int
OTFAUX_Thumbnail_declareProcess( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process );
uint64_t process );
/**
* Declare that the process @a process has entered the fucntion @a function
@ -81,12 +85,14 @@ OTFAUX_Thumbnail_declareProcess( OTFAUX_Thumbnail_Context* tn_context,
* @param timestamp The timestamp.
* @param process The process.
* @param function The function.
*
* @return 1 on success.
*/
void
int
OTFAUX_Thumbnail_handleEnter( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process,
uint32_t function );
uint64_t timestamp,
uint64_t process,
uint32_t function );
/**
* Declare that the process @a process has left the current fucntion at
@ -97,91 +103,52 @@ OTFAUX_Thumbnail_handleEnter( OTFAUX_Thumbnail_Context* tn_context,
* @param tn_context The context.
* @param timestamp The timestamp.
* @param process The process.
*/
void
OTFAUX_Thumbnail_handleLeave( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process );
/**
* Get the number of entries for the process @a process.
*
* @param tn_context The context.
*
* @param The size.
*/
uint32_t
OTFAUX_Thumbnail_getSize( OTFAUX_Thumbnail_Context* context,
uint64_t process );
typedef struct {
uint32_t* start_pixel;
uint32_t* function;
uint32_t size;
} OTFAUX_Thumbnail_Data;
/**
* Get the collected thumbnail data for process @a process.
*
* @param tn_context The context.
* @param process The process.
* @param data Pointer to storage where the data will be stored into.
* @param size Pointer to storage where the size will be stored into.
*
* @param 1 on success.
* @return 1 on success.
*/
int
OTFAUX_Thumbnail_getData( OTFAUX_Thumbnail_Context* context,
uint64_t process,
OTFAUX_Thumbnail_Data* data );
OTFAUX_Thumbnail_handleLeave( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process );
/**
* @}
* Declare that the handling of the enter and leave events is over.
*
* @param tn_context The context.
*
* @return 1 on success.
*/
int
OTFAUX_Thumbnail_finalize( OTFAUX_Thumbnail_Context* tn_context );
char*
OTFAUX_Thumbnail_getFilename( const char* namestub,
size_t length,
char* name_buffer );
OTFAUX_Thumbnail_getFilename( const char* namestub );
/**
* @defgroup thumbnailwriter Module to write a thumbnail.
* Writes the processes data of the context to a file.
*
* @usage:
* The writing is designed so that the data of multuiple contexts can be
* written to one file to form a thumbnail. The @a create parameter alows
* this. The writing of the first context should set the @a create
* parameter and provide in the variable argument list the total number of
* processes which will be written, over all comming contexts as an uint32_t.
* If the @a create parameter is not set, no file will be created and no
* header will be written, only the data from the given context will be
* appended to the file. The width of the file should match the width of this
* context.
*
* writer = OTFAUX_ThumbnailWriter_create("foo.otf", 512, 1024, ...);
* @param tn_context The context.
* @param namestub The name of the file.
* @param create Create the thumb file, or append.
* @param ... The total number of processes as an uint32_t, if @a
* create is set.
*
* for each process:
* OTFAUX_ThumbnailData td;
* OTFAUX_Thumbnail_getData( ctx, process, &td );
* OTFAUX_ThumbnailWriter_writeProcess( writer, process, &td );
*
* OTFAUX_ThumbnailWriter_destroy( writer );
* @return 1 on success.
*/
typedef struct OTFAUX_ThumbnailWriter OTFAUX_ThumbnailWriter;
OTFAUX_ThumbnailWriter*
OTFAUX_ThumbnailWriter_create( const char* filename,
uint32_t height,
uint32_t width,
OTF_FileManager* manager );
int
OTFAUX_ThumbnailWriter_destroy( OTFAUX_ThumbnailWriter* tn_writer );
int
OTFAUX_ThumbnailWriter_close( OTFAUX_ThumbnailWriter* tn_writer );
int
OTFAUX_ThumbnailWriter_writeProcess( OTFAUX_ThumbnailWriter* tn_writer,
uint64_t process,
OTFAUX_Thumbnail_Data* data );
/**
* @}
*/
OTFAUX_Thumbnail_write( const OTFAUX_Thumbnail_Context* tn_context,
const char* namestub,
int create, ... );
/**
* @defgroup thumbnailreader Module to read a thumbnail.
@ -190,34 +157,30 @@ OTFAUX_ThumbnailWriter_writeProcess( OTFAUX_ThumbnailWriter* tn_writer,
typedef struct OTFAUX_ThumbnailReader OTFAUX_ThumbnailReader;
OTFAUX_ThumbnailReader*
OTFAUX_ThumbnailReader_create( const char* filename,
OTF_FileManager* manager );
int
OTFAUX_ThumbnailReader_destroy( OTFAUX_ThumbnailReader* tn_reader );
OTFAUX_ThumbnailReader_open( const char* namestub );
int
OTFAUX_ThumbnailReader_close( OTFAUX_ThumbnailReader* tn_reader );
int
OTFAUX_ThumbnailReader_getDimension( OTFAUX_ThumbnailReader* tn_reader,
uint32_t* height,
uint32_t* width );
OTFAUX_ThumbnailReader_getWidth( const OTFAUX_ThumbnailReader* tn_reader,
uint32_t* width );
int
OTFAUX_ThumbnailReader_getNumberOfProcs( const OTFAUX_ThumbnailReader* tn_reader,
uint32_t* nprocs );
int
OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
void ( *process_handler )( void*,
uint64_t,
uint32_t,
uint32_t ),
void (* process_handler)( void*,
uint64_t,
const uint32_t* ),
void* data );
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* __cplusplus */

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

@ -0,0 +1,341 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libotfaux"
ProjectGUID="{6B9B49C9-75CD-400D-B736-5EACA04D0A83}"
RootNamespace="libotfaux"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../debug"
IntermediateDirectory="tmp"
ConfigurationType="4"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OTF_DEBUG;OTF_VERBOSE;HAVE_SYS_STAT_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OTF_DEBUG;OTF_VERBOSE;HAVE_SYS_STAT_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release Static|Win32"
OutputDirectory="../release_static_32bit"
IntermediateDirectory="tmp_32bit"
ConfigurationType="4"
UseOfMFC="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="./;../otflib/;../vendor/jenkins_hash/"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_SYS_STAT_H"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release Static|x64"
OutputDirectory="../release_static_64bit"
IntermediateDirectory="tmp_64bit"
ConfigurationType="4"
UseOfMFC="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="./;../otflib/;../vendor/jenkins_hash/"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_SYS_STAT_H"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\otfaux.h"
>
</File>
<File
RelativePath=".\OTFAUX_State.h"
>
</File>
<File
RelativePath=".\OTFAUX_SharedState.h"
>
</File>
<File
RelativePath=".\OTFAUX_Stack.h"
>
</File>
<File
RelativePath=".\OTFAUX_MsgMatching.h"
>
</File>
<File
RelativePath=".\OTFAUX_Thumbnail.h"
>
</File>
<File
RelativePath=".\..\vendor\jenkins_hash\jenkins_hash.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\OTFAUX_State.c"
>
</File>
<File
RelativePath=".\OTFAUX_Process.c"
>
</File>
<File
RelativePath=".\OTFAUX_MsgMatching.c"
>
</File>
<File
RelativePath=".\OTFAUX_Thumbnail.c"
>
</File>
<File
RelativePath=".\..\vendor\jenkins_hash\jenkins_hash.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

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

@ -8,6 +8,7 @@
*
*/
#include <OTFAUX_State.h>
#include <OTFAUX_MsgMatching.h>
#include <OTFAUX_Thumbnail.h>

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

@ -1,4 +1,4 @@
INCLUDES = $(ZLIB_INCLUDE_LINE)
INCLUDES = $(ZLIB_INCLUDE_LINE) $(ZOIDFS_INCLUDE_LINE)
include_HEADERS = otf.h \
OTF_CopyHandler.h \
@ -6,6 +6,7 @@ include_HEADERS = otf.h \
OTF_Definitions.h \
OTF_Errno.h \
OTF_File.h \
OTF_File_iofsl.h \
OTF_FileManager.h \
OTF_Filenames.h \
OTF_HandlerArray.h \
@ -32,12 +33,13 @@ lib_LTLIBRARIES = libotf.la
libotf_la_CFLAGS = -prefer-pic
libotf_la_LDFLAGS = -version-info @OTF_VERSION_LIBRARY@
libotf_la_LIBADD = $(ZLIB_LIB_LINE)
libotf_la_LIBADD = $(ZLIB_LIB_LINE) $(ZOIDFS_LIB_LINE)
libotf_la_SOURCES = \
OTF_CopyHandler.c \
OTF_CopyHandler_stream.c \
OTF_Errno.c \
OTF_File.c \
OTF_File_iofsl.c \
OTF_FileManager.c \
OTF_Filenames.c \
OTF_HandlerArray.c \

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

@ -131,11 +131,20 @@ int OTF_CopyHandler_DefSclFile( void* userData, uint32_t stream,
}
int OTF_CopyHandler_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid ) {
/* unique-id record is written implicitly */
return OTF_RETURN_OK; /* success */
}
int OTF_CopyHandler_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub, const char* string ) {
/* version is writen implicitly */
/* version record is written implicitly */
return OTF_RETURN_OK; /* success */
}
@ -203,6 +212,20 @@ int OTF_CopyHandler_DefProcessSubstitutes( void* userData, uint32_t stream,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_DefAuxSamplePoint( void* userData,
uint32_t stream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeDefAuxSamplePoint( (OTF_Writer*)userData,
stream,
time,
type,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** Event handlers *** ****************************************** */
int OTF_CopyHandler_NoOp( void* userData, uint64_t time, uint32_t process,
@ -470,6 +493,40 @@ int OTF_CopyHandler_BeginFileOpSnapshot( void* userData, uint64_t time,
) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_CollopCountSnapshot( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeCollopCountSnapshot( (OTF_Writer*)userData,
time,
process,
communicator,
count,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_CounterSnapshot( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeCounterSnapshot( (OTF_Writer*)userData,
time,
originaltime,
process,
counter,
value,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** summary handlers ********************************************** */
int OTF_CopyHandler_SummaryComment( void * userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList* list ) {

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

@ -66,6 +66,9 @@ int OTF_CopyHandler_DefScl( void* userData, uint32_t stream, uint32_t source,
int OTF_CopyHandler_DefSclFile( void* userData, uint32_t stream,
uint32_t sourceFile, const char* name, OTF_KeyValueList* list );
int OTF_CopyHandler_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid );
int OTF_CopyHandler_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub, const char* string );
@ -92,6 +95,12 @@ int OTF_CopyHandler_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list );
int OTF_CopyHandler_DefAuxSamplePoint( void* userData,
uint32_t stream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list );
int OTF_CopyHandler_NoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* list );
@ -184,6 +193,20 @@ int OTF_CopyHandler_BeginFileOpSnapshot( void* userData, uint64_t time,
uint64_t originaltime, uint32_t process, uint64_t matchingId,
uint32_t scltoken, OTF_KeyValueList* list );
int OTF_CopyHandler_CollopCountSnapshot( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList* list );
int OTF_CopyHandler_CounterSnapshot( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList* list );
int OTF_CopyHandler_SummaryComment( void * userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList* list );

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

@ -131,6 +131,15 @@ int OTF_CopyHandler_stream_DefSclFile( void* userData, uint32_t stream,
}
int OTF_CopyHandler_stream_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid ) {
/* update unique-id record */
return ( 0 == OTF_WStream_writeUniqueId( (OTF_WStream*)userData ) ) ?
OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub, const char* string ) {
@ -203,6 +212,19 @@ int OTF_CopyHandler_stream_DefProcessSubstitutes( void* userData, uint32_t strea
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_DefAuxSamplePoint( void* userData,
uint32_t stream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeDefAuxSamplePoint( (OTF_WStream*)userData,
time,
type,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** Event handlers *** ****************************************** */
int OTF_CopyHandler_stream_NoOp( void* userData, uint64_t time, uint32_t process,
@ -470,6 +492,40 @@ int OTF_CopyHandler_stream_BeginFileOpSnapshot( void* userData, uint64_t time,
) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_CollopCountSnapshot( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeCollopCountSnapshot( (OTF_WStream*)userData,
time,
process,
communicator,
count,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_CounterSnapshot( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeCounterSnapshot( (OTF_WStream*)userData,
time,
originaltime,
process,
counter,
value,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** summary handlers ********************************************** */
int OTF_CopyHandler_stream_SummaryComment( void * userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList* list ) {

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

@ -66,6 +66,9 @@ int OTF_CopyHandler_stream_DefScl( void* userData, uint32_t stream, uint32_t sou
int OTF_CopyHandler_stream_DefSclFile( void* userData, uint32_t stream,
uint32_t sourceFile, const char* name, OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid );
int OTF_CopyHandler_stream_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub, const char* string );
@ -92,6 +95,13 @@ int OTF_CopyHandler_stream_DefProcessSubstitutes( void* userData, uint32_t strea
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefAuxSamplePoint( void* userData,
uint32_t stream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_NoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* list );
@ -184,6 +194,21 @@ int OTF_CopyHandler_stream_BeginFileOpSnapshot( void* userData, uint64_t time,
uint64_t originaltime, uint32_t process, uint64_t matchingId,
uint32_t scltoken, OTF_KeyValueList* list );
int OTF_CopyHandler_stream_CollopCountSnapshot( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_CounterSnapshot( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_SummaryComment( void * userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList* list );

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

@ -75,8 +75,9 @@ yet it breaks the link compatibility of library versions.*/
#define OTF_DEFFILEGROUP_RECORD 26
#define OTF_DEFTIMERANGE_RECORD 61
#define OTF_DEFCOUNTERASSIGNMENTS_RECORD 62
#define OTF_DEFKEYVALUE_RECORD 57
#define OTF_DEFUNIQUEID_RECORD 64
#define OTF_DEFAUXSAMPLEPOINT_RECORD 65
#define OTF_FUNCTIONSUMMARY_RECORD 28
@ -97,18 +98,22 @@ yet it breaks the link compatibility of library versions.*/
#define OTF_BEGINCOLLOPSNAPSHOT_RECORD 59
#define OTF_BEGINFILEOPSNAPSHOT_RECORD 60
#define OTF_COLLOPCOUNTSNAPSHOT_RECORD 66
#define OTF_COUNTERSNAPSHOT_RECORD 67
#define OTF_UNKNOWN_RECORD 41
#define OTF_DEFMARKER_RECORD 45
#define OTF_MARKER_RECORD 46
/* Number of records */
#define OTF_NRECORDS 64
#define OTF_NRECORDS 68
/* Stream format definition */
#define OTF_WSTREAM_FORMAT_SHORT 0
#define OTF_WSTREAM_FORMAT_LONG 1
#define OTF_WSTREAM_FORMAT_INLINE_SNAPSHOTS 2
/*
@ -256,6 +261,15 @@ typedef enum OTF_ATTR_TYPE_enum {
OTF_ATTR_IsCommunicator = 7 /**< */
} OTF_ATTR_TYPE;
/** Types of AuxSamplePoints */
typedef enum OTF_AuxSamplePointType_enum {
/** There are snapshot information available at this time. */
OTF_AUX_SAMPLE_POINT_SNAPSHOT = 0,
/** There are summary information available at this time. */
OTF_AUX_SAMPLE_POINT_SUMMARY = 1,
/** There are snapshot information available in the event stream at this time. */
OTF_AUX_SAMPLE_POINT_INLINE_SNAPSHOT = 2
} OTF_AuxSamplePointType;
/* return values for handlers. they are not yet evaluated!!! */
@ -272,4 +286,18 @@ stops reading immediately */
#define OTF_READ_ERROR (uint64_t)-1
#define OTF_READ_MAXRECORDS (uint64_t)-2
#define OTF_ZBUFFER_DEFAULTSIZE (1 * 1024 * 1024)
enum enum_OTF_IofslMode {
OTF_IOFSL_DISABLED = 0,
OTF_IOFSL_MULTIFILE_SPLIT = 1,
OTF_IOFSL_MULTIFILE = 2
};
typedef enum enum_OTF_IofslMode OTF_IofslMode;
/** size in number of IdxEntry's (16 byte each) */
#define OTF_IOFSL_INDEX_BUFFER_DEFAULTLENGTH (1 * 1024)
#define OTF_IOFSL_FLAG_NONBLOCKING (1<<0)
#endif /* OTF_DEFINITIONS_H */

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

@ -70,55 +70,17 @@ included AFTER this macro definitions */
#endif /* HAVE_ZLIB */
#include "OTF_File.h"
#include "OTF_File_iofsl.h"
#include "OTF_Platform.h"
#include "OTF_Definitions.h"
#include "OTF_Errno.h"
struct struct_OTF_File {
/** own copy of filename */
char* filename;
/** actual file handle, it is NULL if file is currently closed,
!= NULL otherwise */
FILE* file;
#ifdef HAVE_ZLIB
/** zlib object */
z_stream* z;
/** zlib entry buffer ... what a nice wordplay */
unsigned char* zbuffer;
uint32_t zbuffersize;
#endif /* HAVE_ZLIB */
/** keep file pos when the real file is closed,
undefined while file is open, == 0 before opened for the first time */
uint64_t pos;
OTF_FileMode mode;
OTF_FileManager* manager;
/** Reference to external buffer to read from instead of a real file.
This is for reading of definitions only and has some limitations. */
const char* externalbuffer;
/** the current position in the 'externalbuffer' */
uint64_t externalpos;
/** the total length of the 'externalbuffer' */
uint64_t externallen;
};
static int OTF_File_nameSuffixCmp(const char *filename, const char *suffix);
void OTF_File_init( OTF_File* file ) {
/* internal function, called only by OTF_File_open*,
* no need (and possibility) to check for Iofsl */
file->filename= NULL;
file->file= NULL;
@ -134,11 +96,13 @@ void OTF_File_init( OTF_File* file ) {
file->externalbuffer= NULL;
file->externalpos= 0;
file->externallen= 0;
file->iofsl= NULL;
}
void OTF_File_finalize( OTF_File* file ) {
/* internal function, called only by OTF_File_close,
* no need to check for Iofsl */
file->filename= NULL;
file->file= NULL;
@ -159,8 +123,6 @@ void OTF_File_finalize( OTF_File* file ) {
OTF_File* OTF_File_open( const char* filename,
OTF_FileManager* manager, OTF_FileMode mode ) {
return OTF_File_open_zlevel( filename, manager, mode, OTF_FILECOMPRESSION_COMPRESSED );
}
@ -206,13 +168,13 @@ OTF_File* OTF_File_open_with_external_buffer( uint32_t len, const char* buffer,
return NULL;
}
ret->z->next_in= NULL;
ret->z->avail_in= 0;
ret->z->zalloc= NULL;
ret->z->zfree= NULL;
ret->z->opaque= NULL;
OTF_FILE_Z(ret)->next_in= NULL;
OTF_FILE_Z(ret)->avail_in= 0;
OTF_FILE_Z(ret)->zalloc= NULL;
OTF_FILE_Z(ret)->zfree= NULL;
OTF_FILE_Z(ret)->opaque= NULL;
inflateInit( ret->z );
inflateInit( OTF_FILE_Z(ret) );
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
@ -264,7 +226,7 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
int status;
#endif/* HAVE_ZLIB */
/* IOFSL is used in the _internal functions */
if ( NULL != file->externalbuffer ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -298,12 +260,12 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
if ( NULL != file->z ) {
/* compress the data without using the ybuffer */
file->z->avail_in = size;
file->z->next_in = (void*)ptr;
OTF_FILE_Z(file)->avail_in = size;
OTF_FILE_Z(file)->next_in = (void*)ptr;
while (file->z->avail_in > 0) {
while (OTF_FILE_Z(file)->avail_in > 0) {
status = deflate(file->z, Z_FULL_FLUSH);
status = deflate(OTF_FILE_Z(file), Z_FULL_FLUSH);
if (status == Z_STREAM_ERROR) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -312,19 +274,19 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
return byteswritten;
}
while (file->z->avail_out == 0) {
while (OTF_FILE_Z(file)->avail_out == 0) {
size_t towrite = file->zbuffersize - file->z->avail_out;
if (towrite != fwrite(file->zbuffer, 1, towrite, file->file)) {
size_t towrite = file->zbuffersize - OTF_FILE_Z(file)->avail_out;
if (towrite != OTF_File_write_internal(file, file->zbuffer, towrite)) {
OTF_Error( "ERROR in function %s, file: %s, line %i:\n",
"Failed to write %u bytes to file!\n",
__FUNCTION__, __FILE__, __LINE__, towrite);
return byteswritten;
}
file->z->avail_out = file->zbuffersize;
file->z->next_out = file->zbuffer;
status = deflate(file->z, Z_FULL_FLUSH);
OTF_FILE_Z(file)->avail_out = file->zbuffersize;
OTF_FILE_Z(file)->next_out = file->zbuffer;
status = deflate(OTF_FILE_Z(file), Z_FULL_FLUSH);
if (status == Z_STREAM_ERROR) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -334,13 +296,13 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
return byteswritten;
}
}
byteswritten = size - file->z->avail_in;
byteswritten = size - OTF_FILE_Z(file)->avail_in;
}
} else {
#endif /* HAVE_ZLIB */
byteswritten= fwrite( ptr, 1, size, file->file );
byteswritten= OTF_File_write_internal(file, ptr, size);
if( byteswritten < size ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -367,6 +329,7 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
int status;
#endif /* HAVE_ZLIB */
/* IOFSL is used in the _internal functions */
if( OTF_FILEMODE_WRITE == file->mode ) {
@ -390,27 +353,24 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
if ( NULL != file->z ) {
file->z->next_out= ptr;
file->z->avail_out= (uInt) size;
OTF_FILE_Z(file)->next_out= ptr;
OTF_FILE_Z(file)->avail_out= (uInt) size;
while ( 0 < file->z->avail_out ) {
while ( 0 < OTF_FILE_Z(file)->avail_out ) {
if ( 0 == file->z->avail_in ) {
if ( 0 == OTF_FILE_Z(file)->avail_in ) {
/* OLD:
file->z->avail_in= (uInt) fread( file->zbuffer, 1, file->zbuffersize, file->file );
*/
file->z->avail_in= (uInt) OTF_File_read_internal( file, file->zbuffer, file->zbuffersize );
file->z->next_in= file->zbuffer;
OTF_FILE_Z(file)->avail_in= (uInt) OTF_File_read_internal( file, file->zbuffer, file->zbuffersize );
OTF_FILE_Z(file)->next_in= file->zbuffer;
}
if ( 0 == file->z->avail_in ) {
if ( 0 == OTF_FILE_Z(file)->avail_in ) {
break;
}
status = inflate( file->z, Z_SYNC_FLUSH );
status = inflate( OTF_FILE_Z(file), Z_SYNC_FLUSH );
if ( status != Z_OK ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -421,21 +381,15 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
}
}
return size - file->z->avail_out;
return size - OTF_FILE_Z(file)->avail_out;
} else {
/* OLD
return fread( ptr, 1, size, file->file );
*/
return OTF_File_read_internal( file, ptr, size );
}
#else /* HAVE_ZLIB */
/* OLD
return fread( ptr, 1, size, file->file );
*/
return OTF_File_read_internal( file, ptr, size );
#endif /* HAVE_ZLIB */
@ -452,6 +406,9 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
uint64_t read;
#endif /* HAVE_ZLIB */
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_seek( file, pos );
}
if ( NULL != file->externalbuffer ) {
@ -495,19 +452,19 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
*/
read= OTF_File_read_internal( file, file->zbuffer, file->zbuffersize );
file->z->next_in= file->zbuffer;
file->z->avail_in= (uInt) read;
file->z->total_in= 0;
OTF_FILE_Z(file)->next_in= file->zbuffer;
OTF_FILE_Z(file)->avail_in= (uInt) read;
OTF_FILE_Z(file)->total_in= 0;
/* re-initialize z object */
inflateReset(file->z);
inflateReset(OTF_FILE_Z(file));
/* do not sync at very beginning of compressed stream because it
would skip the first block */
sync= Z_OK;
if ( 0 != pos ) {
sync= inflateSync( file->z );
sync= inflateSync( OTF_FILE_Z(file) );
}
if ( Z_OK == sync ) {
@ -547,6 +504,9 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
uint64_t OTF_File_tell( OTF_File* file ) {
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_tell( file );
}
if ( NULL != file->externalbuffer ) {
@ -571,6 +531,9 @@ uint64_t OTF_File_size( OTF_File* file ) {
struct stat st;
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_size( file );
}
if ( NULL != file->externalbuffer ) {
@ -605,7 +568,10 @@ int OTF_File_close( OTF_File* file ) {
int status;
#endif /* HAVE_ZLIB */
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_close( file );
}
if ( NULL == file ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -622,7 +588,7 @@ int OTF_File_close( OTF_File* file ) {
if ( OTF_FILEMODE_WRITE != file->mode ) {
inflateEnd( file->z );
inflateEnd( OTF_FILE_Z(file) );
} else {
@ -638,13 +604,13 @@ int OTF_File_close( OTF_File* file ) {
return 0;
}
status = deflate( file->z, Z_FULL_FLUSH );
status = deflate( OTF_FILE_Z(file), Z_FULL_FLUSH );
assert( status != Z_STREAM_ERROR );
towrite = file->zbuffersize - file->z->avail_out;
towrite = file->zbuffersize - OTF_FILE_Z(file)->avail_out;
byteswritten = 0;
if (towrite > 0)
byteswritten = fwrite( file->zbuffer, 1, towrite, file->file );
byteswritten = OTF_File_write_internal(file, file->zbuffer, towrite);
if (towrite != byteswritten) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n"
@ -652,18 +618,18 @@ int OTF_File_close( OTF_File* file ) {
__FUNCTION__, __FILE__, __LINE__, towrite );
}
while (file->z->avail_out != file->zbuffersize) {
while (OTF_FILE_Z(file)->avail_out != file->zbuffersize) {
file->z->avail_out = file->zbuffersize;
file->z->next_out = file->zbuffer;
deflate( file->z, Z_FULL_FLUSH );
OTF_FILE_Z(file)->avail_out = file->zbuffersize;
OTF_FILE_Z(file)->next_out = file->zbuffer;
deflate( OTF_FILE_Z(file), Z_FULL_FLUSH );
assert(status != Z_STREAM_ERROR);
towrite = file->zbuffersize - file->z->avail_out;
towrite = file->zbuffersize - OTF_FILE_Z(file)->avail_out;
if (towrite > 0)
fwrite( file->zbuffer, 1, towrite, file->file );
OTF_File_write_internal(file, file->zbuffer, towrite);
}
deflateEnd( file->z );
deflateEnd( OTF_FILE_Z(file) );
}
free( file->z );
file->z = NULL;
@ -692,6 +658,9 @@ int OTF_File_close( OTF_File* file ) {
OTF_FileStatus OTF_File_status( OTF_File* file ) {
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_status( file );
}
if ( NULL != file->externalbuffer ) {
@ -720,6 +689,10 @@ OTF_FileStatus OTF_File_status( OTF_File* file ) {
void OTF_File_suspend( OTF_File* file ) {
if ( NULL != file->iofsl ) {
OTF_File_iofsl_suspend( file );
return;
}
if ( NULL != file->externalbuffer ) {
@ -740,6 +713,9 @@ void OTF_File_suspend( OTF_File* file ) {
int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if ( NULL != file->iofsl ) {
return OTF_File_iofsl_revive( file, mode );
}
if ( NULL != file->externalbuffer ) {
@ -1015,7 +991,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
/* no specific IOFSL version */
#ifdef HAVE_ZLIB
@ -1057,8 +1033,8 @@ void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
}
file->zbuffer = tmp;
file->zbuffersize= size;
file->z->avail_out = size;
file->z->next_out = file->z->next_in = file->zbuffer;
OTF_FILE_Z(file)->avail_out = size;
OTF_FILE_Z(file)->next_out = OTF_FILE_Z(file)->next_in = file->zbuffer;
}
@ -1066,6 +1042,21 @@ void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
#endif /* HAVE_ZLIB */
}
/**
* returns 0 if suffix is-suffix of filename
* true if suffix is not NOT a suffix of filename
*/
static int OTF_File_nameSuffixCmp(const char *filename, const char *suffix) {
size_t filename_length, suffix_length;
assert( filename && suffix );
filename_length = strlen( filename );
suffix_length = strlen( suffix );
if ( suffix_length > filename_length ) {
return 1;
}
return strncmp( filename + filename_length - suffix_length, suffix, suffix_length);
}
OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
OTF_FileMode mode, OTF_FileCompression zlevel ) {
@ -1074,6 +1065,17 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
uint32_t len;
OTF_File* ret;
if ( OTF_FileManager_isIofsl( manager ) ) {
/* open all files except *.otf and global definitions/markers with iofsl */
if ( OTF_File_nameSuffixCmp( filename, ".otf" )
&& OTF_File_nameSuffixCmp( filename, ".0.def" )
&& OTF_File_nameSuffixCmp( filename, ".0.def.z" )
&& OTF_File_nameSuffixCmp( filename, ".0.marker" )
&& OTF_File_nameSuffixCmp( filename, ".0.marker.z" ) ) {
return OTF_File_iofsl_open_zlevel( filename, manager, mode, zlevel );
}
}
/* Check input parameters */
if( NULL == filename ) {
@ -1158,13 +1160,13 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
return NULL;
}
ret->z->next_in= NULL;
ret->z->avail_in= 0;
ret->z->zalloc= NULL;
ret->z->zfree= NULL;
ret->z->opaque= NULL;
OTF_FILE_Z(ret)->next_in= NULL;
OTF_FILE_Z(ret)->avail_in= 0;
OTF_FILE_Z(ret)->zalloc= NULL;
OTF_FILE_Z(ret)->zfree= NULL;
OTF_FILE_Z(ret)->opaque= NULL;
inflateInit( ret->z );
inflateInit( OTF_FILE_Z(ret) );
ret->zbuffer= malloc( ret->zbuffersize );
@ -1237,13 +1239,13 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
return NULL;
}
ret->z->next_in= NULL;
ret->z->avail_in= 0;
ret->z->zalloc= NULL;
ret->z->zfree= NULL;
ret->z->opaque= NULL;
OTF_FILE_Z(ret)->next_in= NULL;
OTF_FILE_Z(ret)->avail_in= 0;
OTF_FILE_Z(ret)->zalloc= NULL;
OTF_FILE_Z(ret)->zfree= NULL;
OTF_FILE_Z(ret)->opaque= NULL;
deflateInit( ret->z, zlevel );
deflateInit( OTF_FILE_Z(ret), zlevel );
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
@ -1271,12 +1273,19 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
return ret;
}
size_t OTF_File_write_internal( OTF_File* file, const void* src, size_t length ) {
if ( NULL != file->iofsl )
return OTF_File_iofsl_write_internal( file, src, length );
return fwrite(src, 1, length, file->file);
}
size_t OTF_File_read_internal( OTF_File* file, void* dest, size_t length ) {
uint64_t actual_length;
if ( NULL != file->iofsl )
return OTF_File_iofsl_read_internal( file, dest, length );
/* default behavior first */
if ( NULL == file->externalbuffer )
return fread( dest, 1, length, file->file );

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

@ -19,6 +19,19 @@
#include "OTF_FileManager.h"
#include "OTF_Filenames.h"
#include <stdio.h>
#ifdef HAVE_ZLIB
/* We cannot include the zlib.h due to possibly missing path to it
(e.g. zlib.h isn't located in a default compiler search path) */
/*#include <zlib.h>*/
/* macro to access the zlib object of struct_OTF_File with the correct type */
#define OTF_FILE_Z(file) ((z_stream*) (file)->z)
#endif /* HAVE_ZLIB */
#ifdef __cplusplus
extern "C" {
@ -44,6 +57,57 @@ enum enum_OTF_FileStatus {
};
typedef enum enum_OTF_FileStatus OTF_FileStatus;
/* Needs to be in the header so we can use it from OTF_File_iofsl */
struct struct_OTF_File {
/** own copy of filename */
char* filename;
/** actual file handle, it is NULL if file is currently closed,
!= NULL otherwise */
FILE* file;
#ifdef HAVE_ZLIB
/** zlib object,
The actual type z_stream* cannot be used here (see notes above).
Use the macro OTF_FILE_Z() to access it with the correct type. */
void* z;
/** zlib entry buffer ... what a nice wordplay */
unsigned char* zbuffer;
uint32_t zbuffersize;
#endif /* HAVE_ZLIB */
/** keep file pos when the real file is closed,
undefined while file is open, == 0 before opened for the first time */
uint64_t pos;
OTF_FileMode mode;
OTF_FileManager* manager;
/** Reference to external buffer to read from instead of a real file.
This is for reading of definitions only and has some limitations. */
const char* externalbuffer;
/** the current position in the 'externalbuffer' */
uint64_t externalpos;
/** the total length of the 'externalbuffer' */
uint64_t externallen;
OTF_File_iofsl *iofsl;
};
#ifdef HAVE_ZOIDFS
/** external variable indicating whether zoidfs was initialized */
extern uint8_t zoidfs_initialized;
#endif
/** initialize a OTF_File object */
void OTF_File_init( OTF_File* o );
@ -60,6 +124,18 @@ Don't touch it during access operations. */
OTF_File* OTF_File_open_with_external_buffer( uint32_t len, const char* buffer, uint8_t is_compressed,
OTF_FileMode mode );
/** Rename file pointed to by 'from' to file 'to'.
* If the filename describes a zoidfs file the zoidfs API is used.
* Otherwise standard POSIX rename is used.*/
int OTF_File_rename(const char* from, const char* to);
int OTF_File_access(const char* filename, int mode);
/** Remove the file according to the stream id encoded in the filename */
int OTF_File_remove(const char* filename);
/** Clean up everything -- relevant only for multifile use to remove the data and index file */
int OTF_File_clean(const char* filename);
/** OTF_File to an OTF_File */
size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size );
@ -103,6 +179,10 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
size_t OTF_File_read_internal( OTF_File* file, void* dest, size_t length );
/** Wrapper around fwrite to issue calls to zoidfs_write if needed */
size_t OTF_File_write_internal(OTF_File* file, const void* src, size_t length);
#ifdef __cplusplus
}
#endif /* __cplusplus */

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

@ -3,14 +3,19 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "OTF_Platform.h"
#include "OTF_FileManager.h"
#include "OTF_File.h"
#include "OTF_File_iofsl.h"
#include "OTF_Errno.h"
@ -39,6 +44,15 @@ struct struct_OTF_FileManager {
/** list of objects of type OTF_RBuffer or OTF_WBuffer */
OTF_FileList* list;
/** IOFSL specific settings, @see OTF_FileManager_setIofsl */
uint8_t iofsl_enabled;
uint32_t iofsl_flags;
uint32_t iofsl_server_num;
uint32_t iofsl_streamid_bits;
char** iofsl_server_list;
OTF_IofslMode iofsl_mode;
uint32_t iofsl_index_buffer_length;
};
@ -58,11 +72,18 @@ void OTF_FileManager_listPrint( OTF_FileList** list );
void OTF_FileManager_init( OTF_FileManager* fh ) {
fh->count= 0;
fh->number= 10;
fh->count= 0;
fh->number= 10;
fh->list= NULL;
fh->list= NULL;
fh->iofsl_enabled = 0;
fh->iofsl_flags = 0;
fh->iofsl_server_num = 0;
fh->iofsl_server_list = NULL;
fh->iofsl_streamid_bits = 0;
fh->iofsl_mode = OTF_IOFSL_DISABLED;
fh->iofsl_index_buffer_length = 0;
}
@ -98,6 +119,20 @@ void OTF_FileManager_finalize( OTF_FileManager* manager ) {
}
manager->list= NULL;
if ( manager->iofsl_server_list ) {
uint32_t i;
for ( i = 0; i < manager->iofsl_server_num; i++ ) {
free( manager->iofsl_server_list[i] );
}
manager->iofsl_server_list = NULL;
}
free ( manager->iofsl_server_list );
manager->iofsl_server_list = NULL;
if ( manager->iofsl_enabled ) {
OTF_File_iofsl_finalizeGlobal();
}
}
@ -122,12 +157,56 @@ OTF_FileManager* OTF_FileManager_open( uint32_t number ) {
return ret;
}
int OTF_FileManager_setIofsl( OTF_FileManager *m,
uint32_t server_num, char **server_list, OTF_IofslMode mode,
uint32_t flags, uint32_t index_buffer_length, uint32_t streamid_bits ) {
uint32_t i;
if ( m->iofsl_enabled ) {
OTF_Warning( "WARNING OTF_FileManager_setIofsl called twice, overwriting previous settings.\n");
}
assert( mode != OTF_IOFSL_DISABLED );
m->iofsl_enabled = 1;
m->iofsl_server_num = server_num;
m->iofsl_mode = mode;
m->iofsl_index_buffer_length = index_buffer_length;
m->iofsl_flags = flags;
m->iofsl_server_list = NULL;
m->iofsl_streamid_bits = streamid_bits;
/* it is allowed to give NULL for read only */
if ( server_list != NULL ) {
m->iofsl_server_list= (char**)malloc(server_num * sizeof(*server_list));
for (i = 0; i < server_num; i++) {
m->iofsl_server_list[i] = strdup(server_list[i]);
}
}
return 1;
}
int OTF_FileManager_getIofsl( OTF_FileManager *m, uint32_t *server_num,
char ***server_list, OTF_IofslMode *mode, uint32_t *flags,
uint32_t *index_buffer_length, uint32_t *streamid_bits ) {
if ( m->iofsl_enabled ) {
*server_num = m->iofsl_server_num;
*server_list = m->iofsl_server_list;
*mode = m->iofsl_mode;
*index_buffer_length = m->iofsl_index_buffer_length;
*flags = m->iofsl_flags;
*streamid_bits = m->iofsl_streamid_bits;
}
return m->iofsl_enabled;
}
int OTF_FileManager_isIofsl( OTF_FileManager *m ) {
return m->iofsl_enabled;
}
void OTF_FileManager_close( OTF_FileManager* fh ) {
OTF_FileManager_finalize( fh );
free( fh );
fh = NULL;

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

@ -30,7 +30,7 @@
#include "OTF_inttypes.h"
#include "OTF_Definitions.h"
#ifdef __cplusplus
extern "C" {
@ -38,13 +38,12 @@ extern "C" {
struct struct_OTF_File;
typedef struct struct_OTF_File OTF_File;
typedef struct struct_OTF_File_iofsl OTF_File_iofsl;
struct struct_OTF_FileManager;
/** file manager object \ingroup fm */
typedef struct struct_OTF_FileManager OTF_FileManager;
/** Generates a new file manager with a maximum number of files that are allowed
to be open simultaneously. \ingroup fm */
OTF_FileManager* OTF_FileManager_open( uint32_t number );
@ -77,6 +76,28 @@ int OTF_FileManager_touchFile( OTF_FileManager* m, OTF_File* file );
internally. Return 1 on success, 0 otherwise. */
int OTF_FileManager_suspendFile( OTF_FileManager* m, OTF_File* file );
/**
* @param enabled - enable or disable iofsl
* @param server_num - number of servers used
* @param server_list - comma separated string containing the actual server adresses, only used by writing
* @param mode - enum, either OTF_IOFSL_MULTIFILE or OTF_IOFSL_MULTIFILE_SPLIT
* @param flags - e.g. nonblocking
* @param index_buffer_length - length of the index buffer (16 byte entries)
* @param streamid_bits - magic bitmask that is used to filter out process id from a stream id
* @return 1 on success, 0 on failure
*/
int OTF_FileManager_setIofsl( OTF_FileManager *m, uint32_t server_num, char **server_list, OTF_IofslMode mode, uint32_t flags, uint32_t index_buffer_length, uint32_t streamid_bits );
/**
* similar to @OTF_FileManager_setIofsl, but with reference parameters
* return 1 if enabled, 0 if disabled
*/
int OTF_FileManager_getIofsl( OTF_FileManager *m, uint32_t *server_num, char ***server_list, OTF_IofslMode *mode, uint32_t *flags, uint32_t *index_buffer_length, uint32_t *streamid_bits );
/**
* Check if iofsl is enabled on this filemanager
*/
int OTF_FileManager_isIofsl( OTF_FileManager *m );
#ifdef __cplusplus
}
#endif /* __cplusplus */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,108 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2012.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_File.h
*
* @brief Provides a low-level API for accessing files.
*
* \ingroup internal
*/
#ifndef OTF_FILE_IOFSL_H
#define OTF_FILE_IOFSL_H
#include "OTF_Filenames.h"
#include "OTF_File.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** initialize a OTF_File object */
int OTF_File_iofsl_init( OTF_File* o );
/**
* Finalize a OTF_File object
* This frees all associated datastructures
* including the file object itsself!
**/
void OTF_File_iofsl_finalize( OTF_File* o );
/** there is no OTF_File_iofsl_open because it is just a plain wrapper for open_zlevel */
/** open a pseudo OTF_File that actually reads from the given memory buffer.
The buffer is not copied, you need to manage it yourself!
Don't touch it during access operations. */
OTF_File* OTF_File_iofsl_open_with_external_buffer( uint32_t len, const char* buffer, uint8_t is_compressed,
OTF_FileMode mode );
/** Rename file pointed to by 'from' to file 'to'.
* If the filename describes a zoidfs file the zoidfs API is used.
* Otherwise standard POSIX rename is used.*/
int OTF_File_iofsl_rename(const char* from, const char* to);
int OTF_File_iofsl_access(const char* filename, int mode);
/** Remove the file according to the stream id encoded in the filename */
int OTF_File_iofsl_remove(const char* filename);
/** Clean up everything -- relevant only for multifile use to remove the data and index file */
int OTF_File_iofsl_clean(const char* filename);
/**
* OTF_File_iofsl_write and OTF_File_iofsl_read do not exist
* all IOFSL specific code is in the _internal versions
*/
/** seek absolute position in an OTF_File */
int OTF_File_iofsl_seek( OTF_File* file, uint64_t pos );
/** get absolut position from an OTF_File */
uint64_t OTF_File_iofsl_tell( OTF_File* file );
/** return the file size in bytes*/
uint64_t OTF_File_iofsl_size( OTF_File* file );
/** close OTF_File */
int OTF_File_iofsl_close( OTF_File* file );
/** return OTF_File status */
OTF_FileStatus OTF_File_iofsl_status( OTF_File* file );
/** suspend OTF_File - internal use only. */
void OTF_File_iofsl_suspend( OTF_File* file );
/** re-open the file when closed or suspended - internal use only.
return 1 on success, 0 otherwise */
int OTF_File_iofsl_revive( OTF_File* file, OTF_FileMode mode );
void OTF_File_iofsl_setZBufferSize( OTF_File* file, uint32_t size );
/** For zoidfs finalize */
void OTF_File_iofsl_finalizeGlobal( void );
/** internal use */
OTF_File* OTF_File_iofsl_open_zlevel( const char* filename, OTF_FileManager* manager,
OTF_FileMode mode, OTF_FileCompression compression );
/* internal function */
/* they are in the header file because they are called by OTF_File_write|read */
/** read 'length' bytes from underlying iofsl file */
size_t OTF_File_iofsl_read_internal( OTF_File* file, void* dest, size_t length );
/** Wrapper around fwrite to issue calls to zoidfs_write if needed */
size_t OTF_File_iofsl_write_internal(OTF_File* file, const void* src, size_t length);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* OTF_FILE_H */

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

@ -46,6 +46,7 @@
char* OTF_getFilename( const char* namestub, uint32_t id, OTF_FileType type,
unsigned int l, char* ret ) {
char* zsuffix = ((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "";
if ( ( NULL == ret ) || ( 0 == l ) ) {
@ -53,9 +54,61 @@ char* OTF_getFilename( const char* namestub, uint32_t id, OTF_FileType type,
ret= (char*) malloc( l * sizeof(char) );
}
switch ( type&OTF_FILETYPE_BITS ) {
if ( ( type & OTF_FILETYPE_IOFSL_ALL ) || ( type & OTF_FILETYPE_IOFSL_IDX ) ) {
char *midfix = ( type & OTF_FILETYPE_IOFSL_ALL ) ? "all" : "idx";
switch ( type&OTF_FILETYPE_BITS ) {
case OTF_FILETYPE_MASTER:
/* mastercontrol file stays uncompressed even with compression or iofsl*/
snprintf( ret, l, "%s.%s", namestub, OTF_FILENAMESUFFIX_MAIN );
break;
case OTF_FILETYPE_GLOBAL_DEF:
snprintf( ret, l, "%s.%s%s", namestub, OTF_FILENAMESUFFIX_DEF,
zsuffix );
break;
case OTF_FILETYPE_DEF:
snprintf( ret, l, "%s.%s.%s.%i%s", namestub, midfix, OTF_FILENAMESUFFIX_DEF,
id, zsuffix );
break;
case OTF_FILETYPE_EVENT:
snprintf( ret, l, "%s.%s.%s.%i%s", namestub, midfix, OTF_FILENAMESUFFIX_EVENTS,
id, zsuffix );
break;
case OTF_FILETYPE_SNAPS:
snprintf( ret, l, "%s.%s.%s.%i%s", namestub, midfix, OTF_FILENAMESUFFIX_SNAPS,
id, zsuffix );
break;
case OTF_FILETYPE_STATS:
snprintf( ret, l, "%s.%s.%s.%i%s", namestub, midfix, OTF_FILENAMESUFFIX_STATS,
id, zsuffix );
break;
case OTF_FILETYPE_MARKER:
snprintf( ret, l, "%s.%s.%s.%i%s", namestub, midfix, OTF_FILENAMESUFFIX_MARKER,
id, zsuffix );
break;
default:
free(ret);
ret = NULL;
return NULL;
}
return ret;
}
switch ( type&OTF_FILETYPE_BITS ) {
case OTF_FILETYPE_MASTER:
/* mastercontrol file stays uncompressed even with compression */
@ -65,37 +118,37 @@ char* OTF_getFilename( const char* namestub, uint32_t id, OTF_FileType type,
case OTF_FILETYPE_GLOBAL_DEF:
snprintf( ret, l, "%s.%s%s", namestub, OTF_FILENAMESUFFIX_DEF,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
case OTF_FILETYPE_DEF:
snprintf( ret, l, "%s.%x.%s%s", namestub, id, OTF_FILENAMESUFFIX_DEF,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
case OTF_FILETYPE_EVENT:
snprintf( ret, l, "%s.%x.%s%s", namestub, id, OTF_FILENAMESUFFIX_EVENTS,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
case OTF_FILETYPE_SNAPS:
snprintf( ret, l, "%s.%x.%s%s", namestub, id, OTF_FILENAMESUFFIX_SNAPS,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
case OTF_FILETYPE_STATS:
snprintf( ret, l, "%s.%x.%s%s", namestub, id, OTF_FILENAMESUFFIX_STATS,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
case OTF_FILETYPE_MARKER:
snprintf( ret, l, "%s.%x.%s%s", namestub, id, OTF_FILENAMESUFFIX_MARKER,
((type&OTF_FILECOMPRESSION_BITS) > 0 && (type&OTF_FILECOMPRESSION_BITS) <= 9 ) ? ".z" : "" );
zsuffix );
break;
default:

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

@ -37,6 +37,8 @@ extern "C" {
#define OTF_FILETYPE_SNAPS 256
#define OTF_FILETYPE_STATS 512
#define OTF_FILETYPE_MARKER 1024
#define OTF_FILETYPE_IOFSL_ALL 2048
#define OTF_FILETYPE_IOFSL_IDX 4096
#define OTF_FILETYPE_BITS (16+32+64+128+256+512+1024)
typedef uint32_t OTF_FileType;

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

@ -451,6 +451,29 @@ int OTF_Handler_DefCreator( void* userData,
OTF_KeyValueList *list );
/**
* Provides file unique id.
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param stream Identifies the stream to which this definition
* belongs to. stream = 0 represents a global
* definition.
* @param uid unique id
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* @return OTF_RETURN_ABORT for aborting the reading process immediately
* OTF_RETURN_OK for continue reading
*
* \ingroup handler
*/
int OTF_Handler_DefUniqueId( void* userData,
uint32_t stream,
uint64_t uid,
OTF_KeyValueList *list );
/**
* Provides information on the trace´s otf-version. This record can only be read
* and not be written.
@ -619,6 +642,33 @@ int OTF_Handler_DefCounterAssignments( void* userData,
OTF_KeyValueList* list );
/**
* Provides a auxiliary sample point definition.
*
* It is intentional a per-stream or global (stream id equals 0) definition.
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param stream Identifies the stream to which this definition
* belongs to. stream = 0 represents a global
* definition.
*
* @param time Time at which the auxiliary sample point information
* is available.
*
* @param type Type of the auxiliary sample point. See @a OTF_AuxSamplePointType.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* \ingroup handler
*/
int OTF_Handler_DefAuxSamplePoint( void* userData,
uint32_t stream,
uint63_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList * list );
/* Handlers for OTF event records ****************************************** */
/**
@ -1371,6 +1421,7 @@ int OTF_Handler_BeginCollopSnapshot ( void* userData,
uint64_t received,
uint32_t scltoken,
OTF_KeyValueList *list );
/**
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
@ -1394,6 +1445,63 @@ int OTF_Handler_BeginFileOpSnapshot ( void* userData,
OTF_KeyValueList *list );
/**
* Provides a snapshot how many collective operation this process has finished
* until now (ie. the begin coll op records are not counted) in the specified
* communicator.
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param time The time of the snapshot.
* @param process Process identifier.
* @param communicator The communicator for which the count hold.
* @param count The number of coll ops this process has finished in this
* comm.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual
* data.
*
* @return OTF_RETURN_ABORT for aborting the reading process immediately
* OTF_RETURN_OK for continue reading
*
* \ingroup handler
*/
int OTF_Handler_CollopCountSnapshot( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList *list );
/**
* Provides the value of the counter before the snapshot.
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param time Time of the snapshot.
* @param originaltime Timestamp when the counter was sampled with this value.
* @param process Process identifier.
*
* @param counter The counter.
* @param name1 The value of the counter.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual
* data.
*
* @return OTF_RETURN_ABORT for aborting the reading process immediately
* OTF_RETURN_OK for continue reading
*
* \ingroup handler
*/
int OTF_Handler_CounterSnapshot( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList *list );
/* Handlers for OTF summary records **************************************** */

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

@ -286,6 +286,12 @@ int OTF_HandlerArray_getCopyHandler( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefAuxSamplePoint,
OTF_DEFAUXSAMPLEPOINT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFAUXSAMPLEPOINT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_NoOp,
OTF_NOOP_RECORD );
@ -439,6 +445,20 @@ int OTF_HandlerArray_getCopyHandler( OTF_HandlerArray* handlers,
OTF_BEGINFILEOPSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_CollopCountSnapshot,
OTF_COLLOPCOUNTSNAPSHOT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_COLLOPCOUNTSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_CounterSnapshot,
OTF_COUNTERSNAPSHOT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_COUNTERSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_SummaryComment,
OTF_SUMMARYCOMMENT_RECORD );
@ -578,6 +598,12 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFSCLFILE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefUniqueId,
OTF_DEFUNIQUEID_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFUNIQUEID_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefVersion,
OTF_DEFVERSION_RECORD );
@ -626,6 +652,12 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefAuxSamplePoint,
OTF_DEFAUXSAMPLEPOINT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFAUXSAMPLEPOINT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_NoOp,
OTF_NOOP_RECORD );
@ -778,6 +810,19 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_BEGINFILEOPSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_CollopCountSnapshot,
OTF_COLLOPCOUNTSNAPSHOT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_COLLOPCOUNTSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_CounterSnapshot,
OTF_COUNTERSNAPSHOT_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_COUNTERSNAPSHOT_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_SummaryComment,

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

@ -3,7 +3,7 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
/**
* @file OTF_HandlerArray.h
*
* @brief Provides read access to OTF traces which consist of multiple
@ -25,11 +25,11 @@
* global definition which is the default.
*/
/**
/**
* \defgroup ha Handler Array Interface
*
* Using this interface you can setup a handler array for reading traces.
*
*
*/
#ifndef OTF_HANDLERARRAY_H
@ -70,20 +70,20 @@ int OTF_HandlerArray_close( OTF_HandlerArray* handlers );
/** Assign the function pointer to your own handler of the given record
type. \ingroup ha */
int OTF_HandlerArray_setHandler( OTF_HandlerArray* handlers,
int OTF_HandlerArray_setHandler( OTF_HandlerArray* handlers,
OTF_FunctionPointer* pointer, uint32_t recordtype );
/** Assign the first argument to your own handler of the given record type.
\ingroup ha */
int OTF_HandlerArray_setFirstHandlerArg( OTF_HandlerArray* handlers,
int OTF_HandlerArray_setFirstHandlerArg( OTF_HandlerArray* handlers,
void* firsthandlerarg, uint32_t recordtype );
/** Provide copy handlers to every record type. \ingroup ha */
int OTF_HandlerArray_getCopyHandler( OTF_HandlerArray* handlers,
int OTF_HandlerArray_getCopyHandler( OTF_HandlerArray* handlers,
OTF_Writer* writer );
/** Provide copy handlers to every record type for OTF streams. \ingroup ha */
int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
OTF_WStream* writer );
@ -95,16 +95,16 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
/* - the following part is also used to create the python wrapper automatically
- respect these rules to avoid problems while generating:
- write the definition macro as a comment (with a '#' placed in front)
one line above the typedef itself
- the use of the following datatypes is possible: char, uint8_t, uint32_t, uint64_t
- the first parameter must be a "void*" pointer
- to use pointer as parameter is very critical and requires some additional rules:
- pointer of type "char*" are allowed anytime
- pointer of type "uint32_t*" are allowed but the previous parameter must
be of type "uint32_t" and contain the number of elements that are in the array
the pointer references to
- pointer of type "void*" are allowed as the first parameter only
- write the definition macro as a comment (with a '#' placed in front)
one line above the typedef itself
- the use of the following datatypes is possible: char, uint8_t, uint32_t, uint64_t
- the first parameter must be a "void*" pointer
- to use pointer as parameter is very critical and requires some additional rules:
- pointer of type "char*" are allowed anytime
- pointer of type "uint32_t*" are allowed but the previous parameter must
be of type "uint32_t" and contain the number of elements that are in the array
the pointer references to
- pointer of type "void*" are allowed as the first parameter only
- if you have to add a record that breaks one of the above-mentioned rules the generation
will skip this record and you manually have to update the python wrapper ( see
@ -118,15 +118,15 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
/* # OTF_DEFINITIONCOMMENT_RECORD */
typedef int (OTF_Handler_DefinitionComment) ( void* userData,
uint32_t stream,
const char* comment,
OTF_KeyValueList *list );
uint32_t stream,
const char* comment,
OTF_KeyValueList *list );
/* # OTF_DEFTIMERRESOLUTION_RECORD */
/* # OTF_DEFTIMERRESOLUTION_RECORD */
typedef int (OTF_Handler_DefTimerResolution) ( void* userData,
uint32_t stream,
uint64_t ticksPerSecond,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFPROCESS_RECORD */
typedef int (OTF_Handler_DefProcess) ( void* userData,
@ -134,7 +134,7 @@ typedef int (OTF_Handler_DefProcess) ( void* userData,
uint32_t process,
const char* name,
uint32_t parent,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFPROCESSGROUP_RECORD */
typedef int (OTF_Handler_DefProcessGroup) ( void* userData,
@ -143,22 +143,22 @@ typedef int (OTF_Handler_DefProcessGroup) ( void* userData,
const char* name,
uint32_t numberOfProcs,
const uint32_t* procs,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFATTRLIST_RECORD */
typedef int (OTF_Handler_DefAttributeList) ( void* userData,
uint32_t stream,
uint32_t attr_token,
uint32_t num,
OTF_ATTR_TYPE* array,
uint32_t stream,
uint32_t attr_token,
uint32_t num,
OTF_ATTR_TYPE* array,
OTF_KeyValueList *list );
/* # OTF_DEFPROCESSORGROUPATTR_RECORD */
typedef int (OTF_Handler_DefProcessOrGroupAttributes) ( void* userData,
uint32_t stream,
uint32_t proc_token,
uint32_t attr_token,
OTF_KeyValueList *list );
uint32_t stream,
uint32_t proc_token,
uint32_t attr_token,
OTF_KeyValueList *list );
/* # OTF_DEFFUNCTION_RECORD */
typedef int (OTF_Handler_DefFunction) ( void* userData,
@ -167,14 +167,14 @@ typedef int (OTF_Handler_DefFunction) ( void* userData,
const char* name,
uint32_t funcGroup,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFFUNCTIONGROUP_RECORD */
typedef int (OTF_Handler_DefFunctionGroup) ( void* userData,
uint32_t stream,
uint32_t funcGroup,
const char* name,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFCOLLOP_RECORD */
typedef int (OTF_Handler_DefCollectiveOperation) ( void* userData,
@ -182,7 +182,7 @@ typedef int (OTF_Handler_DefCollectiveOperation) ( void* userData,
uint32_t collOp,
const char* name,
uint32_t type,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFCOUNTER_RECORD */
typedef int (OTF_Handler_DefCounter) ( void* userData,
@ -192,14 +192,14 @@ typedef int (OTF_Handler_DefCounter) ( void* userData,
uint32_t properties,
uint32_t counterGroup,
const char* unit,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFCOUNTERGROUP_RECORD */
typedef int (OTF_Handler_DefCounterGroup) ( void* userData,
uint32_t stream,
uint32_t counterGroup,
const char* name,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFSCL_RECORD */
typedef int (OTF_Handler_DefScl) ( void* userData,
@ -207,14 +207,14 @@ typedef int (OTF_Handler_DefScl) ( void* userData,
uint32_t source,
uint32_t sourceFile,
uint32_t line,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFSCLFILE_RECORD */
typedef int (OTF_Handler_DefSclFile) ( void* userData,
uint32_t stream,
uint32_t sourceFile,
const char* name,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFCREATOR_RECORD */
typedef int (OTF_Handler_DefCreator) ( void* userData,
@ -222,6 +222,12 @@ typedef int (OTF_Handler_DefCreator) ( void* userData,
const char* creator,
OTF_KeyValueList *list );
/* # OTF_DEFUNIQUEID_RECORD */
typedef int (OTF_Handler_DefUniqueId) ( void* userData,
uint32_t stream,
uint64_t uid,
OTF_KeyValueList *list );
/* # OTF_DEFVERSION_RECORD */
typedef int (OTF_Handler_DefVersion) ( void* userData,
uint32_t stream,
@ -237,47 +243,54 @@ typedef int (OTF_Handler_DefFile) ( void* userData,
uint32_t token,
const char *name,
uint32_t group,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFFILEGROUP_RECORD */
typedef int (OTF_Handler_DefFileGroup) ( void* userData,
uint32_t stream,
uint32_t token,
const char *name,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_DEFKEYVALUE_RECORD */
typedef int (OTF_Handler_DefKeyValue) ( void* userData,
uint32_t stream,
uint32_t key,
OTF_Type type,
OTF_Type type,
const char *name,
const char *description,
OTF_KeyValueList *list );
const char *description,
OTF_KeyValueList *list );
/* # OTF_DEFTIMERANGE_RECORD */
typedef int (OTF_Handler_DefTimeRange) ( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
typedef int (OTF_Handler_DefTimeRange) ( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list );
/* # OTF_DEFCOUNTERASSIGNMENTS_RECORD */
typedef int (OTF_Handler_DefCounterAssignments) ( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
typedef int (OTF_Handler_DefCounterAssignments) ( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
/* # OTF_DEFPROCESSSUBSTITUTES_RECORD */
typedef int (OTF_Handler_DefProcessSubstitutes) ( void* userData,
uint32_t stream,
uint32_t representative,
uint32_t numberOfProcs,
const uint32_t* procs,
typedef int (OTF_Handler_DefProcessSubstitutes) ( void* userData,
uint32_t stream,
uint32_t representative,
uint32_t numberOfProcs,
const uint32_t* procs,
OTF_KeyValueList* list );
/* # OTF_DEFAUXSAMPLEPOINT_RECORD */
typedef int (OTF_Handler_DefAuxSamplePoint) ( void* userData,
uint32_t stream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list );
/* typedefs for OTF event records ****************************************** */
/* # OTF_NOOP_RECORD */
@ -286,13 +299,13 @@ typedef int (OTF_Handler_NoOp) ( void* userData,
uint32_t process,
OTF_KeyValueList *list );
/* # OTF_ENTER_RECORD */
/* # OTF_ENTER_RECORD */
typedef int (OTF_Handler_Enter) ( void* userData,
uint64_t time,
uint32_t function,
uint32_t process,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_LEAVE_RECORD */
typedef int (OTF_Handler_Leave) ( void* userData,
@ -300,7 +313,7 @@ typedef int (OTF_Handler_Leave) ( void* userData,
uint32_t function,
uint32_t process,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_SEND_RECORD */
typedef int (OTF_Handler_SendMsg) ( void* userData,
@ -311,7 +324,7 @@ typedef int (OTF_Handler_SendMsg) ( void* userData,
uint32_t type,
uint32_t length,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_RECEIVE_RECORD */
typedef int (OTF_Handler_RecvMsg) ( void* userData,
@ -322,7 +335,7 @@ typedef int (OTF_Handler_RecvMsg) ( void* userData,
uint32_t type,
uint32_t length,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_COUNTER_RECORD */
typedef int (OTF_Handler_Counter) ( void* userData,
@ -330,7 +343,7 @@ typedef int (OTF_Handler_Counter) ( void* userData,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_COLLOP_RECORD */
typedef int (OTF_Handler_CollectiveOperation) ( void* userData,
@ -343,7 +356,7 @@ typedef int (OTF_Handler_CollectiveOperation) ( void* userData,
uint32_t received,
uint64_t duration,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_BEGINCOLLOP_RECORD */
typedef int (OTF_Handler_BeginCollectiveOperation) ( void* userData,
@ -356,33 +369,33 @@ typedef int (OTF_Handler_BeginCollectiveOperation) ( void* userData,
uint64_t sent,
uint64_t received,
uint32_t scltoken,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_ENDCOLLOP_RECORD */
typedef int (OTF_Handler_EndCollectiveOperation) ( void* userData,
uint64_t time,
uint32_t process,
uint64_t matchingId,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_EVENTCOMMENT_RECORD */
typedef int (OTF_Handler_EventComment) ( void* userData,
uint64_t time,
uint32_t process,
const char* comment,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_BEGINPROCESS_RECORD */
typedef int (OTF_Handler_BeginProcess) ( void* userData,
uint64_t time,
uint32_t process,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_ENDPROCESS_RECORD */
typedef int (OTF_Handler_EndProcess) ( void* userData,
uint64_t time,
uint32_t process,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_FILEOPERATION_RECORD */
@ -395,7 +408,7 @@ typedef int (OTF_Handler_FileOperation) ( void* userData,
uint64_t bytes,
uint64_t duration,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_BEGINFILEOP_RECORD */
typedef int (OTF_Handler_BeginFileOperation) ( void* userData,
@ -403,7 +416,7 @@ typedef int (OTF_Handler_BeginFileOperation) ( void* userData,
uint32_t process,
uint64_t matchingId,
uint32_t scltoken,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_ENDFILEOP_RECORD */
typedef int (OTF_Handler_EndFileOperation) ( void* userData,
@ -415,7 +428,7 @@ typedef int (OTF_Handler_EndFileOperation) ( void* userData,
uint32_t operation,
uint64_t bytes,
uint32_t scltoken,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_RMAPUT_RECORD */
typedef int (OTF_Handler_RMAPut) ( void* userData,
@ -427,7 +440,7 @@ typedef int (OTF_Handler_RMAPut) ( void* userData,
uint32_t tag,
uint64_t bytes,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_RMAPUTRE_RECORD */
typedef int (OTF_Handler_RMAPutRemoteEnd) ( void* userData,
@ -439,7 +452,7 @@ typedef int (OTF_Handler_RMAPutRemoteEnd) ( void* userData,
uint32_t tag,
uint64_t bytes,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_RMAGET_RECORD */
typedef int (OTF_Handler_RMAGet) ( void* userData,
@ -451,7 +464,7 @@ typedef int (OTF_Handler_RMAGet) ( void* userData,
uint32_t tag,
uint64_t bytes,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_RMAEND_RECORD */
typedef int (OTF_Handler_RMAEnd) ( void* userData,
@ -461,8 +474,7 @@ typedef int (OTF_Handler_RMAEnd) ( void* userData,
uint32_t communicator,
uint32_t tag,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* typedefs for OTF snapshot records *************************************** */
@ -472,7 +484,7 @@ typedef int (OTF_Handler_SnapshotComment) ( void* userData,
uint64_t time,
uint32_t process,
const char* comment,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_ENTERSNAPSHOT_RECORD */
typedef int (OTF_Handler_EnterSnapshot) ( void *userData,
@ -481,19 +493,19 @@ typedef int (OTF_Handler_EnterSnapshot) ( void *userData,
uint32_t function,
uint32_t process,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_SENDSNAPSHOT_RECORD */
typedef int (OTF_Handler_SendSnapshot) ( void *userData,
uint64_t time,
uint64_t originaltime,
uint32_t sender,
uint32_t receiver,
uint32_t procGroup,
uint32_t tag,
uint32_t length,
uint32_t source,
OTF_KeyValueList *list );
uint64_t time,
uint64_t originaltime,
uint32_t sender,
uint32_t receiver,
uint32_t procGroup,
uint32_t tag,
uint32_t length,
uint32_t source,
OTF_KeyValueList *list );
/* # OTF_OPENFILESNAPSHOT_RECORD */
typedef int (OTF_Handler_OpenFileSnapshot) ( void* userData,
@ -503,7 +515,7 @@ typedef int (OTF_Handler_OpenFileSnapshot) ( void* userData,
uint32_t process,
uint64_t handleid,
uint32_t source,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_BEGINCOLLOPSNAPSHOT_RECORD */
typedef int (OTF_Handler_BeginCollopSnapshot) ( void* userData,
@ -517,16 +529,33 @@ typedef int (OTF_Handler_BeginCollopSnapshot) ( void* userData,
uint64_t sent,
uint64_t received,
uint32_t scltoken,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_BEGINFILEOPSNAPSHOT_RECORD */
typedef int (OTF_Handler_BeginFileOpSnapshot) ( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint64_t matchingId,
uint32_t scltoken,
OTF_KeyValueList *list );
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint64_t matchingId,
uint32_t scltoken,
OTF_KeyValueList *list );
/* # OTF_COLLOPCOUNTSNAPSHOT_RECORD */
typedef int (OTF_Handler_CollopCountSnapshot) ( void* userData,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList *list );
/* # OTF_COUNTERSNAPSHOT_RECORD */
typedef int (OTF_Handler_CounterSnapshot) ( void* userData,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList *list );
/* typedefs for OTF summary records **************************************** */
@ -537,7 +566,7 @@ typedef int (OTF_Handler_SummaryComment) ( void* userData,
uint64_t time,
uint32_t process,
const char* comment,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_FUNCTIONSUMMARY_RECORD */
typedef int (OTF_Handler_FunctionSummary) ( void* userData,
@ -547,7 +576,7 @@ typedef int (OTF_Handler_FunctionSummary) ( void* userData,
uint64_t invocations,
uint64_t exclTime,
uint64_t inclTime,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_FUNCTIONGROUPSUMMARY_RECORD */
typedef int (OTF_Handler_FunctionGroupSummary) ( void* userData,
@ -557,7 +586,7 @@ typedef int (OTF_Handler_FunctionGroupSummary) ( void* userData,
uint64_t invocations,
uint64_t exclTime,
uint64_t inclTime,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_MESSAGESUMMARY_RECORD */
typedef int (OTF_Handler_MessageSummary) ( void* userData,
@ -570,7 +599,7 @@ typedef int (OTF_Handler_MessageSummary) ( void* userData,
uint64_t receivedNumber,
uint64_t sentBytes,
uint64_t receivedBytes,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_COLLOPSUMMARY_RECORD */
typedef int (OTF_Handler_CollopSummary) ( void *userData,
@ -582,7 +611,7 @@ typedef int (OTF_Handler_CollopSummary) ( void *userData,
uint64_t receivedNumber,
uint64_t sentBytes,
uint64_t receivedBytes,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_FILEOPERATIONSUMMARY_RECORD */
typedef int (OTF_Handler_FileOperationSummary) ( void* userData,
@ -596,7 +625,7 @@ typedef int (OTF_Handler_FileOperationSummary) ( void* userData,
uint64_t nseek,
uint64_t bytesread,
uint64_t byteswrite,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_FILEGROUPOPERATIONSUMMARY_RECORD */
typedef int (OTF_Handler_FileGroupOperationSummary) ( void* userData,
@ -610,7 +639,7 @@ typedef int (OTF_Handler_FileGroupOperationSummary) ( void* userData,
uint64_t nseek,
uint64_t bytesread,
uint64_t byteswrite,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_UNKNOWN_RECORD */
typedef int (OTF_Handler_UnknownRecord) ( void *userData,
@ -628,7 +657,7 @@ typedef int (OTF_Handler_DefMarker) ( void *userData,
uint32_t token,
const char* name,
uint32_t type,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/* # OTF_MARKER_RECORD */
typedef int (OTF_Handler_Marker) ( void *userData,
@ -636,7 +665,7 @@ typedef int (OTF_Handler_Marker) ( void *userData,
uint32_t process,
uint32_t token,
const char* text,
OTF_KeyValueList *list );
OTF_KeyValueList *list );
/** @endcond */
@ -645,4 +674,3 @@ typedef int (OTF_Handler_Marker) ( void *userData,
#endif /* __cplusplus */
#endif /* OTF_HANDLERARRAY_H */

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

@ -85,6 +85,17 @@ uint8_t OTF_KeyValueList_close(OTF_KeyValueList* list) {
return 0;
}
OTF_KeyValueList* OTF_KeyValueList_clone(OTF_KeyValueList* list) {
OTF_KeyValueList *new_list;
new_list = OTF_KeyValueList_new();
if ( new_list == NULL || list == NULL ) {
return new_list;
}
OTF_KeyValueList_appendKeyValueList( new_list, list );
return new_list;
}
uint8_t OTF_KeyValueList_reset(OTF_KeyValueList* list) {
/*OTF_KeyValuePairList *next;

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

@ -268,6 +268,19 @@ OTF_KeyValueList *OTF_KeyValueList_new(void);
uint8_t OTF_KeyValueList_close(OTF_KeyValueList* list);
/**
* Clone an OTF_KeyValueList instance.
*
* @param list Pointer to an initialized OTF_KeyValueList object or NULL.
* See also OTF_KeyValueList_new().
*
* @return Clone of the instance @a list or NULL.
*
* \ingroup keyvalue
*/
OTF_KeyValueList* OTF_KeyValueList_clone(OTF_KeyValueList* list);
/**
* Reset an OTF_KeyValueList instance without deallocating memory.
*

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

@ -109,6 +109,10 @@ the keywords identifying record types must follow some special rules:
#define OTF_KEYWORD_S_DEFSCLFILE "SF"
#define OTF_KEYWORD_F_DEFSCLFILE 'S'
#define OTF_KEYWORD_L_DEFUNIQUEID "UNIQUEID"
#define OTF_KEYWORD_S_DEFUNIQUEID "UI"
#define OTF_KEYWORD_F_DEFUNIQUEID 'U'
#define OTF_KEYWORD_L_DEFVERSION "VERSION"
#define OTF_KEYWORD_S_DEFVERSION "V"
#define OTF_KEYWORD_F_DEFVERSION 'V'
@ -141,6 +145,10 @@ the keywords identifying record types must follow some special rules:
#define OTF_KEYWORD_S_DEFPROCESSSUBSTITUTES "PS"
#define OTF_KEYWORD_F_DEFPROCESSSUBSTITUTES 'P'
#define OTF_KEYWORD_L_DEFAUXSAMPLEPOINT "AUXSAMPLEPOINT"
#define OTF_KEYWORD_S_DEFAUXSAMPLEPOINT "AUX"
#define OTF_KEYWORD_F_DEFAUXSAMPLEPOINT 'A'
/* *** event record keywords *** */
#define OTF_KEYWORD_L_NOOP "NOOP"
@ -303,6 +311,14 @@ the keywords identifying record types must follow some special rules:
#define OTF_KEYWORD_S_SNAPSHOT_BEGINFILEOP "BF"
#define OTF_KEYWORD_F_SNAPSHOT_BEGINFILEOP 'B'
#define OTF_KEYWORD_L_SNAPSHOT_COLLOPCOUNT "COLLOPCOUNT"
#define OTF_KEYWORD_S_SNAPSHOT_COLLOPCOUNT "COC"
#define OTF_KEYWORD_F_SNAPSHOT_COLLOPCOUNT 'C'
#define OTF_KEYWORD_L_SNAPSHOT_COUNTER "COUNTER"
#define OTF_KEYWORD_S_SNAPSHOT_COUNTER "CNT"
#define OTF_KEYWORD_F_SNAPSHOT_COUNTER 'C'
/* *** marker keywords */
@ -346,6 +362,9 @@ the keywords identifying record types must follow some special rules:
#define OTF_KEYWORD_L_LOCAL_COUNT "COUNT"
#define OTF_KEYWORD_S_LOCAL_COUNT "N"
#define OTF_KEYWORD_L_LOCAL_COUNTER "COUNTER"
#define OTF_KEYWORD_S_LOCAL_COUNTER "CNT"
#define OTF_KEYWORD_L_LOCAL_DURATION "DUR"
#define OTF_KEYWORD_S_LOCAL_DURATION "D"

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

@ -12,7 +12,6 @@
#include "OTF_MasterControl.h"
#include "OTF_Errno.h"
/** constructor - internal use only */
int OTF_MasterControl_init( OTF_MasterControl* mc );
@ -199,6 +198,39 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
OTF_RBuffer_printRecord( buffer );
*/
/* IOFSL config line */
if ( OTF_RBuffer_testChar( buffer, 'i' ) ) {
uint32_t server_num;
OTF_IofslMode mode;
uint32_t streamid_bits;
server_num = OTF_RBuffer_readUint32( buffer );
if ( ! OTF_RBuffer_testChar( buffer, ':') ) {
OTF_Error( "OTF_MasterControl_read() "
"ERROR: missing expected character ':'" );
return 0;
}
mode = (OTF_IofslMode)OTF_RBuffer_readUint32( buffer );
if ( mode != OTF_IOFSL_MULTIFILE_SPLIT
&& mode != OTF_IOFSL_MULTIFILE ) {
OTF_Error( "OTF_MasterControl_read() "
"ERROR: invalid IofslMode." );
return 0;
}
if ( ! OTF_RBuffer_testChar( buffer, ':') ) {
OTF_Error( "OTF_MasterControl_read() "
"ERROR: missing expected character ':'" );
return 0;
}
streamid_bits = OTF_RBuffer_readUint32( buffer );
OTF_RBuffer_readNewline( buffer );
OTF_FileManager_setIofsl( mc->manager,
server_num, NULL, mode,
0, 0, streamid_bits );
continue;
}
/* read argument */
argument= OTF_RBuffer_readUint32( buffer );
if ( ! OTF_RBuffer_testChar( buffer, ':' ) ) {
@ -704,6 +736,25 @@ int OTF_MasterControl_write( OTF_MasterControl* mc, const char* namestub ) {
OTF_WBuffer_writeNewline( buffer );
}
if ( OTF_FileManager_isIofsl( mc->manager ) ) {
uint32_t server_num;
char ** server_list;
OTF_IofslMode mode;
uint32_t flags;
uint32_t index_buffer_length;
uint32_t streamid_bits;
OTF_FileManager_getIofsl( mc->manager,
&server_num, &server_list, &mode,
&flags, &index_buffer_length, &streamid_bits );
OTF_WBuffer_writeChar( buffer, 'i' );
OTF_WBuffer_writeUint32( buffer, server_num );
OTF_WBuffer_writeChar( buffer, ':' );
OTF_WBuffer_writeUint32( buffer, (uint32_t)mode );
OTF_WBuffer_writeChar( buffer, ':' );
OTF_WBuffer_writeUint32( buffer, streamid_bits );
OTF_WBuffer_writeNewline( buffer );
}
OTF_WBuffer_close( buffer );
return 1;
@ -967,3 +1018,28 @@ uint32_t OTF_MasterControl_getNewStreamId( OTF_MasterControl* mc ) {
}
OTF_MasterControl* OTF_MasterControl_clone( OTF_MasterControl* mc,
OTF_FileManager* manager ) {
int ret= 1;
uint32_t i;
OTF_MasterControl* mc_clone;
mc_clone= OTF_MasterControl_new( manager );
if ( !mc_clone )
return NULL;
for ( i= 0; i < mc->n; i++ ) {
OTF_MapEntry* entry= &mc->map[i];
ret = ret && OTF_MasterControl_appendList( mc_clone,
entry->argument, entry->n, entry->values );
}
if ( !ret ) {
OTF_MasterControl_close( mc_clone );
return NULL;
}
return mc_clone;
}

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

@ -240,6 +240,20 @@ void OTF_MasterControl_finish( OTF_MasterControl* mc );
*/
void OTF_MasterControl_close( OTF_MasterControl* mc );
/**
* Makes a clone of an existing OTF_MasterControl object.
*
* @param mc Pointer to an initialized OTF_Mastercontrol object.
* See also OTF_MasterControl_new().
* @param manager File handle manager.
*
* @return Cloned master control object
*
* \ingroup mc
*/
OTF_MasterControl* OTF_MasterControl_clone( OTF_MasterControl* mc,
OTF_FileManager* manager );
/**
* Append the mapping argument -> value to the master control structure,
*

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

@ -97,6 +97,12 @@ int OTF_Reader_readDefScl( OTF_RBuffer* buffer,
int OTF_Reader_readDefSclFile( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid );
/** This function reads a DEFUNIQUEID record from buffer,
parse the parameter of the record and call the
appropriate handler.*/
int OTF_Reader_readDefUniqueId( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid );
/** This function reads a DEFVERSION record from buffer,
parse the parameter of the record and call the
appropriate handler.*/
@ -133,6 +139,10 @@ int OTF_Reader_readDefCounterAssignments( OTF_RBuffer* buffer,
int OTF_Reader_readDefProcessSubstitutes( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid );
int OTF_Reader_readDefAuxSamplePoint( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid );
/* *** Event records *** ****************************************** */
@ -299,6 +309,18 @@ int OTF_Reader_readBeginCollopSnapshot( OTF_RBuffer* buffer,
int OTF_Reader_readBeginFileOpSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers );
/** This function reads a TCOLLOPCOUNT record from buffer,
parse the parameter of the record and call the
appropriate handler.*/
int OTF_Reader_readCollopCountSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers );
/** This function reads a TCOUNTER record from buffer,
parse the parameter of the record and call the
appropriate handler.*/
int OTF_Reader_readCounterSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers );
/* *** Summary records *** ****************************************** */
@ -552,7 +574,8 @@ int OTF_Reader_parseEventRecord( OTF_RBuffer* buffer,
return OTF_Reader_readRMAPut( buffer, handlers );
}
break;
/* try inline snapshots */
return OTF_Reader_parseSnapshotsRecord( buffer, handlers );
case OTF_KEYWORD_F_RMAPUTRE /* U */ :
@ -620,6 +643,7 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
switch( buffer->buffer[buffer->pos] ) {
/* case OTF_KEYWORD_F_DEFAUXSAMPLEPOINT 'A' : */
case OTF_KEYWORD_F_DEFATTRLIST /* 'A' */ :
if ( OTF_RBuffer_testKeyword( buffer,
@ -630,6 +654,12 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
return OTF_Reader_readDefAttributeList( buffer, handlers, streamid );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFAUXSAMPLEPOINT ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFAUXSAMPLEPOINT ) ) {
return OTF_Reader_readDefAuxSamplePoint( buffer, handlers, streamid );
}
break;
/* case OTF_KEYWORD_F_DEFINITIONCOMMENT 'C' :*/
@ -811,6 +841,16 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
return OTF_Reader_readDefVersion( buffer, handlers, streamid );
}
break;
case OTF_KEYWORD_F_DEFUNIQUEID /* 'U' */ :
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFUNIQUEID ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFUNIQUEID ) ) {
return OTF_Reader_readDefUniqueId( buffer, handlers, streamid );
}
break;
}
@ -996,6 +1036,8 @@ int OTF_Reader_parseSnapshotsRecord( OTF_RBuffer* buffer,
break;
case OTF_KEYWORD_F_SNAPSHOT_COMMENT /* 'C' */ :
/*case OTF_KEYWORD_F_SNAPSHOT_COLLOPCOUNT*/ /* 'C' */
/*case OTF_KEYWORD_F_SNAPSHOT_COUNTER*/ /* 'C' */
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_SNAPSHOT_COMMENT ) ||
@ -1005,10 +1047,22 @@ int OTF_Reader_parseSnapshotsRecord( OTF_RBuffer* buffer,
return OTF_Reader_readSnapshotComment( buffer, handlers );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_SNAPSHOT_COLLOPCOUNT )
|| OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_SNAPSHOT_COLLOPCOUNT ) ) {
return OTF_Reader_readCollopCountSnapshot( buffer, handlers );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_SNAPSHOT_COUNTER )
|| OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_SNAPSHOT_COUNTER ) ) {
return OTF_Reader_readCounterSnapshot( buffer, handlers );
}
break;
case OTF_KEYWORD_F_SNAPSHOT_BEGINCOLLOP /* 'B' */ :
/*case OTF_KEYWORD_F_SNAPSHOT_BEGINFILEOP*/ /* 'F' */
/*case OTF_KEYWORD_F_SNAPSHOT_BEGINFILEOP*/ /* 'B' */
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_SNAPSHOT_BEGINCOLLOP ) ||
@ -1941,6 +1995,39 @@ int OTF_Reader_readDefSclFile( OTF_RBuffer* buffer,
}
int OTF_Reader_readDefUniqueId( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
uint64_t uid;
if ( handlers->pointer[OTF_DEFUNIQUEID_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
uid = OTF_RBuffer_readUint64( buffer );
if ( OTF_RBuffer_readNewline( buffer ) ) {
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefUniqueId*)
handlers->pointer[OTF_DEFUNIQUEID_RECORD] )
( handlers->firsthandlerarg[OTF_DEFUNIQUEID_RECORD],
streamid, uid, buffer->list ) ) );
} else {
PARSE_ERROR( buffer );
return 0;
}
}
int OTF_Reader_readDefVersion( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
@ -2395,6 +2482,52 @@ int OTF_Reader_readDefProcessSubstitutes( OTF_RBuffer* buffer,
}
}
int OTF_Reader_readDefAuxSamplePoint( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid ) {
uint64_t time;
OTF_AuxSamplePointType type;
if ( handlers->pointer[OTF_DEFAUXSAMPLEPOINT_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
time= OTF_RBuffer_readUint64( buffer );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_TYPE ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_TYPE ) ) {
type= (OTF_AuxSamplePointType) OTF_RBuffer_readUint32( buffer );
} else {
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_readNewline( buffer ) ) {
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefAuxSamplePoint*)
handlers->pointer[OTF_DEFAUXSAMPLEPOINT_RECORD] )
( handlers->firsthandlerarg[OTF_DEFAUXSAMPLEPOINT_RECORD],
streamid, time, type, buffer->list ) ) );
} else {
PARSE_ERROR( buffer );
return 0;
}
}
/* *** Event records *** ****************************************** */
@ -4347,6 +4480,109 @@ int OTF_Reader_readBeginFileOpSnapshot( OTF_RBuffer* buffer,
}
int OTF_Reader_readCollopCountSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers ) {
uint32_t communicator;
uint64_t count;
if ( handlers->pointer[OTF_COLLOPCOUNTSNAPSHOT_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
communicator = OTF_RBuffer_readUint32( buffer );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_COUNT )
|| OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_COUNT ) ) {
count = OTF_RBuffer_readUint64( buffer );
} else {
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_readNewline( buffer ) ) {
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_CollopCountSnapshot*)
handlers->pointer[OTF_COLLOPCOUNTSNAPSHOT_RECORD] )
( handlers->firsthandlerarg[OTF_COLLOPCOUNTSNAPSHOT_RECORD],
buffer->time, buffer->process, communicator,
count, buffer->list ) ) );
} else {
PARSE_ERROR( buffer );
return 0;
}
}
int OTF_Reader_readCounterSnapshot( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers ) {
uint64_t originaltime;
uint32_t counter;
uint64_t value;
if ( handlers->pointer[OTF_COUNTERSNAPSHOT_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
originaltime = OTF_RBuffer_readUint64( buffer );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_COUNTER )
|| OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_COUNTER ) ) {
counter = OTF_RBuffer_readUint32( buffer );
} else {
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_VALUE )
|| OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_VALUE ) ) {
value = OTF_RBuffer_readUint64( buffer );
} else {
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_readNewline( buffer ) ) {
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
return OTF_RETURN_OK /*0*/ == ( (OTF_Handler_CounterSnapshot*)
handlers->pointer[OTF_COUNTERSNAPSHOT_RECORD] )(
handlers->firsthandlerarg[OTF_COUNTERSNAPSHOT_RECORD],
buffer->time,
originaltime,
buffer->process,
counter,
value,
buffer->list );
} else {
PARSE_ERROR( buffer );
return 0;
}
}
/* *** Summary records *** ****************************************** */

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

@ -20,6 +20,9 @@
#if defined(_WIN32) /* windows */
#include <Windows.h>
#include <io.h>
#include "OTF_inttypes_win.h"
int gettimeofday(struct timeval* tv, void* dummytimezone) {
@ -35,6 +38,35 @@ int gettimeofday(struct timeval* tv, void* dummytimezone) {
return 0;
}
/* Taken from: http://www.mail-archive.com/pan-devel@nongnu.org/msg00294.html */
int mkstemp(char *tmpl)
{
int ret = -1;
mktemp(tmpl);
ret = open(tmpl, O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED, _S_IREAD|_S_IWRITE);
return ret;
}
/* Taken from: http://gnuwin32.sourceforge.net/packages/libgw32c.htm */
long int nrand48 (unsigned short int xsubi[3])
{
uint64_t x = (uint64_t) xsubi[2] << 32 | (uint32_t) xsubi[1] << 16 | xsubi[0];
x = x * 0x5deece66dull + 0xb;
xsubi[0] = x & 0xffff;
xsubi[1] = (x >> 16) & 0xffff;
xsubi[2] = (x >> 32) & 0xffff;
if (sizeof (unsigned short int) == 2) {
return xsubi[2] << 15 | xsubi[1] >> 1;
} else {
return xsubi[2] >> 1;
}
}
#else /* unix */
#include <errno.h>

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

@ -23,6 +23,7 @@ extern "C" {
# include <limits.h>
# include <winsock2.h>
# include <process.h>
# define HAVE_IO_H
# define HAVE_ZLIB
@ -41,10 +42,25 @@ extern "C" {
# undef snprintf
# define snprintf _snprintf
# undef getpid
# define getpid() _getpid()
# pragma warning (disable : 4996) /* disable insecurity/deprication warnings */
int gettimeofday(struct timeval* tv, void* dummytimezone);
long int nrand48 (unsigned short int xsubi[3]);
# include <fcntl.h>
# ifndef _S_IREAD
# define _S_IREAD 256
# endif
# ifndef _S_IWRITE
# define _S_IWRITE 128
# endif
int mkstemp(char *tmpl);
#else
# error "You are using an unsupported compiler on windows."

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

@ -166,7 +166,7 @@ int OTF_RBuffer_init( OTF_RBuffer* rbuffer ) {
rbuffer->list = NULL;
#ifdef HAVE_ZLIB
rbuffer->zbuffersize= 1024*10;
rbuffer->zbuffersize= OTF_ZBUFFER_DEFAULTSIZE;
#endif /* HAVE_ZLIB */
return 1;
@ -552,10 +552,19 @@ char *OTF_RBuffer_printRecord( OTF_RBuffer* rbuffer ) {
char *ret= NULL;
uint32_t pos= 0;
uint32_t size= 0;
uint32_t size= REALLOCSIZE;
uint32_t c= rbuffer->pos;
ret= (char*) malloc( size );
if( NULL == ret ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
}
while ( ( '\n' != rbuffer->buffer[c] ) && ( c < rbuffer->end ) ) {
while( (pos+1) >= size ) {
@ -994,7 +1003,7 @@ int OTF_RBuffer_getFileProperties( OTF_RBuffer* rbuffer ) {
/* range where the last timestamp is searched */
#define SEARCH_RANGE 1024
#define SEARCH_RANGE 4096
uint64_t pos;
@ -1126,10 +1135,28 @@ int OTF_RBuffer_searchTime( OTF_RBuffer* rbuffer, uint64_t time ) {
return 1;
}
else if ( time > timeB ) {
/* consume all records, so that the caller get none */
if ( time > timeB ) {
if ( posB > rbuffer->jumpsize ) {
posB -= rbuffer->jumpsize;
} else {
posB = 0;
}
ret= OTF_RBuffer_jump( rbuffer, posB );
if ( 1 != ret ) {
time= timeB;
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unsuccessful jump to end pos= %llu.\n",
__FUNCTION__, __FILE__, __LINE__, (unsigned long long) posB );
return 0;
}
while ( OTF_RBuffer_getRecord( rbuffer ) ) {
OTF_RBuffer_readNewline( rbuffer );
}
return 1;
}

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

@ -44,7 +44,7 @@ int OTF_RStream_init( OTF_RStream* rstream ) {
rstream->buffersizes= 1024*1024;
#ifdef HAVE_ZLIB
rstream->zbuffersizes= 1024*10;
rstream->zbuffersizes= OTF_ZBUFFER_DEFAULTSIZE;
#endif /* HAVE_ZLIB */
rstream->manager= NULL;
@ -973,7 +973,7 @@ uint64_t OTF_RStream_readMarker( OTF_RStream* rstream, OTF_HandlerArray* handler
if ( NULL == rstream->markerBuffer ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no def buffer.\n",
"the stream has no marker buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
/* there is no def buffer available for this stream */

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

@ -1041,7 +1041,7 @@ int OTF_Reader_init( OTF_Reader* reader ) {
reader->buffersizes= 1024*1024;
#ifdef HAVE_ZLIB
reader->zbuffersizes= 1024 *10;
reader->zbuffersizes= OTF_ZBUFFER_DEFAULTSIZE;
#endif /* HAVE_ZLIB */
reader->manager= NULL;

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

@ -17,8 +17,8 @@
#define OTF_VERSION_MAJOR 1
#define OTF_VERSION_MINOR 10
#define OTF_VERSION_SUB 2
#define OTF_VERSION_MINOR 11
#define OTF_VERSION_SUB 1
#define OTF_VERSION_STRING "openmpi"
/**

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

@ -42,7 +42,7 @@ int OTF_WBuffer_init( OTF_WBuffer* wbuffer ) {
wbuffer->time = 0;
#ifdef HAVE_ZLIB
wbuffer->zbuffersize= 1024*10;
wbuffer->zbuffersize= OTF_ZBUFFER_DEFAULTSIZE;
#endif /* HAVE_ZLIB */
return 1;
@ -79,17 +79,33 @@ OTF_WBuffer* OTF_WBuffer_open( const char* filename, OTF_FileManager* manager )
int OTF_WBuffer_close( OTF_WBuffer* wbuffer ) {
int ret;
if( (uint32_t) -1 != wbuffer->process ) {
OTF_WBuffer_writeUint64( wbuffer, wbuffer->time );
OTF_WBuffer_writeNewline( wbuffer );
OTF_WBuffer_writeChar( wbuffer, '*' );
OTF_WBuffer_writeUint32( wbuffer, wbuffer->process );
OTF_WBuffer_writeNewline( wbuffer );
}
# ifndef OTF_DEBUG
int ret= OTF_WBuffer_flush( wbuffer );
{
ret= OTF_WBuffer_flush( wbuffer );
ret&= OTF_File_close( wbuffer->file );
ret&= OTF_WBuffer_finish( wbuffer );
}
# else
int ret= 1;
int tmpret= OTF_WBuffer_flush( wbuffer );
{
int tmpret;
ret= 1;
tmpret= OTF_WBuffer_flush( wbuffer );
if( 0 == tmpret ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
@ -115,7 +131,7 @@ int OTF_WBuffer_close( OTF_WBuffer* wbuffer ) {
__FUNCTION__, __FILE__, __LINE__ );
}
ret&= tmpret;
}
# endif
free( wbuffer );

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -572,6 +572,18 @@ int OTF_WStream_writeDefCreator( OTF_WStream* wstream, const char* creator );
*/
int OTF_WStream_writeDefCreatorKV( OTF_WStream* wstream, const char* creator, OTF_KeyValueList* list );
/**
* Write a DEFUNIQUEID record to stream 'wstream'.
* This record is generated automatically at beginning of tracing in the global
* definition stream.
*
* @param wstream Initialized OTF_WStream instance.
* @return 1 on success, 0 if an error occurs.
*
* \ingroup wstream
*/
int OTF_WStream_writeUniqueId( OTF_WStream* wstream );
/** Write a DEFVERSION record to stream 'wstream'.
* @see OTF_Writer_writeOtfVersion()
* \ingroup wstream
@ -649,6 +661,16 @@ int OTF_WStream_writeDefProcessSubstitutes( OTF_WStream* wstream,
OTF_KeyValueList* list );
/** Write a DEFAUXSAMPLEPOINT record to stream 'wstream'.
* @see OTF_Writer_writeDefAuxSamplePoint()
* \ingroup wstream
*/
int OTF_WStream_writeDefAuxSamplePoint( OTF_WStream* wstream,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list );
/* *** event record write handlers *** ************************************* */
@ -1043,7 +1065,31 @@ int OTF_WStream_writeBeginFileOpSnapshotKV( OTF_WStream* wstream, uint64_t time,
uint32_t scltoken, OTF_KeyValueList *list );
/** Write a TCOLLOPCOUNT record to stream 'wstream'.
* @see OTF_Writer_writeCollopCountSnapshot()
* \ingroup wstream
*/
int OTF_WStream_writeCollopCountSnapshot( OTF_WStream* wstream,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList* list );
/** Write a TCOUNTER record to stream 'wstream'.
* @see OTF_Writer_writeCounterSnapshot()
* \ingroup wstream
*/
int OTF_WStream_writeCounterSnapshot( OTF_WStream* wstream,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList* list );
/* *** public statistics record write handlers *** */

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

@ -46,33 +46,38 @@ struct struct_OTF_Writer {
/** Default size of buffers managed by this Writer. */
uint32_t buffersizes;
/** Default output format */
uint32_t format;
/** Default output format */
uint32_t format;
/** File handle manager. Handles the re-usage of file handles
in a thread safe way. */
OTF_FileManager* manager;
#ifdef HAVE_ZLIB
/** Default compression type of buffers managed by this writer */
OTF_FileCompression compression;
/** Default size of zbuffers managed by this reader. */
uint32_t zbuffersizes;
/** Default compression type of buffers managed by this writer */
OTF_FileCompression compression;
/** Default size of zbuffers managed by this reader. */
uint32_t zbuffersizes;
#endif /* HAVE_ZLIB */
/** Has the OtfVersion record been written? 1= yes 0= no */
uint32_t versionWritten;
/** Are the definition header records (e.g. DEFVERSION, DEFUNIQUEID)
written? 1= yes 0= no */
uint32_t defHeaderWritten;
};
/** constructor - internal use only */
/** constructor - internal use only */
int OTF_Writer_init( OTF_Writer* writer );
/** destructor - internal use only */
int OTF_Writer_finish( OTF_Writer* writer );
/** write header records (e.g. DEFVERSION, DEFUNIQUEID) to global
definition stream - internal use only */
int OTF_Writer_writeDefinitionHeader( OTF_Writer* writer );
/* ************************************************************************* */
@ -95,10 +100,10 @@ int OTF_Writer_init( OTF_Writer* writer ) {
#ifdef HAVE_ZLIB
writer->compression= 0;
writer->zbuffersizes= 1024 *10;
writer->zbuffersizes= OTF_ZBUFFER_DEFAULTSIZE;
#endif /* HAVE_ZLIB */
writer->versionWritten= 0;
writer->defHeaderWritten= 0;
return 1;
}
@ -353,7 +358,7 @@ uint32_t OTF_Writer_getZBufferSizes( OTF_Writer* writer ) {
void OTF_Writer_setFormat( OTF_Writer* writer, uint32_t format ) {
if ( format > 1 ) {
if ( format > 3 ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unknown ouput format chosen.\n",
@ -581,6 +586,20 @@ void OTF_Writer_setMasterControl( OTF_Writer* writer, OTF_MasterControl* mc ) {
}
int OTF_Writer_writeDefinitionHeader( OTF_Writer* writer ) {
/* write DEFVERSION record */
if ( 0 == OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) ) )
return 0;
/* write DEFUNIQUEID record */
if ( 0 == OTF_WStream_writeUniqueId( OTF_Writer_getStream( writer, 0 ) ) )
return 0;
return 1;
}
/* *** definition record write handlers *** ******************************** */
@ -590,10 +609,10 @@ int OTF_Writer_writeDefinitionComment( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefinitionComment( stream, comment );
@ -605,12 +624,12 @@ int OTF_Writer_writeDefinitionCommentKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefinitionCommentKV( stream, comment, list );
}
@ -621,12 +640,12 @@ int OTF_Writer_writeDefTimerResolution( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefTimerResolution( stream, ticksPerSecond );
}
@ -636,12 +655,12 @@ int OTF_Writer_writeDefTimerResolutionKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefTimerResolutionKV( stream, ticksPerSecond, list );
}
@ -652,12 +671,12 @@ int OTF_Writer_writeDefProcess( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcess( stream, deftoken, name, parent );
}
@ -667,12 +686,12 @@ int OTF_Writer_writeDefProcessKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessKV( stream, deftoken, name, parent, list );
}
@ -684,12 +703,12 @@ int OTF_Writer_writeDefProcessGroup( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessGroup( stream, deftoken,
name, n, (uint32_t*) array );
}
@ -701,12 +720,12 @@ int OTF_Writer_writeDefProcessGroupKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessGroupKV( stream, deftoken,
name, n, (uint32_t*) array, list );
}
@ -718,10 +737,10 @@ int OTF_Writer_writeDefAttributeList ( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefAttributeList( stream, attr_token, num, array );
@ -733,10 +752,10 @@ int OTF_Writer_writeDefAttributeListKV ( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefAttributeListKV( stream, attr_token, num, array, list );
@ -749,10 +768,10 @@ int OTF_Writer_writeDefProcessOrGroupAttributes( OTF_Writer* writer, uint32_t st
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessOrGroupAttributes( stream, proc_token, attr_token );
@ -764,10 +783,10 @@ int OTF_Writer_writeDefProcessOrGroupAttributesKV( OTF_Writer* writer, uint32_t
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessOrGroupAttributesKV( stream, proc_token, attr_token, list );
@ -780,12 +799,12 @@ int OTF_Writer_writeDefFunction( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefFunction( stream, deftoken, name, group,
scltoken );
}
@ -796,12 +815,12 @@ int OTF_Writer_writeDefFunctionKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefFunctionKV( stream, deftoken, name, group,
scltoken, list );
}
@ -813,12 +832,12 @@ int OTF_Writer_writeDefFunctionGroup( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefFunctionGroup( stream, deftoken, name );
}
@ -828,12 +847,12 @@ int OTF_Writer_writeDefFunctionGroupKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefFunctionGroupKV( stream, deftoken, name, list );
}
@ -844,12 +863,12 @@ int OTF_Writer_writeDefCollectiveOperation( OTF_Writer* writer, uint32_t streami
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCollectiveOperation( stream, collective, name, type );
}
@ -859,12 +878,12 @@ int OTF_Writer_writeDefCollectiveOperationKV( OTF_Writer* writer, uint32_t strea
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCollectiveOperationKV( stream, collective, name, type, list );
}
@ -876,12 +895,12 @@ int OTF_Writer_writeDefCounter( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCounter( stream, deftoken, name, properties,
countergroup, unit );
}
@ -893,12 +912,12 @@ int OTF_Writer_writeDefCounterKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCounterKV( stream, deftoken, name, properties,
countergroup, unit, list );
}
@ -910,12 +929,12 @@ int OTF_Writer_writeDefCounterGroup( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCounterGroup( stream, deftoken, name );
}
@ -925,12 +944,12 @@ int OTF_Writer_writeDefCounterGroupKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCounterGroupKV( stream, deftoken, name, list );
}
@ -941,12 +960,12 @@ int OTF_Writer_writeDefScl( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefScl( stream, deftoken, sclfile, sclline );
}
@ -956,12 +975,12 @@ int OTF_Writer_writeDefSclKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefSclKV( stream, deftoken, sclfile, sclline, list );
}
@ -972,12 +991,12 @@ int OTF_Writer_writeDefSclFile( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefSclFile( stream, deftoken, filename );
}
@ -987,12 +1006,12 @@ int OTF_Writer_writeDefSclFileKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefSclFileKV( stream, deftoken, filename, list );
}
@ -1015,12 +1034,12 @@ int OTF_Writer_writeDefCreator( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCreator( stream, creator );
}
@ -1030,12 +1049,12 @@ int OTF_Writer_writeDefCreatorKV( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCreatorKV( stream, creator, list );
}
@ -1084,12 +1103,12 @@ int OTF_Writer_writeDefKeyValue( OTF_Writer* writer, uint32_t streamid,
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefKeyValue( stream, key, type, name, description );
}
@ -1099,12 +1118,12 @@ int OTF_Writer_writeDefKeyValueKV( OTF_Writer* writer, uint32_t streamid, uint32
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefKeyValueKV( stream, key, type, name, description, list );
}
@ -1118,10 +1137,10 @@ int OTF_Writer_writeDefTimeRange( OTF_Writer* writer,
OTF_WStream* stream= OTF_Writer_getStream( writer, streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefTimeRange( stream,
@ -1141,10 +1160,10 @@ int OTF_Writer_writeDefCounterAssignments( OTF_Writer* writer,
OTF_WStream* stream= OTF_Writer_getStream( writer, streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefCounterAssignments( stream,
@ -1162,10 +1181,10 @@ int OTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer, uint32_t streamid
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
if ( 0 == writer->defHeaderWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefProcessSubstitutes( stream, representative,
@ -1173,6 +1192,24 @@ int OTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer, uint32_t streamid
}
int OTF_Writer_writeDefAuxSamplePoint( OTF_Writer* writer,
uint32_t streamid,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list ) {
OTF_WStream* stream= OTF_Writer_getStream( writer, streamid );
if ( 0 == writer->defHeaderWritten ) {
OTF_Writer_writeDefinitionHeader( writer );
writer->defHeaderWritten= 1;
}
return OTF_WStream_writeDefAuxSamplePoint( stream, time, type, list );
}
/* *** Event Records *** ****************************************** */
@ -1794,6 +1831,44 @@ int OTF_Writer_writeBeginFileOpSnapshotKV( OTF_Writer* writer, uint64_t time,
}
int OTF_Writer_writeCollopCountSnapshot( OTF_Writer* writer,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList *list ) {
OTF_WStream* stream= OTF_Writer_getStream( writer,
OTF_Writer_mapProcess( writer, process ) );
return OTF_WStream_writeCollopCountSnapshot( stream,
time,
process,
communicator,
count,
list );
}
int OTF_Writer_writeCounterSnapshot( OTF_Writer* writer,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList *list ) {
OTF_WStream* stream= OTF_Writer_getStream( writer,
OTF_Writer_mapProcess( writer, process ) );
return OTF_WStream_writeCounterSnapshot( stream,
time,
originaltime,
process,
counter,
value,
list );
}
/* *** public statistics record write handlers *** */

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

@ -1030,16 +1030,12 @@ int OTF_Writer_writeDefKeyValueKV( OTF_Writer* writer,
/**
* Writes a TimeRange definition
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param writer Initialized OTF_Writer instance.
* @param streamid Identifies the stream to which this definition
* belongs to. stream = 0 represents a global
* definition.
*
* @param minTime The smallest timestamp of the events in this @a streamid.
*
* @param maxTime The greates timestamp of the events in this @a streamid (inclusive).
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* @return 1 on success, 0 if an error occurs.
@ -1055,19 +1051,14 @@ int OTF_Writer_writeDefTimeRange( OTF_Writer* writer,
/**
* Writes a CounterAssignments definition
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param writer Initialized OTF_Writer instance.
* @param streamid Identifies the stream to which this definition
* belongs to. stream = 0 represents a global
* definition.
*
* @param counter_token Counter id.
*
* @param number_of_members Number of entries in @procs_or_groups array.
*
* @param procs_or_groups The processes or process groups which have recorded
* counter data for counter @counter_token.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* @return 1 on success, 0 if an error occurs.
@ -1085,20 +1076,15 @@ int OTF_Writer_writeDefCounterAssignments( OTF_Writer* writer,
/**
* Writes a ProcessSubstitutes definition record
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @param writer Initialized OTF_Writer instance.
* @param streamid Identifies the stream to which this definition
* belongs to. stream = 0 represents a global
* definition.
*
* @param representative Process ID of the process that represents several others.
*
* @param numberOfProcs Number of entries in @procs array.
*
* @param procs The processes which are represented by
* @representative. It may or may not include
* @representative itself.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* @return 1 on success, 0 if an error occurs.
@ -1113,6 +1099,31 @@ int OTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer,
OTF_KeyValueList* list );
/**
* Write a auxiliary sample point definition record.
*
* @param writer Initialized OTF_Writer instance.
* @param stream Target stream identifier with
* 0 < stream <= number of streams as defined in
* OTF_Writer_open().
* @param time Time at which the auxiliary sample point information
* is available.
* @param type Type of the auxiliary sample point.
* See @a OTF_AuxSamplePointType.
*
* @param list Pointer to an OTF_KeyValueList() that contains individual data.
*
* @return 1 on success, 0 if an error occurs.
*
* \ingroup writer
*/
int OTF_Writer_writeDefAuxSamplePoint( OTF_Writer* writer,
uint32_t streamid,
uint64_t time,
OTF_AuxSamplePointType type,
OTF_KeyValueList* list );
/**
* Write a no-operation record. This can be used to write an OTF_KeyValueList
* that is not attached to a special event record.
@ -2194,6 +2205,54 @@ int OTF_Writer_writeBeginFileOpSnapshotKV( OTF_Writer* writer,
uint32_t scltoken,
OTF_KeyValueList* list );
/**
* Write a snapshot for the count of finished collective operations from this
* process on this communicator.
*
* @param writer Initialized OTF_Writer instance.
* @param time Time when the snapshot was written(current time).
* @param process Process identifier > 0.
* @param communicator The communicator for what the count is for.
* @param count The count of completed collective operations from process @.
*
* @param list Initialized OTF_KeyValueList() instance or NULL.
*
* @return 1 on success, 0 if an error occurs.
*
* \ingroup writer
*/
int OTF_Writer_writeCollopCountSnapshot( OTF_Writer* writer,
uint64_t time,
uint32_t process,
uint32_t communicator,
uint64_t count,
OTF_KeyValueList *list );
/**
* Write a snapshot for the last value of a counter into the snapshot.
*
* @param writer Initialized OTF_Writer instance.
* @param time Time when the snapshot was written(current time).
* @param originaltime Sample time of the value.
* @param process Process identifier > 0.
* @param counter The counter.
* @param value The value of the counter.
*
* @param list Initialized OTF_KeyValueList() instance or NULL.
*
* @return 1 on success, 0 if an error occurs.
*
* \ingroup writer
*/
int OTF_Writer_writeCounterSnapshot( OTF_Writer* writer,
uint64_t time,
uint64_t originaltime,
uint32_t process,
uint32_t counter,
uint64_t value,
OTF_KeyValueList *list );
/* *** public statistics record write handlers *** */

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

@ -300,6 +300,10 @@
RelativePath=".\OTF_File.h"
>
</File>
<File
RelativePath=".\OTF_File_iofsl.h"
>
</File>
<File
RelativePath=".\OTF_FileManager.h"
>
@ -404,6 +408,10 @@
RelativePath=".\OTF_File.c"
>
</File>
<File
RelativePath=".\OTF_File_iofsl.c"
>
</File>
<File
RelativePath=".\OTF_FileManager.c"
>

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

@ -89,10 +89,14 @@
%ignore OTF_Handler_DefScl;
%ignore OTF_Handler_DefSclFile;
%ignore OTF_Handler_DefCreator;
%ignore OTF_Handler_DefUniqueId;
%ignore OTF_Handler_DefVersion;
%ignore OTF_Handler_DefFile;
%ignore OTF_Handler_DefFileGroup;
%ignore OTF_Handler_DefKeyValue;
%ignore OTF_Handler_DefTimeRange;
%ignore OTF_Handler_DefCounterAssignments;
%ignore OTF_Handler_DefProcessSubstitutes;
%ignore OTF_Handler_NoOp;
%ignore OTF_Handler_Enter;
%ignore OTF_Handler_Leave;
@ -118,6 +122,8 @@
%ignore OTF_Handler_OpenFileSnapshot;
%ignore OTF_Handler_BeginCollopSnapshot;
%ignore OTF_Handler_BeginFileOpSnapshot;
%ignore OTF_Handler_CollopCountSnapshot;
%ignore OTF_Handler_CounterSnapshot;
%ignore OTF_Handler_SummaryComment;
%ignore OTF_Handler_FunctionSummary;
%ignore OTF_Handler_FunctionGroupSummary;
@ -168,6 +174,8 @@
%ignore OTF_Writer_writeDefProcessGroup;
%ignore OTF_Writer_writeDefAttributeListKV;
%ignore OTF_Writer_writeDefAttributeList;
%ignore OTF_Writer_writeDefCounterAssignments;
%ignore OTF_Writer_writeDefProcessSubstitutes;
%include ../otflib/OTF_Writer.h
@ -196,6 +204,8 @@
%rename(OTF_Writer_writeDefProcessGroup) pyOTF_Writer_writeDefProcessGroup;
%rename(OTF_Writer_writeDefAttributeListKV) pyOTF_Writer_writeDefAttributeListKV;
%rename(OTF_Writer_writeDefAttributeList) pyOTF_Writer_writeDefAttributeList;
%rename(OTF_Writer_writeDefCounterAssignments) pyOTF_Writer_writeDefCounterAssignments;
%rename(OTF_Writer_writeDefProcessSubstitutes) pyOTF_Writer_writeDefProcessSubstitutes;
%ignore pyOTF_FirstHandlerArgument;
@ -215,10 +225,14 @@
%ignore pyOTF_Handler_DefScl;
%ignore pyOTF_Handler_DefSclFile;
%ignore pyOTF_Handler_DefCreator;
%ignore pyOTF_Handler_DefUniqueId;
%ignore pyOTF_Handler_DefVersion;
%ignore pyOTF_Handler_DefFile;
%ignore pyOTF_Handler_DefFileGroup;
%ignore pyOTF_Handler_DefKeyValue;
%ignore pyOTF_Handler_DefTimeRange;
%ignore pyOTF_Handler_DefCounterAssignments;
%ignore pyOTF_Handler_DefProcessSubstitutes;
%ignore pyOTF_Handler_NoOp;
%ignore pyOTF_Handler_Enter;
%ignore pyOTF_Handler_Leave;
@ -244,6 +258,8 @@
%ignore pyOTF_Handler_OpenFileSnapshot;
%ignore pyOTF_Handler_BeginCollopSnapshot;
%ignore pyOTF_Handler_BeginFileOpSnapshot;
%ignore pyOTF_Handler_CollopCountSnapshot;
%ignore pyOTF_Handler_CounterSnapshot;
%ignore pyOTF_Handler_SummaryComment;
%ignore pyOTF_Handler_FunctionSummary;
%ignore pyOTF_Handler_FunctionGroupSummary;
@ -430,6 +446,17 @@ def OTF_CopyHandler_DefCreator( writer , stream,
return OTF_RETURN_OK
def OTF_CopyHandler_DefUniqueId( writer , stream,
uid, pylist):
if OTF_Writer_writeDefUniqueId( writer , stream,
uid, pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_DefVersion( writer , stream,
major, minor, sub,
string, pylist):
@ -476,6 +503,43 @@ def OTF_CopyHandler_DefKeyValue( writer , stream,
return OTF_RETURN_OK
def OTF_CopyHandler_DefTimeRange( writer , stream,
minTime, maxTime, pylist):
if OTF_Writer_writeDefTimeRange( writer , stream,
minTime, maxTime, pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_DefCounterAssignments( writer , stream,
counter, number_of_members, pyprocs_or_groups,
pylist):
if OTF_Writer_writeDefCounterAssignments( writer , stream,
counter, number_of_members, pyprocs_or_groups,
pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_DefProcessSubstitutes( writer , stream,
representative, numberOfProcs, pyprocs,
pylist):
if OTF_Writer_writeDefProcessSubstitutes( writer , stream,
representative, numberOfProcs, pyprocs,
pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_NoOp( writer , time,
process, pylist):
@ -813,6 +877,32 @@ def OTF_CopyHandler_BeginFileOpSnapshot( writer , time,
return OTF_RETURN_OK
def OTF_CopyHandler_CollopCountSnapshot( writer , time,
process, communicator, count,
pylist):
if OTF_Writer_writeCollopCountSnapshot( writer , time,
process, communicator, count,
pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_CounterSnapshot( writer , time,
originaltime, process, counter,
value, pylist):
if OTF_Writer_writeCounterSnapshot( writer , time,
originaltime, process, counter,
value, pylist ) == 0 :
return OTF_RETURN_ABORT
else :
return OTF_RETURN_OK
def OTF_CopyHandler_SummaryComment( writer , time,
process, comment, pylist):
@ -995,6 +1085,9 @@ def OTF_HandlerArray_getCopyHandler( handlers, writer ):
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefCreator, OTF_DEFCREATOR_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFCREATOR_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefUniqueId, OTF_DEFUNIQUEID_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFUNIQUEID_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefVersion, OTF_DEFVERSION_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFVERSION_RECORD )
@ -1007,6 +1100,15 @@ def OTF_HandlerArray_getCopyHandler( handlers, writer ):
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefKeyValue, OTF_DEFKEYVALUE_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFKEYVALUE_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefTimeRange, OTF_DEFTIMERANGE_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFTIMERANGE_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefCounterAssignments, OTF_DEFCOUNTERASSIGNMENTS_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFCOUNTERASSIGNMENTS_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_DefProcessSubstitutes, OTF_DEFPROCESSSUBSTITUTES_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_DEFPROCESSSUBSTITUTES_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_NoOp, OTF_NOOP_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_NOOP_RECORD )
@ -1082,6 +1184,12 @@ def OTF_HandlerArray_getCopyHandler( handlers, writer ):
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_BeginFileOpSnapshot, OTF_BEGINFILEOPSNAPSHOT_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_BEGINFILEOPSNAPSHOT_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_CollopCountSnapshot, OTF_COLLOPCOUNTSNAPSHOT_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_COLLOPCOUNTSNAPSHOT_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_CounterSnapshot, OTF_COUNTERSNAPSHOT_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_COUNTERSNAPSHOT_RECORD )
OTF_HandlerArray_setHandler( handlers, OTF_CopyHandler_SummaryComment, OTF_SUMMARYCOMMENT_RECORD )
OTF_HandlerArray_setFirstHandlerArg( handlers, writer, OTF_SUMMARYCOMMENT_RECORD )

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

@ -59,6 +59,14 @@ int pyOTF_Writer_writeDefAttributeListKV( OTF_Writer* writer, uint32_t stream,
int pyOTF_Writer_writeDefAttributeList( OTF_Writer* writer, uint32_t stream,
uint32_t attr_token, uint32_t num, PyObject* array);
int pyOTF_Writer_writeDefCounterAssignments( OTF_Writer* writer, uint32_t stream,
uint32_t counter, uint32_t number_of_members, PyObject* procs_or_groups,
OTF_KeyValueList* list);
int pyOTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, PyObject* procs,
OTF_KeyValueList* list);
/* *** handler declarations **************************************************** */
@ -87,7 +95,7 @@ int pyOTF_Handler_DefAttributeList( void* userData, uint32_t stream,
int pyOTF_Handler_DefProcessOrGroupAttributes( void* userData, uint32_t stream,
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList *list );
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList *list );
int pyOTF_Handler_DefFunction( void* userData, uint32_t stream,
@ -126,6 +134,10 @@ int pyOTF_Handler_DefCreator( void* userData, uint32_t stream,
const char* creator, OTF_KeyValueList *list );
int pyOTF_Handler_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid, OTF_KeyValueList *list );
int pyOTF_Handler_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub,
const char* string, OTF_KeyValueList *list );
@ -145,6 +157,20 @@ int pyOTF_Handler_DefKeyValue( void* userData, uint32_t stream,
const char *description, OTF_KeyValueList *list );
int pyOTF_Handler_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list );
int pyOTF_Handler_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members, const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
int pyOTF_Handler_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list );
int pyOTF_Handler_NoOp( void* userData, uint64_t time,
uint32_t process, OTF_KeyValueList *list );
@ -276,6 +302,16 @@ int pyOTF_Handler_BeginFileOpSnapshot( void* userData, uint64_t time,
uint32_t scltoken, OTF_KeyValueList *list );
int pyOTF_Handler_CollopCountSnapshot( void* userData, uint64_t time,
uint32_t process, uint32_t communicator, uint64_t count,
OTF_KeyValueList *list );
int pyOTF_Handler_CounterSnapshot( void* userData, uint64_t time,
uint64_t originaltime, uint32_t process, uint32_t counter,
uint64_t value, OTF_KeyValueList *list );
int pyOTF_Handler_SummaryComment( void* userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList *list );
@ -483,6 +519,42 @@ int pyOTF_Writer_writeDefAttributeList( OTF_Writer* writer, uint32_t stream,
return ret;
}
int pyOTF_Writer_writeDefCounterAssignments( OTF_Writer* writer, uint32_t stream,
uint32_t counter, uint32_t number_of_members, PyObject* procs_or_groups,
OTF_KeyValueList* list) {
int ret;
uint32_t* pyprocs_or_groups= createInt32ArrayFromSequence( procs_or_groups );
ret= OTF_Writer_writeDefCounterAssignments( writer, stream,
counter, number_of_members, pyprocs_or_groups,
list);
free( pyprocs_or_groups );
return ret;
}
int pyOTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, PyObject* procs,
OTF_KeyValueList* list) {
int ret;
uint32_t* pyprocs= createInt32ArrayFromSequence( procs );
ret= OTF_Writer_writeDefProcessSubstitutes( writer, stream,
representative, numberOfProcs, pyprocs,
list);
free( pyprocs );
return ret;
}
/* *** HANDLER ARRAY ******************************************************** */
@ -712,7 +784,7 @@ int pyOTF_Handler_DefAttributeList( void* userData, uint32_t stream,
}
int pyOTF_Handler_DefProcessOrGroupAttributes( void* userData, uint32_t stream,
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList *list ) {
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList *list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
@ -1043,6 +1115,42 @@ int pyOTF_Handler_DefCreator( void* userData, uint32_t stream,
}
}
int pyOTF_Handler_DefUniqueId( void* userData, uint32_t stream,
uint64_t uid, OTF_KeyValueList *list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pylist;
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OHKO", fha->realfha, stream,
uid, pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_DefVersion( void* userData, uint32_t stream,
uint8_t major, uint8_t minor, uint8_t sub,
const char* string, OTF_KeyValueList *list ) {
@ -1193,6 +1301,140 @@ int pyOTF_Handler_DefKeyValue( void* userData, uint32_t stream,
}
}
int pyOTF_Handler_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pylist;
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OHKKO", fha->realfha, stream,
minTime, maxTime, pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members, const uint32_t* procs_or_groups,
OTF_KeyValueList* list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pyprocs_or_groups;
uint32_t i;
PyObject* pylist;
pyprocs_or_groups= PyList_New( number_of_members );
for( i= 0; i < number_of_members; ++i ) {
PyList_SetItem( pyprocs_or_groups, i, PyInt_FromLong((long) procs_or_groups[i]) );
}
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OHHHOO", fha->realfha, stream,
counter, number_of_members, pyprocs_or_groups,
pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pyprocs;
uint32_t i;
PyObject* pylist;
pyprocs= PyList_New( numberOfProcs );
for( i= 0; i < numberOfProcs; ++i ) {
PyList_SetItem( pyprocs, i, PyInt_FromLong((long) procs[i]) );
}
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OHHHOO", fha->realfha, stream,
representative, numberOfProcs, pyprocs,
pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_NoOp( void* userData, uint64_t time,
uint32_t process, OTF_KeyValueList *list ) {
@ -2155,6 +2397,82 @@ int pyOTF_Handler_BeginFileOpSnapshot( void* userData, uint64_t time,
}
}
int pyOTF_Handler_CollopCountSnapshot( void* userData, uint64_t time,
uint32_t process, uint32_t communicator, uint64_t count,
OTF_KeyValueList *list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pylist;
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OKHHKO", fha->realfha, time,
process, communicator, count,
pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_CounterSnapshot( void* userData, uint64_t time,
uint64_t originaltime, uint32_t process, uint32_t counter,
uint64_t value, OTF_KeyValueList *list ) {
pyOTF_FirstHandlerArgument* fha= (pyOTF_FirstHandlerArgument*) userData;
PyObject *result;
PyObject* arglist;
int ret;
PyObject* pylist;
/** creates a new python object of type "OTF_KeyValueList" from a C pointer */
pylist = SWIG_NewPointerObj(SWIG_as_voidptr(list), SWIGTYPE_p_OTF_KeyValueList_struct, 0 );
arglist= Py_BuildValue("OKKHHKO", fha->realfha, time,
originaltime, process, counter,
value, pylist );
result= PyEval_CallObject(fha->func, arglist);
Py_DECREF(pylist);
Py_DECREF(arglist);
ret= (int) PyInt_AsLong( result );
if( NULL == PyErr_Occurred() ){
return ret;
} else {
PyErr_Print();
return OTF_RETURN_ABORT;
}
}
int pyOTF_Handler_SummaryComment( void* userData, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList *list ) {
@ -2717,6 +3035,13 @@ int pyOTF_HandlerArray_setHandler( OTF_HandlerArray* handlers, PyObject* functio
break;
case OTF_DEFUNIQUEID_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_DefUniqueId, recordtype );
break;
case OTF_DEFVERSION_RECORD :
OTF_HandlerArray_setHandler( handlers,
@ -2745,6 +3070,27 @@ int pyOTF_HandlerArray_setHandler( OTF_HandlerArray* handlers, PyObject* functio
break;
case OTF_DEFTIMERANGE_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_DefTimeRange, recordtype );
break;
case OTF_DEFCOUNTERASSIGNMENTS_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_DefCounterAssignments, recordtype );
break;
case OTF_DEFPROCESSSUBSTITUTES_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_DefProcessSubstitutes, recordtype );
break;
case OTF_NOOP_RECORD :
OTF_HandlerArray_setHandler( handlers,
@ -2920,6 +3266,20 @@ int pyOTF_HandlerArray_setHandler( OTF_HandlerArray* handlers, PyObject* functio
break;
case OTF_COLLOPCOUNTSNAPSHOT_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_CollopCountSnapshot, recordtype );
break;
case OTF_COUNTERSNAPSHOT_RECORD :
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) pyOTF_Handler_CounterSnapshot, recordtype );
break;
case OTF_SUMMARYCOMMENT_RECORD :
OTF_HandlerArray_setHandler( handlers,

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

@ -3,8 +3,7 @@ SUBDIRS = \
generic_streams \
generic_streams-mpi \
progress \
read_from_buffer \
thumbnail
read_from_buffer
EXTRA_DIST= \
python/groups.py \

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

@ -1,11 +0,0 @@
check_PROGRAMS = otf_thumbnail
otf_thumbnail_SOURCES = thumbnail.c
otf_thumbnail_DEPENDENCIES = $(top_builddir)/otfauxlib/libotfaux.la \
$(top_builddir)/otflib/libotf.la
otf_thumbnail_LDADD = $(top_builddir)/otfauxlib/libotfaux.la \
$(top_builddir)/otflib/libotf.la
otf_thumbnail_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(top_builddir)/otflib \
-I$(top_srcdir)/otflib \
-I$(top_srcdir)/otfauxlib

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше