1
1

Updated integrated VT to version 5.12

This commit was SVN r25483.
Этот коммит содержится в:
Matthias Jurenz 2011-11-17 10:02:38 +00:00
родитель c1012f502f
Коммит 4ec105182e
229 изменённых файлов: 21463 добавлений и 21245 удалений

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

@ -1,7 +1,62 @@
5.11.2openmpi
5.12openmpi
- updated version of internal OTF to 1.10openmpi
(see extlib/otf/ChangeLog)
- added support for CUDA runtime tracing via CUPTI callbacks
- added support for process group counters
- extended internal API to:
- create process groups
- assign attributes to process groups
(e.g. is communicator, has counters)
- improved MPI group/communicator handling:
- merge groups which have the same members to one group
- name groups to "MPI Group X"
- added writing of process begin/end records
- added environment variable VT_ONOFF_CHECK_STACK_BALANCE to
enable/disable check for stack level balance when switching tracing
on/off by using the user API
- added configure option '--[enable|disable]-fortran' to control
building of Fortran support
- install a symbolic link 'vtfiltergen[-mpi]' which is a synonym for
'vtfilter[-mpi] --gen'
- disabled unnecessary time synchronization on NEC SX platforms
- removed limitation of maximum defined MPI handles (groups, comms.,
and windows) in a MPI program
- fixed incorrect handling of MPI_IN_PLACE
- fixed erroneous handling of MPI_Aint within the Fortran MPI wrappers
- fixed error handling on flushing the trace buffer
- fixed potential memory corruption when flushing the trace buffer
multiple times (VT_MAX_FLUSHES != 1)
- fixed numbering in thread names
- vtdyn:
- detach from application process before continuing its
execution (allows signal trapping (e.g. Ctrl+C) within the
application)
- fixed selection of functions to be instrumented
- save floating point registers before calling instrumentation
to ensure correct program behavior
- compiler wrappers:
- added options '-vt:preprocess', '-vt:cpp', and '-vt:cppflags'
to preprocess source files before parsing by OPARI and/or TAU
- added option '-vt:nocleanup' to keep intermediate files
- vtsetup: (see tools/vtsetup/ChangeLog:1.0.1)
5.11.3
- if possible, get resource usage counters for the calling thread
instead of the process
- removed MPI_Address and MPI_Get_address from MPI wrappers
- fixed incomplete tracking of MPI inter-communicators
- vtunify: fixed parsing of negative time offsets within unify
control data
5.11.2
- updated version of internal OTF to 1.9.2sawfish
(see extlib/otf/ChangeLog)
- added options '-vt:showme-<compile|link>' to the compiler wrapper
to show the compiler/linker flags that would be supplied to the
underlying compiler
- add path to MPI library when linking with the compiler wrappers
- do not build vtrun script on BlueGene; shell scripts doesn't work on
the back-end
- fixed segmentation fault in vtunify-mpi which might occur during
gathering local marker definitions/spots to master process

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

@ -1 +1 @@
5.11.2openmpi
5.12openmpi

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

@ -6,8 +6,9 @@ m4_include(config/m4/acinclude.cpc.m4)
m4_include(config/m4/acinclude.cross.m4)
m4_include(config/m4/acinclude.csfs.m4)
m4_include(config/m4/acinclude.ctool.m4)
m4_include(config/m4/acinclude.cudawrap.m4)
m4_include(config/m4/acinclude.cuda.m4)
m4_include(config/m4/acinclude.cupti.m4)
m4_include(config/m4/acinclude.cudawrap.m4)
m4_include(config/m4/acinclude.cxxrtlib.m4)
m4_include(config/m4/acinclude.dl.m4)
m4_include(config/m4/acinclude.dyninst.m4)

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

@ -14,4 +14,4 @@ enable_shared="no"
enable_cpuidtrace="no"
with_cross_prefix="bg"
with_mpibgp="yes"
with_cxxrtlib="-L/opt/ibmcmp/lib/bg/bglib -libmc++ -lstdc++"
with_cxxrtlib="-L/opt/ibmcmp/lib/bg/bglib -L/opt/ibmcmp/lib/bg/9.0/bglib -libmc++ -lstdc++"

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

@ -4,6 +4,8 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_CC_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_CC_EXTRA_LINKER_FLAGS=
VT_WRAPPER_CC_EXTRA_LIBS=
VT_WRAPPER_CC_CPP=$CPP
VT_WRAPPER_CC_EXTRA_CPPFLAGS=
VT_WRAPPER_CC_DYNINST_COMPILER_FLAGS=
VT_WRAPPER_CC_TAUINST_OPTS=
VT_WRAPPER_CC_TAUINST_PARSE_BIN=
@ -15,6 +17,8 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_CXX_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS=
VT_WRAPPER_CXX_EXTRA_LIBS=
VT_WRAPPER_CXX_CPP=$CXXCPP
VT_WRAPPER_CXX_EXTRA_CPPFLAGS=
VT_WRAPPER_CXX_DYNINST_COMPILER_FLAGS=
VT_WRAPPER_CXX_TAUINST_OPTS=
VT_WRAPPER_CXX_TAUINST_PARSE_BIN=
@ -26,6 +30,8 @@ AC_DEFUN([ACVT_COMPWRAP],
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=
@ -37,6 +43,8 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_FC_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_FC_EXTRA_LINKER_FLAGS=
VT_WRAPPER_FC_EXTRA_LIBS=
VT_WRAPPER_FC_CPP=$CPP
VT_WRAPPER_FC_EXTRA_CPPFLAGS=
VT_WRAPPER_FC_DYNINST_COMPILER_FLAGS=
VT_WRAPPER_FC_TAUINST_OPTS=
VT_WRAPPER_FC_TAUINST_PARSE_BIN=
@ -48,6 +56,9 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_NVCC_EXTRA_COMPILER_FLAGS=
VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS=
VT_WRAPPER_NVCC_EXTRA_LIBS=
VT_WRAPPER_NVCC_CPP=$CPP
VT_WRAPPER_NVCC_EXTRA_CPPFLAGS=
VT_WRAPPER_NVCC_DYNINST_COMPILER_FLAGS=
VT_WRAPPER_NVCC_TAUINST_OPTS=
VT_WRAPPER_NVCC_TAUINST_PARSE_BIN=
@ -92,6 +103,17 @@ AC_DEFUN([ACVT_COMPWRAP],
[extra libraries to link when using vtcc]),
[VT_WRAPPER_CC_EXTRA_LIBS=$withval])
AC_ARG_WITH(wrapper-cc-cpp,
AC_HELP_STRING([--with-wrapper-cc-cpp=WRAPPERCCCPP],
[C preprocessor command for vtcc, default: CPP]),
[VT_WRAPPER_CC_CPP=$withval])
AC_ARG_WITH(wrapper-cc-cppflags,
AC_HELP_STRING([--with-wrapper-cc-cppflags=WRAPPERCCCPPFLAGS],
[extra preprocessor flags to add when using vtcc -vt:preprocess]),
[VT_WRAPPER_CC_EXTRA_CPPFLAGS=$withval])
AC_ARG_WITH(wrapper-cc-default-partype,
AC_HELP_STRING([--with-wrapper-cc-default-partype=TYPE],
[default parallelization type for vtcc (seq,mt,mpi,hyb), default: $VT_WRAPPER_CC_DEFAULT_PARTYPE]),
@ -126,6 +148,16 @@ AC_DEFUN([ACVT_COMPWRAP],
[extra libraries to link when using vtcxx]),
[VT_WRAPPER_CXX_EXTRA_LIBS=$withval])
AC_ARG_WITH(wrapper-cxx-cpp,
AC_HELP_STRING([--with-wrapper-cxx-cpp=WRAPPERCXXCPP],
[C++ preprocessor command for vtcxx, default: CXXCPP]),
[VT_WRAPPER_CXX_CPP=$withval])
AC_ARG_WITH(wrapper-cxx-cppflags,
AC_HELP_STRING([--with-wrapper-cxx-cppflags=WRAPPERCXXCPPFLAGS],
[extra preprocessor flags to add when using vtcxx -vt:preprocess]),
[VT_WRAPPER_CXX_EXTRA_CPPFLAGS=$withval])
AC_ARG_WITH(wrapper-cxx-default-partype,
AC_HELP_STRING([--with-wrapper-cxx-default-partype=TYPE],
[default parallelization type for vtcxx (seq,mt,mpi,hyb), default: $VT_WRAPPER_CXX_DEFAULT_PARTYPE]),
@ -160,6 +192,16 @@ AC_DEFUN([ACVT_COMPWRAP],
[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]),
@ -194,6 +236,16 @@ AC_DEFUN([ACVT_COMPWRAP],
[extra libraries to link when using vtf90]),
[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]),
[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]),
[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]),
@ -228,6 +280,16 @@ AC_DEFUN([ACVT_COMPWRAP],
[extra libraries to link when using vtnvcc]),
[VT_WRAPPER_NVCC_EXTRA_LIBS=$withval])
AC_ARG_WITH(wrapper-nvcc-cpp,
AC_HELP_STRING([--with-wrapper-nvcc-cpp=WRAPPERNVCCCPP],
[C preprocessor command for vtnvcc, default: CPP]),
[VT_WRAPPER_NVCC_CPP=$withval])
AC_ARG_WITH(wrapper-nvcc-cppflags,
AC_HELP_STRING([--with-wrapper-nvcc-cppflags=WRAPPERNVCCCPPFLAGS],
[extra preprocessor flags to add when using vtnvcc -vt:preprocess]),
[VT_WRAPPER_NVCC_EXTRA_CPPFLAGS=$withval])
AC_ARG_WITH(wrapper-nvcc-default-partype,
AC_HELP_STRING([--with-wrapper-nvcc-default-partype=TYPE],
[default parallelization type for vtnvcc (seq,mt,mpi,hyb), default: $VT_WRAPPER_NVCC_DEFAULT_PARTYPE]),
@ -297,34 +359,40 @@ AC_DEFUN([ACVT_COMPWRAP],
VT_WRAPPER_AVAIL_INST="$VT_WRAPPER_AVAIL_INST dyninst"
])
AS_IF([test x"$have_tauinst" = "xyes"],
[
pdt_mpiincdir=
pdt_fmpiincdir=
mpiincdir=
fmpiincdir=
AS_IF([test x"$have_mpi" = "xyes"],
AS_IF([test x"$have_mpi" = "xyes"],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
[mpiincdir="-I\${includedir}/.."],
[mpiincdir="$MPIINCDIR"])
AS_IF([test x"$have_fmpi" = "xyes"],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
[pdt_mpiincdir="-I\${includedir}/.."],
[pdt_mpiincdir="$MPIINCDIR"])
AS_IF([test x"$have_fmpi" = "xyes"],
[
AS_IF([test x"$inside_openmpi" = "xyes"],
[pdt_fmpiincdir="$pdt_mpiincdir"],
[pdt_fmpiincdir="$FMPIINCDIR"])
])
[fmpiincdir="$mpiincdir"],
[fmpiincdir="$FMPIINCDIR"])
])
])
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"
AS_IF([test x"$have_tauinst" = "xyes"],
[
VT_WRAPPER_TAUINST_BIN="$tauinst_cmd"
VT_WRAPPER_CC_TAUINST_OPTS="-c -spec \${datadir}/TAUINST.SPEC"
VT_WRAPPER_CC_TAUINST_PARSE_BIN="$tauinst_cparse_cmd"
VT_WRAPPER_CC_TAUINST_PARSE_OPTS="$pdt_mpiincdir"
VT_WRAPPER_CC_TAUINST_PARSE_OPTS="$mpiincdir"
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="$pdt_fmpiincdir"
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"
@ -338,6 +406,8 @@ AC_DEFUN([ACVT_COMPWRAP],
AC_SUBST(VT_WRAPPER_CC_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_CC_EXTRA_LINKER_FLAGS)
AC_SUBST(VT_WRAPPER_CC_EXTRA_LIBS)
AC_SUBST(VT_WRAPPER_CC_CPP)
AC_SUBST(VT_WRAPPER_CC_EXTRA_CPPFLAGS)
AC_SUBST(VT_WRAPPER_CC_DYNINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_CC_TAUINST_OPTS)
AC_SUBST(VT_WRAPPER_CC_TAUINST_PARSE_BIN)
@ -349,6 +419,8 @@ AC_DEFUN([ACVT_COMPWRAP],
AC_SUBST(VT_WRAPPER_CXX_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_CXX_EXTRA_LINKER_FLAGS)
AC_SUBST(VT_WRAPPER_CXX_EXTRA_LIBS)
AC_SUBST(VT_WRAPPER_CXX_CPP)
AC_SUBST(VT_WRAPPER_CXX_EXTRA_CPPFLAGS)
AC_SUBST(VT_WRAPPER_CXX_DYNINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_CXX_TAUINST_OPTS)
AC_SUBST(VT_WRAPPER_CXX_TAUINST_PARSE_BIN)
@ -360,6 +432,8 @@ AC_DEFUN([ACVT_COMPWRAP],
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)
@ -371,6 +445,8 @@ AC_DEFUN([ACVT_COMPWRAP],
AC_SUBST(VT_WRAPPER_FC_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_FC_EXTRA_LINKER_FLAGS)
AC_SUBST(VT_WRAPPER_FC_EXTRA_LIBS)
AC_SUBST(VT_WRAPPER_FC_CPP)
AC_SUBST(VT_WRAPPER_FC_EXTRA_CPPFLAGS)
AC_SUBST(VT_WRAPPER_FC_DYNINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_FC_TAUINST_OPTS)
AC_SUBST(VT_WRAPPER_FC_TAUINST_PARSE_BIN)
@ -382,6 +458,8 @@ AC_DEFUN([ACVT_COMPWRAP],
AC_SUBST(VT_WRAPPER_NVCC_EXTRA_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_NVCC_EXTRA_LINKER_FLAGS)
AC_SUBST(VT_WRAPPER_NVCC_EXTRA_LIBS)
AC_SUBST(VT_WRAPPER_NVCC_CPP)
AC_SUBST(VT_WRAPPER_NVCC_EXTRA_CPPFLAGS)
AC_SUBST(VT_WRAPPER_NVCC_DYNINST_COMPILER_FLAGS)
AC_SUBST(VT_WRAPPER_NVCC_TAUINST_OPTS)
AC_SUBST(VT_WRAPPER_NVCC_TAUINST_PARSE_BIN)

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

@ -0,0 +1,159 @@
AC_DEFUN([ACVT_CUDA],
[
cuda_error="no"
cudart_error="no"
have_cuda="no"
have_cudart="no"
CUDATKDIR=
CUDATKINCDIR=
CUDATKLIBDIR=
CUDALIB=
CUDARTLIB=
AC_ARG_VAR(NVCC, [NVIDIA CUDA compiler command])
AC_ARG_WITH(cuda-dir,
AC_HELP_STRING([--with-cuda-dir=CUDATKDIR],
[give the path for CUDA Toolkit, default: /usr/local/cuda]),
[CUDATKDIR="$withval/"], [CUDATKDIR="/usr/local/cuda/"])
AC_ARG_WITH(cuda-inc-dir,
AC_HELP_STRING([--with-cuda-inc-dir=CUDATKINCDIR],
[give the path for CUDA-Toolkit-include files, default: CUDATKDIR/include]),
[CUDATKINCDIR="-I$withval/"],
[AS_IF([test x"$CUDATKDIR" != x], [CUDATKINCDIR="-I$CUDATKDIR"include/])])
AC_ARG_WITH(cuda-lib-dir,
AC_HELP_STRING([--with-cuda-lib-dir=CUDATKLIBDIR],
[give the path for CUDA-Toolkit-libraries, default: CUDATKDIR/lib64]),
[CUDATKLIBDIR="-L$withval/"],
[AS_IF([test x"$CUDATKDIR" != x], [CUDATKLIBDIR="-L$CUDATKDIR"lib64/])])
AC_ARG_WITH(cuda-lib,
AC_HELP_STRING([--with-cuda-lib=CUDALIB], [use given CUDA driver library, default: -lcuda]),
[CUDALIB="$withval"])
AC_ARG_WITH(cudart-lib,
AC_HELP_STRING([--with-cudart-lib=CUDARTLIB], [use given CUDA runtime library, default: -lcudart]),
[CUDARTLIB="$withval"])
AS_IF([test x"$cuda_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_CHECK_HEADER([cuda.h], [],
[
AC_MSG_NOTICE([error: no cuda.h found; check path for CUDA Toolkit first...])
cuda_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$CUDALIB" = x -a x"$cuda_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $CUDATKLIBDIR -lcuda"
AC_MSG_CHECKING([whether linking with -lcuda works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); CUDALIB=-lcuda],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$CUDALIB" = x -a x"$cuda_error" = "xno"],
[
AC_MSG_NOTICE([error: no libcuda found; check path for CUDA Toolkit first...])
cuda_error="yes"
])
AS_IF([test x"$cuda_error" = "xno"],
[
AC_MSG_CHECKING([whether CUDA driver version >= 3.0])
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda.h"],
[
#ifndef CUDA_VERSION
# error "CUDA_VERSION not defined"
#elif CUDA_VERSION < 3000
# error "CUDA_VERSION < 3000"
#endif
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA driver version could not be determined and/or is incompatible (< 3.0)
See \`config.log' for more details.])
cuda_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$cudart_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_CHECK_HEADER([cuda_runtime_api.h], [],
[
AC_MSG_NOTICE([error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...])
cudart_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$CUDARTLIB" = x -a x"$cudart_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $CUDATKLIBDIR -lcudart"
AC_MSG_CHECKING([whether linking with -lcudart works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); CUDARTLIB=-lcudart],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$CUDARTLIB" = x -a x"$cudart_error" = "xno"],
[
AC_MSG_NOTICE([error: no libcudart found; check path for CUDA Toolkit first...])
cudart_error="yes"
])
AS_IF([test x"$cudart_error" = "xno"],
[
AC_MSG_CHECKING([whether CUDA runtime version >= 3.0])
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda_runtime_api.h"],
[
#ifndef CUDART_VERSION
# error "CUDART_VERSION not defined"
#elif CUDART_VERSION < 3000
# error "CUDART_VERSION < 3000"
#endif
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA runtime version could not be determined and/or is incompatible (< 3.0)
See \`config.log' for more details.])
cudart_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$cudart_error" = "xno"],
[
AC_CHECK_PROG(NVCC, nvcc, nvcc, , [$PATH$PATH_SEPARATOR$CUDATKDIR"bin/"])
have_cudart="yes"
])
AS_IF([test x"$cuda_error" = "xno"],
[
have_cuda="yes"
])
AC_SUBST(CUDATKINCDIR)
AC_SUBST(CUDATKLIBDIR)
AC_SUBST(CUDATKLIB)
])

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

@ -1,209 +1,25 @@
AC_DEFUN([ACVT_CUDAWRAP],
[
cudawrap_error="no"
cudartwrap_error="no"
have_cudawrap="no"
have_cudartwrap="no"
CUDATKDIR=
CUDATKINCDIR=
CUDATKLIBDIR=
CUDALIB=
CUDARTLIB=
cudalib_pathname=
cudartlib_pathname=
AC_ARG_VAR(NVCC, [NVIDIA CUDA compiler command])
AC_REQUIRE([ACVT_CUDA])
AC_ARG_WITH(cuda-dir,
AC_HELP_STRING([--with-cuda-dir=CUDATKDIR],
[give the path for CUDA Toolkit, default: /usr/local/cuda]),
[CUDATKDIR="$withval/"], [CUDATKDIR="/usr/local/cuda/"])
AC_ARG_WITH(cuda-inc-dir,
AC_HELP_STRING([--with-cuda-inc-dir=CUDATKINCDIR],
[give the path for CUDA-Toolkit-include files, default: CUDATKDIR/include]),
[CUDATKINCDIR="-I$withval/"],
[AS_IF([test x"$CUDATKDIR" != x], [CUDATKINCDIR="-I$CUDATKDIR"include/])])
AC_ARG_WITH(cuda-lib-dir,
AC_HELP_STRING([--with-cuda-lib-dir=CUDATKLIBDIR],
[give the path for CUDA-Toolkit-libraries, default: CUDATKDIR/lib64]),
[CUDATKLIBDIR="-L$withval/"],
[AS_IF([test x"$CUDATKDIR" != x], [CUDATKLIBDIR="-L$CUDATKDIR"lib64/])])
AC_ARG_WITH(cuda-lib,
AC_HELP_STRING([--with-cuda-lib=CUDALIB], [use given CUDA driver library, default: -lcuda]),
[CUDALIB="$withval"])
AC_ARG_WITH(cudart-lib,
AC_HELP_STRING([--with-cudart-lib=CUDARTLIB], [use given CUDA runtime library, default: -lcudart]),
[CUDARTLIB="$withval"])
AC_ARG_WITH(cuda-shlib,
AC_HELP_STRING([--with-cuda-shlib=CUDASHLIB], [give the pathname for the shared CUDA driver library, default: automatically by configure]),
AS_IF([test x"$cudart_error" = "xno"],
[
AS_IF([test x"$withval" = "xyes" -o x"$withval" = "xno"],
[AC_MSG_ERROR([value of '--with-cuda-shlib' not properly set])])
cudalib_pathname=$withval
])
AC_ARG_WITH(cudart-shlib,
AC_HELP_STRING([--with-cudart-shlib=CUDARTSHLIB], [give the pathname for the shared CUDA runtime library, default: automatically by configure]),
[
AS_IF([test x"$withval" = "xyes" -o x"$withval" = "xno"],
[AC_MSG_ERROR([value of '--with-cudart-shlib' not properly set])])
cudartlib_pathname=$withval
])
AS_IF([test x"$cudawrap_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_CHECK_HEADER([cuda.h], [],
AC_ARG_WITH(cudart-shlib,
AC_HELP_STRING([--with-cudart-shlib=CUDARTSHLIB], [give the pathname for the shared CUDA runtime library, default: automatically by configure]),
[
AC_MSG_NOTICE([error: no cuda.h found; check path for CUDA Toolkit first...])
cudawrap_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$CUDALIB" = x -a x"$cudawrap_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $CUDATKLIBDIR -lcuda"
AC_MSG_CHECKING([whether linking with -lcuda works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); CUDALIB=-lcuda],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$CUDALIB" = x -a x"$cudawrap_error" = "xno"],
[
AC_MSG_NOTICE([error: no libcuda found; check path for CUDA Toolkit first...])
cudawrap_error="yes"
])
AS_IF([test x"$cudawrap_error" = "xno"],
[
AC_MSG_CHECKING([whether CUDA driver version >= 3.0])
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda.h"],
[
#ifndef CUDA_VERSION
# error "CUDA_VERSION not defined"
#elif CUDA_VERSION < 3000
# error "CUDA_VERSION < 3000"
#endif
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA driver version could not be determined and/or is incompatible (< 3.0)
See \`config.log' for more details.])
cudawrap_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$cudawrap_error" = "xno"],
[
AC_MSG_CHECKING([for pathname of CUDA driver library])
AS_IF([test x"$cudalib_pathname" != x],
[
AC_MSG_RESULT([skipped (--with-cuda-shlib=$cudalib_pathname)])
],
[
AS_IF([test x"$have_rtld_next" = "xyes"],
[
AC_MSG_RESULT([not needed])
],
[
AS_IF([test x"$CUDATKLIBDIR" != x],
[cudalib_dir=`echo $CUDATKLIBDIR | sed s/\-L//`])
cudalib_pathname=$cudalib_dir`echo $CUDALIB | sed s/\-l/lib/`".so"
AS_IF([! test -f $cudalib_pathname],
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: could not determine pathname of CUDA driver library])
cudawrap_error="yes"
],
[
AC_MSG_RESULT([$cudalib_pathname])
])
])
AS_IF([test x"$withval" = "xyes" -o x"$withval" = "xno"],
[AC_MSG_ERROR([value of '--with-cudart-shlib' not properly set])])
cudartlib_pathname=$withval
])
])
AS_IF([test x"$cudawrap_error" = "xno"],
[
AS_IF([test x"$cudalib_pathname" != x],
[
AC_DEFINE_UNQUOTED([DEFAULT_CUDALIB_PATHNAME],
["$cudalib_pathname"], [pathname of CUDA driver library])
])
have_cudawrap="yes"
])
AS_IF([test x"$cudartwrap_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_CHECK_HEADER([cuda_runtime_api.h], [],
[
AC_MSG_NOTICE([error: no cuda_runtime_api.h found; check path for CUDA Toolkit first...])
cudartwrap_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$CUDARTLIB" = x -a x"$cudartwrap_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $CUDATKLIBDIR -lcudart"
AC_MSG_CHECKING([whether linking with -lcudart works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); CUDARTLIB=-lcudart],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$CUDARTLIB" = x -a x"$cudartwrap_error" = "xno"],
[
AC_MSG_NOTICE([error: no libcudart found; check path for CUDA Toolkit first...])
cudartwrap_error="yes"
])
AS_IF([test x"$cudartwrap_error" = "xno"],
[
AC_MSG_CHECKING([whether CUDA runtime version >= 3.0])
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda_runtime_api.h"],
[
#ifndef CUDART_VERSION
# error "CUDART_VERSION not defined"
#elif CUDART_VERSION < 3000
# error "CUDART_VERSION < 3000"
#endif
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA runtime version could not be determined and/or is incompatible (< 3.0)
See \`config.log' for more details.])
cudartwrap_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
AS_IF([test x"$cudartwrap_error" = "xno"],
AS_IF([test x"$cudart_error" = "xno"],
[
AC_MSG_CHECKING([for pathname of CUDA runtime library])
@ -225,7 +41,7 @@ See \`config.log' for more details.])
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: could not determine pathname of CUDA runtime library])
cudartwrap_error="yes"
cudart_error="yes"
],
[
AC_MSG_RESULT([$cudartlib_pathname])
@ -234,25 +50,67 @@ See \`config.log' for more details.])
])
])
AS_IF([test x"$cudartwrap_error" = "xno"],
AS_IF([test x"$cudart_error" = "xno"],
[
AC_CHECK_PROG(NVCC, nvcc, nvcc, , [$PATH$PATH_SEPARATOR$CUDATKDIR"bin/"])
AS_IF([test x"$cudartlib_pathname" != x],
[
AC_DEFINE_UNQUOTED([DEFAULT_CUDARTLIB_PATHNAME],
["$cudartlib_pathname"], [pathname of CUDA runtime library])
])
have_cudartwrap="yes"
])
AS_IF([test x"$cudawrap_error" = "xno" -a x"$cudartwrap_error" = "xno"],
AS_IF([test x"$cuda_error" = "xno"],
[
ACVT_CUPTI
AC_ARG_WITH(cuda-shlib,
AC_HELP_STRING([--with-cuda-shlib=CUDASHLIB], [give the pathname for the shared CUDA driver library, default: automatically by configure]),
[
AS_IF([test x"$withval" = "xyes" -o x"$withval" = "xno"],
[AC_MSG_ERROR([value of '--with-cuda-shlib' not properly set])])
cudalib_pathname=$withval
])
])
AS_IF([test x"$cuda_error" = "xno"],
[
AC_MSG_CHECKING([for pathname of CUDA driver library])
AS_IF([test x"$cudalib_pathname" != x],
[
AC_MSG_RESULT([skipped (--with-cuda-shlib=$cudalib_pathname)])
],
[
AS_IF([test x"$have_rtld_next" = "xyes"],
[
AC_MSG_RESULT([not needed])
],
[
AS_IF([test x"$CUDATKLIBDIR" != x],
[cudalib_dir=`echo $CUDATKLIBDIR | sed s/\-L//`])
cudalib_pathname=$cudalib_dir`echo $CUDALIB | sed s/\-l/lib/`".so"
AS_IF([! test -f $cudalib_pathname],
[
AC_MSG_RESULT([unknown])
AC_MSG_NOTICE([error: could not determine pathname of CUDA driver library])
cuda_error="yes"
],
[
AC_MSG_RESULT([$cudalib_pathname])
])
])
])
])
AS_IF([test x"$cuda_error" = "xno"],
[
AS_IF([test x"$cudalib_pathname" != x],
[
AC_DEFINE_UNQUOTED([DEFAULT_CUDALIB_PATHNAME],
["$cudalib_pathname"], [pathname of CUDA driver library])
])
have_cudawrap="yes"
])
AC_SUBST(CUDATKINCDIR)
AC_SUBST(CUDATKLIBDIR)
AC_SUBST(CUDATKLIB)
])

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

@ -8,6 +8,8 @@ AC_DEFUN([ACVT_CUPTI],
CUPTILIBDIR=
CUPTILIB=
AC_REQUIRE([ACVT_CUDA])
AC_ARG_WITH(cupti-dir,
AC_HELP_STRING([--with-cupti-dir=CUPTIDIR],
[give the path for CUPTI, default: /usr]),
@ -31,9 +33,9 @@ AC_DEFUN([ACVT_CUPTI],
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUPTIINCDIR $CUDATKINCDIR"
AC_CHECK_HEADER([cupti_events.h], [],
AC_CHECK_HEADER([cupti.h], [],
[
AC_MSG_NOTICE([error: no cupti_events.h found; check path for CUPTI package first...])
AC_MSG_NOTICE([error: no cupti.h found; check path for CUPTI package first...])
cupti_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
@ -54,11 +56,13 @@ AC_DEFUN([ACVT_CUPTI],
cupti_error="yes"
])
AC_MSG_CHECKING([whether CUDA runtime version >= 4.0])
AS_IF([test x"$cupti_error" = "xno"],
[
AC_MSG_CHECKING([whether CUDA runtime version >= 4.0])
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda_runtime_api.h"],
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $CUDATKINCDIR"
AC_TRY_COMPILE([#include "cuda_runtime_api.h"],
[
#ifndef CUDART_VERSION
# error "CUDART_VERSION not defined"
@ -66,14 +70,15 @@ AC_DEFUN([ACVT_CUPTI],
# error "CUDART_VERSION < 4000"
#endif
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA runtime version could not be determined and/or is incompatible (< 4.0)
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: CUDA runtime version could not be determined and/or is incompatible (< 4.0)
See \`config.log' for more details.])
cupti_error="yes"
cupti_error="yes"
])
CPPFLAGS=$sav_CPPFLAGS
])
CPPFLAGS=$sav_CPPFLAGS
AS_IF([test x"$cupti_error" = "xno"], [have_cupti="yes"])

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

@ -96,7 +96,7 @@ AC_DEFUN([ACVT_LIBWRAP],
cuda)
ACVT_CONF_SUBTITLE([CUDA])
ACVT_CUDAWRAP
AS_IF([test x"$have_cudawrap" = "xyes"], [have_libwrap="yes"],
AS_IF([test x"$have_cudartwrap" = "xyes"], [have_libwrap="yes"],
[
AS_IF([test x"$force_cudawrap" = "xyes"],
[libwrap_error="yes"; break])

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

@ -48,7 +48,8 @@ AC_DEFUN([ACVT_MPI],
MPIINCDIR="-I$top_vt_srcdir/../../../include -I$top_vt_builddir/../../../include"
FMPIINCDIR="$MPIINCDIR"
MPILIBDIR="-L$top_vt_builddir/../../../.libs"
# MPILIBDIR is used in the compiler wrapper configuration files; set LDFLAGS instead
LDFLAGS="$LDFLAGS -L$top_vt_builddir/../../../.libs"
enable_mpi="yes"
with_openmpi="yes"
@ -431,21 +432,24 @@ AC_DEFUN([ACVT_MPI],
AC_CHECK_PROGS(MPICC, mpicc hcc mpcc_r mpcc mpxlc_r mpxlc mpixlc_r mpixlc cmpicc mpiicc)
AS_IF([test x"$MPICC" != x],
[
mpicc=`echo $MPICC | cut -d ' ' -f 1`
which_mpicc=`which $mpicc 2>/dev/null`
AS_IF([test x"$which_mpicc" = x], [AC_MSG_ERROR([$mpicc not found])])
mpi_bin_dir=`dirname $which_mpicc`
AS_IF([test "$mpi_bin_dir" != "/usr/bin" -a "$mpi_bin_dir" != "/SX/usr/bin"],
AS_IF([test x"$inside_openmpi" = "xno"],
[
AS_IF([test x"$MPIDIR" = x],
[MPIDIR=`echo $mpi_bin_dir | sed -e 's/bin//'`])
AS_IF([test x"$MPIINCDIR" = x],
[MPIINCDIR=-I`echo $mpi_bin_dir | sed -e 's/bin/include/'`])
AS_IF([test x"$FMPIINCDIR" = x],
[FMPIINCDIR=$MPIINCDIR])
AS_IF([test x"$MPILIBDIR" = x],
[MPILIBDIR=-L`echo $mpi_bin_dir | sed -e 's/bin/lib/'`])
mpicc=`echo $MPICC | cut -d ' ' -f 1`
which_mpicc=`which $mpicc 2>/dev/null`
AS_IF([test x"$which_mpicc" = x], [AC_MSG_ERROR([$mpicc not found])])
mpi_bin_dir=`dirname $which_mpicc`
AS_IF([test "$mpi_bin_dir" != "/usr/bin" -a "$mpi_bin_dir" != "/SX/usr/bin"],
[
AS_IF([test x"$MPIDIR" = x],
[MPIDIR=`echo $mpi_bin_dir | sed -e 's/bin//'`])
AS_IF([test x"$MPIINCDIR" = x],
[MPIINCDIR=-I`echo $mpi_bin_dir | sed -e 's/bin/include/'`])
AS_IF([test x"$FMPIINCDIR" = x],
[FMPIINCDIR=$MPIINCDIR])
AS_IF([test x"$MPILIBDIR" = x],
[MPILIBDIR=-L`echo $mpi_bin_dir | sed -e 's/bin/lib/'`])
])
])
],
[
@ -612,75 +616,78 @@ dnl check for PMPILIB
dnl check for FMPILIB
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
AS_IF([test x"$F77" != x],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lmpi_f77 $MPILIB"
AC_MSG_CHECKING([whether linking with -lmpi_f77 works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lmpi_f77],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lmpibinding_f77"
AC_MSG_CHECKING([whether linking with -lmpibinding_f77 works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lmpibinding_f77],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lfmpich"
AC_MSG_CHECKING([whether linking with -lfmpich works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lfmpich],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -llamf77mpi"
AC_MSG_CHECKING([whether linking with -llamf77mpi works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-llamf77mpi],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lfmpi"
AC_MSG_CHECKING([whether linking with -lfmpi works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lfmpi],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$mpi_error" = "xno"],
[
AS_IF([test x"$FMPILIB" = x],
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
AS_IF([test x"$check_fmpiwraplib" = "xyes"],
[
AC_MSG_WARN([no libmpi_f77, libmpibinding_f77, libfmpich, liblamf77mpi, or libfmpi found; build libvt-fmpi])
FMPILIB="-lvt-fmpi"
])
],
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lmpi_f77 $MPILIB"
AC_MSG_CHECKING([whether linking with -lmpi_f77 works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lmpi_f77],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
AS_IF([test x"$FMPILIB" = "x-lvt-fmpi"],
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lmpibinding_f77"
AC_MSG_CHECKING([whether linking with -lmpibinding_f77 works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lmpibinding_f77],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lfmpich"
AC_MSG_CHECKING([whether linking with -lfmpich works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lfmpich],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -llamf77mpi"
AC_MSG_CHECKING([whether linking with -llamf77mpi works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-llamf77mpi],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$FMPILIB" = x -a x"$mpi_error" = "xno"],
[
sav_LIBS=$LIBS
LIBS="$LIBS $MPILIBDIR -lfmpi"
AC_MSG_CHECKING([whether linking with -lfmpi works])
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes]); FMPILIB=-lfmpi],[AC_MSG_RESULT([no])])
LIBS=$sav_LIBS
])
AS_IF([test x"$mpi_error" = "xno"],
[
AS_IF([test x"$FMPILIB" = x],
[
AS_IF([test x"$check_fmpiwraplib" = "xno"],
[FMPILIB=])
AS_IF([test x"$check_fmpiwraplib" = "xyes"],
[
AC_MSG_WARN([no libmpi_f77, libmpibinding_f77, libfmpich, liblamf77mpi, or libfmpi found; build libvt-fmpi])
FMPILIB="-lvt-fmpi"
])
],
[
AS_IF([test x"$force_fmpiwraplib" = "xyes"],
[FMPILIB="-lvt-fmpi"], [check_fmpiwraplib="no"])
AS_IF([test x"$FMPILIB" = "x-lvt-fmpi"],
[
AS_IF([test x"$check_fmpiwraplib" = "xno"],
[FMPILIB=])
],
[
AS_IF([test x"$force_fmpiwraplib" = "xyes"],
[FMPILIB="-lvt-fmpi"], [check_fmpiwraplib="no"])
])
])
])
])
@ -877,16 +884,19 @@ AC_DEFUN([ACVT_FMPIWRAPLIB],
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],
[
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])])
mpi_bin_dir=`dirname $which_mpif77`
AS_IF([test "$mpi_bin_dir" != "/usr/bin" -a "$mpi_bin_dir" != "/SX/usr/bin" -a x"$FMPIINCDIR" != x-I"$mpi_inc_dir"],
AS_IF([test x"$inside_openmpi" = "xno"],
[
mpi_inc_dir=-I`echo $mpi_bin_dir | sed -e 's/bin/include/'`
AS_IF([test x"$FMPIINCDIR" != x"$mpi_inc_dir"],
[FMPIINCDIR="$FMPIINCDIR -I`echo $mpi_bin_dir | sed -e 's/bin/include/'`"])
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])])
mpi_bin_dir=`dirname $which_mpif77`
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/'`
AS_IF([test x"$FMPIINCDIR" != x"$mpi_inc_dir"],
[FMPIINCDIR="$FMPIINCDIR -I`echo $mpi_bin_dir | sed -e 's/bin/include/'`"])
])
])
],
[

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

@ -22,7 +22,15 @@ AC_DEFUN([ACVT_RUSAGE],
AC_CHECK_FUNC([getrusage], [], [rusage_error="yes"])
])
AS_IF([test x"$rusage_error" = "xno"], [have_rusage="yes"])
AS_IF([test x"$rusage_error" = "xno"],
[
sav_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_CHECK_DECLS([RUSAGE_THREAD], [], [], [#include <sys/resource.h>])
CPPFLAGS=$sav_CPPFLAGS
have_rusage="yes"
])
])
])

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

@ -68,9 +68,15 @@ 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])])
AC_CHECK_PROGS(tauinst_fparse_cmd, f95parse f90parse gfparse)
AS_IF([test x"$tauinst_fparse_cmd" = x],
[AC_MSG_WARN([no f95parse, f90parse, or gfparse found; Fortran source code cannot be instrumented by TAU])])
AS_IF([test x"$F77" != x],
[
AC_CHECK_PROGS(tauinst_fparse_cmd, f95parse f90parse gfparse)
AS_IF([test x"$tauinst_fparse_cmd" = x],
[AC_MSG_WARN([no f95parse, f90parse, or gfparse found; Fortran source code cannot be instrumented by TAU])])
],
[
tauinst_fparse_cmd=
])
AS_IF([test x"$tauinst_cparse_cmd$tauinst_cxxparse_cmd$tauinst_fparse_cmd" = x],
[

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

@ -129,7 +129,7 @@ AC_DEFUN([ACVT_TIMER],
AC_MSG_NOTICE([selected timer: $timer])
case $timer in
TIMER_BGP_GET_TIMEBASE | TIMER_BGP_GET_TIMEBASE | TIMER_GETTIMEOFDAY)
TIMER_RTS_GET_TIMEBASE | TIMER_BGP_GET_TIMEBASE | TIMER_SYSSX_HGTIME | TIMER_GETTIMEOFDAY)
timer_is_global=yes
timer_is_global_def=1
;;

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

@ -30,9 +30,18 @@ AC_DEFUN([ACVT_RUN],
AS_IF([test x"$check_vtrun" = "xyes"],
[
AC_MSG_CHECKING([whether we can build shared libraries])
AS_IF([test x"$enable_shared" = "xyes"],
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); vtrun_error="yes"])
AS_IF([test "$PLATFORM" = "bgl" -o "$PLATFORM" = "bgp"],
[
AC_MSG_NOTICE([error: application execution wrapper not supported on this platform])
vtrun_error="yes"
])
AS_IF([test x"$vtrun_error" = "xno"],
[
AC_MSG_CHECKING([whether we can build shared libraries])
AS_IF([test x"$enable_shared" = "xyes"],
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); vtrun_error="yes"])
])
AS_IF([test x"$vtrun_error" = "xno"],
[

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

@ -33,7 +33,6 @@ AC_DEFUN([ACVT_SETUP],
AC_CHECK_PROG(JAVA, java, java)
AS_IF([test x"$JAVA" = x],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([error: no java found; check path for JAVA package first...])
vtsetup_error="yes"
])

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

@ -1,6 +1,8 @@
# This file lists all calls, which should not be generated
# automatically by mk_c_wrapper.sh
MPI_Address
MPI_Get_address
MPI_Pcontrol
MPI_Wtick
MPI_Wtime
@ -38,6 +40,8 @@ MPI_Cart_sub
MPI_Comm_create
MPI_Comm_dup
MPI_Comm_free
MPI_Comm_group
MPI_Comm_remote_group
MPI_Comm_split
MPI_Exscan
MPI_Gather
@ -97,6 +101,7 @@ MPI_Win_complete
MPI_Win_create
MPI_Win_fence
MPI_Win_free
MPI_Win_get_group
MPI_Win_lock
MPI_Win_post
MPI_Win_start

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

@ -275,8 +275,6 @@ cat <<End-of-File >$tmp.awk
# by MPI_Fint.
# -------------------------------------------------
function converttype(type) {
gsub("MPI_Aint","MPI_Fint",type)
if (ENVIRON["COMM_CONVERT"] == 1)
gsub("MPI_Comm","MPI_Fint",type)
@ -326,9 +324,6 @@ function print_convert_function(type,para,decl) {
if (type == "char*") {
if (decl) printf" char* %sC = NULL;\n", para
else printf" vt_string_f2c(%s, %s_len, &%sC);\n", para, para, para
} else if (index(type,"MPI_Aint") > 0) {
if (decl) printf" MPI_Aint %sC;\n",para
else printf" %sC = (MPI_Aint)%s%s;\n",para,pointer,para
} else if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if (decl) printf" MPI_Comm %sC;\n", para
else printf" %sC = MPI_Comm_f2c(%s%s);\n",para,pointer,para
@ -380,8 +375,6 @@ function print_convert_function(type,para,decl) {
if (type == "char*") {
if (decl) printf " char %sC[1024];\n", para
} else if (index(type,"MPI_Aint") > 0) {
if (decl) printf" MPI_Aint %sC;\n",para
} else if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if (decl) printf" MPI_Comm %sC;\n",para
else printf" %sC = MPI_COMM_NULL;\n",para
@ -440,13 +433,7 @@ function print_convert_function(type,para,decl) {
len_parameter = lentemp[2]
#now we have to handle all the imaginable handles
if (index(type,"MPI_Aint") > 0) {
if (decl) {
printf" MPI_Aint* %sC;\n",para
} else {
printf" %sC = (MPI_Aint*)malloc(sizeof(MPI_Aint)*(*%s));\n",para,len_parameter
}
} else if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if (decl) {
printf" MPI_Comm* %sC;\n",para
} else {
@ -551,12 +538,7 @@ function print_convert_function(type,para,decl) {
len_parameter = lentemp[2]
#now we have to handle all the imaginable handles
if (index(type,"MPI_Aint") > 0) {
if (!decl) {
printf" for (i = 0; i < *%s; i++) \n",len_parameter
printf" %sC[i] = (MPI_Aint)%s[i];\n",para,para
}
} else if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
if (!decl) {
printf" for (i = 0; i < *%s; i++) \n",len_parameter
printf" %sC[i] = MPI_Comm_f2c(%s[i]);\n",para,para
@ -635,9 +617,6 @@ function print_back_convert_function(type,para) {
if (type == "char*")
printf" vt_string_c2f(%sC, %s, %s_len);\n", para, para, para
if (index(type,"MPI_Aint") > 0)
printf" *%s = (MPI_Fint)%sC;\n",para,para
if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0))
printf" *%s = MPI_Comm_c2f(%sC);\n",para,para
@ -686,13 +665,6 @@ function print_back_convert_function(type,para) {
len_parameter = lentemp[2]
#now we have to handle all the imaginable handles
if (index(type,"MPI_Aint") > 0) {
printf" if ( *%s != MPI_UNDEFINED )\n {\n",len_parameter
printf" for (i = 0; i < *%s; i++) \n",len_parameter
printf" %s[i] = (MPI_Fint)%sC[i];\n",para,para
printf" }\n"
}
if ((ENVIRON["COMM_CONVERT"] == 1) && (index(type,"MPI_Comm") > 0)) {
printf" if ( *%s != MPI_UNDEFINED )\n {\n",len_parameter
printf" for (i = 0; i < *%s; i++) \n",len_parameter
@ -768,8 +740,7 @@ function print_back_convert_function(type,para) {
if ( (index(para,"_CLASS_ARRAY_") != 0) &&
(index(type,"MPI_Status") == 0) )
{
if ( (index(type,"MPI_Aint") != 0) ||
((index(type,"MPI_Comm") != 0) && (ENVIRON["COMM_CONVERT"] == 1)) ||
if ( ((index(type,"MPI_Comm") != 0) && (ENVIRON["COMM_CONVERT"] == 1)) ||
((index(type,"MPI_Errhandler") != 0) && (ENVIRON["ERRHANDLER_CONVERT"] == 1)) ||
((index(type,"MPI_File") != 0) && (ENVIRON["FILE_CONVERT"] == 1)) ||
((index(type,"MPI_Group") != 0) && (ENVIRON["GROUP_CONVERT"] == 1)) ||
@ -830,17 +801,16 @@ function get_converted_name(para,type) {
address="&"
#handle conversion
if ((index(type,"MPI_Aint") > 0) ||
((ENVIRON["COMM_CONVERT"] == 1)&&(index(type,"MPI_Comm") > 0)) ||
((ENVIRON["ERRH_CONVERT"] == 1)&&(index(type,"MPI_Errhandler") > 0)) ||
((ENVIRON["FILE_CONVERT"] == 1)&&(index(type,"MPI_File") > 0)) ||
((ENVIRON["GROUP_CONVERT"] == 1)&&(index(type,"MPI_Group") > 0)) ||
((ENVIRON["INFO_CONVERT"] == 1)&&(index(type,"MPI_Info") > 0)) ||
((ENVIRON["OP_CONVERT"] == 1)&&(index(type,"MPI_Op") > 0)) ||
((ENVIRON["TYPE_CONVERT"] == 1)&&(index(type,"MPI_Datatype") > 0)) ||
((ENVIRON["WIN_CONVERT"] == 1)&&(index(type,"MPI_Win") > 0)) ||
((ENVIRON["REQUEST_CONVERT"] == 1)&&(index(type,"MPI_Request") > 0)) ||
(index(type,"MPI_Status") > 0) )
if ( ((ENVIRON["COMM_CONVERT"] == 1)&&(index(type,"MPI_Comm") > 0)) ||
((ENVIRON["ERRH_CONVERT"] == 1)&&(index(type,"MPI_Errhandler") > 0)) ||
((ENVIRON["FILE_CONVERT"] == 1)&&(index(type,"MPI_File") > 0)) ||
((ENVIRON["GROUP_CONVERT"] == 1)&&(index(type,"MPI_Group") > 0)) ||
((ENVIRON["INFO_CONVERT"] == 1)&&(index(type,"MPI_Info") > 0)) ||
((ENVIRON["OP_CONVERT"] == 1)&&(index(type,"MPI_Op") > 0)) ||
((ENVIRON["TYPE_CONVERT"] == 1)&&(index(type,"MPI_Datatype") > 0)) ||
((ENVIRON["WIN_CONVERT"] == 1)&&(index(type,"MPI_Win") > 0)) ||
((ENVIRON["REQUEST_CONVERT"] == 1)&&(index(type,"MPI_Request") > 0)) ||
(index(type,"MPI_Status") > 0) )
return address para "C"
#it is not a handle type so normal handling

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

@ -136,8 +136,6 @@ cat <<End-of-File >$tmp.awk
type="VT_MPI_COLL_ALL2ONE"
else if ( lastparam[3] == "/*COLL_ALL2ALL*/" )
type="VT_MPI_COLL_ALL2ALL"
else if ( lastparam[3] == "/*COLL_OTHER*/" )
type="VT_MPI_COLL_OTHER"
else
type="VT_MPI_FUNCTION"

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

@ -42,6 +42,7 @@ VT_MPI_INT MPI_Win_complete(MPI_Win win);
VT_MPI_INT MPI_Win_create(void* base, MPI_Aint size, VT_MPI_INT disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win* win_CLASS_SINGLE_OUT);
VT_MPI_INT MPI_Win_fence(VT_MPI_INT assert, MPI_Win win);
VT_MPI_INT MPI_Win_free(MPI_Win* win_CLASS_SINGLE_IO);
VT_MPI_INT MPI_Win_get_group(MPI_Win win, MPI_Group* group_CLASS_SINGLE_OUT);
VT_MPI_INT MPI_Win_lock(VT_MPI_INT lock_type, VT_MPI_INT rank, VT_MPI_INT assert, MPI_Win win);
VT_MPI_INT MPI_Win_post(MPI_Group group, VT_MPI_INT assert, MPI_Win win);
VT_MPI_INT MPI_Win_start(MPI_Group group, VT_MPI_INT assert, MPI_Win win);

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

@ -36,4 +36,4 @@
**/
VT_MPI_INT MPI_Alltoallw(void* sendbuf_CLASS_BUFFER, VT_MPI_INT* sendcounts, VT_MPI_INT* sdispls, MPI_Datatype* sendtypes_CLASS_ARRAY_IN_sendcounts, void* recvbuf_CLASS_BUFFER, VT_MPI_INT* recvcounts, VT_MPI_INT* rdispls, MPI_Datatype* recvtypes_CLASS_ARRAY_IN_recvcounts, MPI_Comm comm); /*COLL_ALL2ALL*/
VT_MPI_INT MPI_Exscan(void* sendbuf_CLASS_BUFFER, void* recvbuf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); /*COLL_OTHER*/
VT_MPI_INT MPI_Exscan(void* sendbuf_CLASS_BUFFER, void* recvbuf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); /*COLL_ALL2ALL*/

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

@ -128,7 +128,7 @@ VT_MPI_INT MPI_Reduce_scatter(void* sendbuf_CLASS_BUFFER_IN_PLACE, void* recvbuf
VT_MPI_INT MPI_Request_free(MPI_Request* request_CLASS_SINGLE_IO);
VT_MPI_INT MPI_Rsend(void* buf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, VT_MPI_INT dest, VT_MPI_INT tag, MPI_Comm comm);
VT_MPI_INT MPI_Rsend_init(void* buf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, VT_MPI_INT dest, VT_MPI_INT tag, MPI_Comm comm, MPI_Request* request_CLASS_SINGLE_OUT);
VT_MPI_INT MPI_Scan(void* sendbuf_CLASS_BUFFER_IN_PLACE, void* recvbuf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); /*COLL_OTHER*/
VT_MPI_INT MPI_Scan(void* sendbuf_CLASS_BUFFER_IN_PLACE, void* recvbuf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); /*COLL_ALL2ALL*/
VT_MPI_INT MPI_Scatter(void* sendbuf_CLASS_BUFFER, VT_MPI_INT sendcount, MPI_Datatype sendtype, void* recvbuf_CLASS_BUFFER_IN_PLACE, VT_MPI_INT recvcount, MPI_Datatype recvtype, VT_MPI_INT root, MPI_Comm comm); /*COLL_ONE2ALL*/
VT_MPI_INT MPI_Scatterv(void* sendbuf_CLASS_BUFFER, VT_MPI_INT* sendcounts, VT_MPI_INT* displs, MPI_Datatype sendtype, void* recvbuf_CLASS_BUFFER_IN_PLACE, VT_MPI_INT recvcount, MPI_Datatype recvtype, VT_MPI_INT root, MPI_Comm comm); /*COLL_ONE2ALL*/
VT_MPI_INT MPI_Send(void* buf_CLASS_BUFFER, VT_MPI_INT count, MPI_Datatype datatype, VT_MPI_INT dest, VT_MPI_INT tag, MPI_Comm comm);

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

@ -80,19 +80,54 @@ AS_IF([test x"$inside_openmpi" = "xyes" -o "$datarootdir" = "\${prefix}/share"],
AS_IF([test "$docdir" = "\${datarootdir}/doc/\${PACKAGE_TARNAME}"],
[docdir="\${datarootdir}/doc"])
# Declare additional variables
AC_ARG_VAR(AR, [archiver command])
AC_ARG_VAR(NM, [command to list symbols from object files])
AC_ARG_VAR(JAVA, [Java application launcher command])
ACVT_CONF_TITLE([Compiler, preprocessor, and programs])
# Check for compiler and preprocessor
AS_IF([test x"$F77" = x -a x"$FC" != x], [F77=$FC])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_F77
AC_PROG_FC
AM_PROG_AS
# Do we want to support Fortran
check_fortran="yes"
force_fortran="no"
AC_ARG_ENABLE(fortran,
AC_HELP_STRING([--enable-fortran],
[enable Fortran support, default: enable if Fortran compiler found by configure]),
[
AS_IF([test x"$enableval" = "xyes"],
[
force_fortran="yes"
],
[
check_fortran="no"
F77=
FC=
])
])
# 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],
[
AC_MSG_NOTICE([error: no Fortran 77 compiler found])
AS_IF([test x"$force_fortran" = "xyes"], [exit 1])
])
AC_PROG_FC
])
AC_LANG([C])
AS_IF([test x"$F77" != x],
@ -113,11 +148,6 @@ AC_ARG_ENABLE(binaries,
[enable_binaries="$enableval"], [enable_binaries="yes"])
AM_CONDITIONAL(AMBUILDBINARIES, test x"$enable_binaries" = "xyes")
# Declare additional variables
AC_ARG_VAR(AR, [archiver command])
AC_ARG_VAR(NM, [command to list symbols from object files])
AC_ARG_VAR(JAVA, [Java application launcher command])
# Check for programs
#AC_PROG_AR
AC_CHECK_PROGS(AR, ar, ar)
@ -351,6 +381,19 @@ 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 CUDA Toolkit
ACVT_CONF_TITLE([CUDA Toolkit])
ACVT_CUDA
AS_IF([test x"$enable_config_titles" = "xyes" -a x"$check_cuda" = "xno"],
[AC_MSG_NOTICE([disabled via command line switch])])
AS_IF([test x"$force_cuda" = "xyes" -a x"$cuda_error" = "xyes"], [exit 1])
AM_CONDITIONAL(AMBUILDCUDA, test x"$have_cuda" = "xyes")
AM_CONDITIONAL(AMBUILDCUDART, test x"$have_cudart" = "xyes")
# Check for CUPTI support
ACVT_CUPTI
AM_CONDITIONAL(AMBUILDCUPTI, test x"$have_cupti" = "xyes")
# Check for library tracing support
ACVT_CONF_TITLE([Library tracing])
ACVT_LIBWRAP
@ -365,9 +408,11 @@ AM_CONDITIONAL(AMHAVEFORK, test x"$have_libcwrap" = "xyes" -a x"$have_fork" = "x
AM_CONDITIONAL(AMBUILDIOWRAP, test x"$have_iowrap" = "xyes")
AM_CONDITIONAL(AMBUILDCUDAWRAP, test x"$have_cudawrap" = "xyes")
AM_CONDITIONAL(AMBUILDCUDARTWRAP, test x"$have_cudartwrap" = "xyes")
AM_CONDITIONAL(AMBUILDCUPTI, test x"$have_cupti" = "xyes")
AM_CONDITIONAL(AMBUILDVTNVCC, test x"$have_cudartwrap" = "xyes" -a x"$NVCC" != x)
# Check for GPU support
AM_CONDITIONAL(AMHAVEGPU, test x"$have_cupti" = "xyes" -o x"$have_cudartwrap" = "xyes")
# Check path for node-local temporary directory
ACVT_LTMPDIR

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

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

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

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

@ -1,4 +1,4 @@
<vtconfig vtconfigversion="1.0" vtversion="@PACKAGE_VERSION@">
<vtconfig vtconfigversion="1.0.1" vtversion="@PACKAGE_VERSION@">
<config attr="nm">@VT_SETUP_NM@</config>

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

@ -4,6 +4,7 @@ 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>
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>

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

@ -1,3 +1,43 @@
1.10openmpi
- added process substitute record
- added process group attribute 'OTF_ATTR_IsCommunicator'
- renamed OTF_fprintf to OTF_Error which sets the error variables
otf_errno and otf_strerr
- added OTF_Warning which prints warning messages if verbosity
(--with-verbose) is enabled
- fixed detection of C compiler flags for compiling the python interface
- corrected return value of OTF_WStream_write* functions
- fixed parsing of process[group] attributes record
- otfmerge-mpi:
- build sequential version; replaces the old otfmerge
- otfprofile-mpi:
- added process clustering based on feature vectors from every
process trace
(see docu/tools/otfprofile_clustering.pdf for more details)
- added CSV output
- changeable number of process groups for LaTeX output
- build sequential version; replaces the old otfprofile
- fixed problem with pgfplots 1.5
- improved y axis labeling for message length charts
- otfshrink:
- added mapping mode where all but one members per group are
removed with multiple groups
- reworked parameter parsing, <from>-<to> ranges no longer
supported
- fixed creation of symbolic links when non-contiguous
stream IDs are used
- disable 'parent' in a remaining process definition in case
the parent is removed
1.9.2sawfish
- otfprofile-mpi:
- ignore "backward-running" P2P-messages when calculating
durations
- removed '0' in message length charts and added '1' as
extra label
- added thousands separator for large integer numbers in
latex output
1.9.1sawfish
- improved zlib compression
- added progress display to otfprofile-mpi

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

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

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

@ -34,7 +34,10 @@ canonical name.])
if test x"$python_config" != x; then
AC_MSG_CHECKING([for python compiler flags])
SWIG_PYTHON_CFLAGS=`$python_config --cflags`
# cannot use '--cflags' here; the resulting flags might contain GNU specific flags
# which are not compatible with other compilers; use '--includes' instead of '--cflags'
#SWIG_PYTHON_CFLAGS=`$python_config --cflags
SWIG_PYTHON_CFLAGS=`$python_config --includes`
AC_MSG_RESULT([$SWIG_PYTHON_CFLAGS])
fi
fi

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

@ -71,7 +71,7 @@ CHECK_SWIG_PYTHON
if test x"$force_swig_python" = "xyes" -a x"$swig_python_error" = "xyes"; then exit 1; fi
AM_CONDITIONAL(AMHAVESWIGPYTHON, test x"$have_swig_python" = xyes)
# Checks for pdflatex and PGFPLOTS needed for otfprofile-mpi to convert TeX output to PDF
# Checks for pdflatex and PGFPLOTS needed for otfprofile to convert TeX output to PDF
CHECK_PDFLATEX_PGFPLOTS
@ -134,9 +134,9 @@ AC_CONFIG_FILES([Makefile
tools/otfdump/Makefile
tools/otfinfo/Makefile
tools/otfmerge/Makefile
tools/otfmerge-mpi/Makefile
tools/otfmerge/mpi/Makefile
tools/otfprofile/Makefile
tools/otfprofile-mpi/Makefile
tools/otfprofile/mpi/Makefile
tools/otfshrink/Makefile
tools/otf2vtf/Makefile
tools/vtf2otf/Makefile
@ -146,6 +146,7 @@ AC_CONFIG_FILES([Makefile
tests/generic_streams-mpi/Makefile
tests/progress/Makefile
tests/read_from_buffer/Makefile
tests/thumbnail/Makefile
docu/Makefile
])

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

@ -3,7 +3,8 @@ otfdoc_DATA = \
$(top_srcdir)/LICENSE \
api/specification.pdf \
tools/otftools.pdf \
tools/otfprofile.pdf
tools/otfprofile.pdf \
tools/otfprofile_clustering.pdf
otfdocdir = $(docdir)

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

Двоичные данные
ompi/contrib/vt/vt/extlib/otf/docu/tools/otfprofile_clustering.pdf Обычный файл

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

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

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

@ -1,5 +1,6 @@
include_HEADERS = otfaux.h \
OTFAUX_MsgMatching.h
OTFAUX_MsgMatching.h \
OTFAUX_Thumbnail.h
noinst_HEADERS =
@ -14,6 +15,7 @@ libotfaux_la_CFLAGS = -prefer-pic
#libotfaux_la_LDFLAGS = -version-info @OTF_VERSION_LIBRARY@
libotfaux_la_LIBADD = $(top_builddir)/vendor/jenkins_hash/libjenkins_hash.la
libotfaux_la_SOURCES = \
OTFAUX_MsgMatching.c
OTFAUX_MsgMatching.c \
OTFAUX_Thumbnail.c
EXTRA_DIST =

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

@ -0,0 +1,574 @@
#include <config.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <otf.h>
/* for OTF_Error */
#include <OTF_Errno.h>
#include <jenkins_hash.h>
#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_Context* new_context = calloc( 1, sizeof( *new_context ) );
/* TODO: callculate sample time stamps */
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 );
}
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_Thumbail_Process* process;
process = get_process( tn_context, process_token, 0 );
if ( !process ) {
return 0;
}
/* TODO */
return 0;
}
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 ) );
}
strcpy( name_buffer, namestub );
strcat( name_buffer, ".thumb" );
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 )
{
int ret;
if ( !tn_writer ) {
return 0;
}
ret = OTFAUX_ThumbnailWriter_close( tn_writer );
free( tn_writer->namestub );
free( tn_writer );
return ret;
}
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;
};
OTFAUX_ThumbnailReader*
OTFAUX_ThumbnailReader_create( const char* filename,
OTF_FileManager* manager )
{
OTFAUX_ThumbnailReader* new_reader;
if ( !filename || !manager ) {
return NULL;
}
new_reader = calloc( 1, sizeof( *new_reader) );
if ( !new_reader ) {
return NULL;
}
new_reader->namestub = OTF_stripFilename( filename );
if ( !new_reader->namestub ) {
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 ) {
return 0;
}
if ( tn_reader->buffer ) {
OTF_RBuffer_close( tn_reader->buffer );
}
tn_reader->buffer = NULL;
return 1;
}
int
OTFAUX_ThumbnailReader_getDimension( OTFAUX_ThumbnailReader* tn_reader,
uint32_t* height,
uint32_t* width )
{
if ( !tn_reader ) {
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;
}
return 1;
}
int
OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
void ( *handler )( void*,
uint64_t,
uint32_t,
uint32_t ),
void* data )
{
uint64_t process;
uint32_t start_pixel, function;
if ( !tn_reader ) {
return 0;
}
if ( !tn_reader->buffer ) {
int ret;
ret = OTFAUX_ThumbnailReader_getDimension( tn_reader, NULL, NULL );
if ( !ret ) {
return ret;
}
}
while ( OTF_RBuffer_guaranteeRecord( tn_reader->buffer ) ) {
/* read process */
process = OTF_RBuffer_readUint64( tn_reader->buffer );
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;
}

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

@ -0,0 +1,225 @@
#ifndef OTFAUX_THUMBNAIL_H
#define OTFAUX_THUMBNAIL_H
#include <otf.h>
/**
* @file otfauxlib/OTFAUX_Thumbnail.h
*
* @brief Provides a module to collect data for thumbnail generation.
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup thumbnail Module for thumbnail generation.
*
* @usage:
*
* ctx = OTFAUX_Thumbnail_Create(minTime, maxTime, 1024);
*
* announce all interesting processes:
* OTFAUX_Thumbnail_declareProcess(ctx, ...);
*
* repeatedly call for interesting processes:
* OTFAUX_Thumbnail_handleEnter(ctx, ...);
* OTFAUX_Thumbnail_handleLeave(ctx, ...);
*
* at end, for all processes:
* OTFAUX_ThumbnailData td;
* OTFAUX_Thumbnail_getData(ctx, process, &td);
* .. do something with td.start_pixel and td.function ..
*
* OTFAUX_Thumbnail_Destroy(ctx);
*
* @{
*/
/** Opaque type for using the thumbnail module. */
typedef struct OTFAUX_Thumbnail_Context OTFAUX_Thumbnail_Context;
/**
* 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 The context.
*/
OTFAUX_Thumbnail_Context*
OTFAUX_Thumbnail_create( uint64_t minTime,
uint64_t maxTime,
uint32_t width );
/**
* Destroy a context previously created with @a OTFAUX_Thumbnail_Create.
*
* @param tn_context The context.
*/
void
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.
*/
void
OTFAUX_Thumbnail_declareProcess( OTFAUX_Thumbnail_Context* tn_context,
uint64_t process );
/**
* Declare that the process @a process has entered the fucntion @a function
* at timestamp @a timestamp.
*
* This function needs to be called in monotonically increasing timestamp order.
*
* @param tn_context The context.
* @param timestamp The timestamp.
* @param process The process.
* @param function The function.
*/
void
OTFAUX_Thumbnail_handleEnter( OTFAUX_Thumbnail_Context* tn_context,
uint64_t timestamp,
uint64_t process,
uint32_t function );
/**
* Declare that the process @a process has left the current fucntion at
* timestamp @a timestamp.
*
* This function needs to be called in monotonically increasing timestamp order.
*
* @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.
*/
int
OTFAUX_Thumbnail_getData( OTFAUX_Thumbnail_Context* context,
uint64_t process,
OTFAUX_Thumbnail_Data* data );
/**
* @}
*/
char*
OTFAUX_Thumbnail_getFilename( const char* namestub,
size_t length,
char* name_buffer );
/**
* @defgroup thumbnailwriter Module to write a thumbnail.
*
* @usage:
*
* writer = OTFAUX_ThumbnailWriter_create("foo.otf", 512, 1024, ...);
*
* for each process:
* OTFAUX_ThumbnailData td;
* OTFAUX_Thumbnail_getData( ctx, process, &td );
* OTFAUX_ThumbnailWriter_writeProcess( writer, process, &td );
*
* OTFAUX_ThumbnailWriter_destroy( writer );
*/
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 );
/**
* @}
*/
/**
* @defgroup thumbnailreader Module to read a thumbnail.
*/
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 );
int
OTFAUX_ThumbnailReader_close( OTFAUX_ThumbnailReader* tn_reader );
int
OTFAUX_ThumbnailReader_getDimension( OTFAUX_ThumbnailReader* tn_reader,
uint32_t* height,
uint32_t* width );
int
OTFAUX_ThumbnailReader_read( OTFAUX_ThumbnailReader* tn_reader,
void ( *process_handler )( void*,
uint64_t,
uint32_t,
uint32_t ),
void* data );
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* OTFAUX_THUMBNAIL_H */

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

@ -9,5 +9,6 @@
*/
#include <OTFAUX_MsgMatching.h>
#include <OTFAUX_Thumbnail.h>
#endif /* OTFAUX_H */

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

@ -175,34 +175,32 @@ int OTF_CopyHandler_DefKeyValue( void* userData, uint32_t stream, uint32_t key,
type, name, description, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_DefTimeRange( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list ) {
int OTF_CopyHandler_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeDefTimeRange( (OTF_Writer*)userData,
stream,
minTime,
maxTime,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
return ( 0 == OTF_Writer_writeDefTimeRange( (OTF_Writer*)userData,
stream, minTime, maxTime, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_DefCounterAssignments( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list ) {
int OTF_CopyHandler_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members, const uint32_t* procs_or_groups,
OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeDefCounterAssignments( (OTF_Writer*)userData,
stream,
counter,
number_of_members,
procs_or_groups,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
return ( 0 == OTF_Writer_writeDefCounterAssignments( (OTF_Writer*)userData,
stream, counter, number_of_members, procs_or_groups,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list ) {
return ( 0 == OTF_Writer_writeDefProcessSubstitutes( (OTF_Writer*)userData,
stream, representative, numberOfProcs, procs,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** Event handlers *** ****************************************** */

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

@ -81,18 +81,16 @@ int OTF_CopyHandler_DefFileGroup( void* userData, uint32_t stream,
int OTF_CopyHandler_DefKeyValue( void* userData, uint32_t stream, uint32_t key,
OTF_Type type, const char* name, const char* description, OTF_KeyValueList* list );
int OTF_CopyHandler_DefTimeRange( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list );
int OTF_CopyHandler_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list );
int OTF_CopyHandler_DefCounterAssignments( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
int OTF_CopyHandler_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members,
const uint32_t* procs_or_groups, OTF_KeyValueList* list );
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_NoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* list );

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

@ -175,32 +175,32 @@ int OTF_CopyHandler_stream_DefKeyValue( void* userData, uint32_t stream, uint32_
type, name, description, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_DefTimeRange( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list ) {
int OTF_CopyHandler_stream_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeDefTimeRange( (OTF_WStream*)userData,
minTime,
maxTime,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
return ( 0 == OTF_WStream_writeDefTimeRange( (OTF_WStream*)userData,
minTime, maxTime, list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_DefCounterAssignments( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list ) {
int OTF_CopyHandler_stream_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members, const uint32_t* procs_or_groups,
OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeDefCounterAssignments( (OTF_WStream*)userData,
counter,
number_of_members,
procs_or_groups,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
return ( 0 == OTF_WStream_writeDefCounterAssignments( (OTF_WStream*)userData,
counter, number_of_members, procs_or_groups,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
int OTF_CopyHandler_stream_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list ) {
return ( 0 == OTF_WStream_writeDefProcessSubstitutes( (OTF_WStream*)userData,
representative, numberOfProcs, procs,
list ) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
}
/* *** Event handlers *** ****************************************** */

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

@ -81,18 +81,16 @@ int OTF_CopyHandler_stream_DefFileGroup( void* userData, uint32_t stream,
int OTF_CopyHandler_stream_DefKeyValue( void* userData, uint32_t stream, uint32_t key,
OTF_Type type, const char* name, const char* description, OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefTimeRange( void* userData,
uint32_t stream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefTimeRange( void* userData, uint32_t stream,
uint64_t minTime, uint64_t maxTime, OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefCounterAssignments( void* userData,
uint32_t stream,
uint32_t counter,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter, uint32_t number_of_members, const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_DefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list );
int OTF_CopyHandler_stream_NoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* list );

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

@ -61,6 +61,7 @@ yet it breaks the link compatibility of library versions.*/
#define OTF_DEFPROCESSGROUP_RECORD 15
#define OTF_DEFATTRLIST_RECORD 55
#define OTF_DEFPROCESSORGROUPATTR_RECORD 56
#define OTF_DEFPROCESSSUBSTITUTES_RECORD 63
#define OTF_DEFFUNCTION_RECORD 16
#define OTF_DEFFUNCTIONGROUP_RECORD 17
#define OTF_DEFCOUNTER_RECORD 18
@ -102,7 +103,7 @@ yet it breaks the link compatibility of library versions.*/
#define OTF_MARKER_RECORD 46
/* Number of records */
#define OTF_NRECORDS 63
#define OTF_NRECORDS 64
/* Stream format definition */
@ -193,8 +194,8 @@ could be added for convenience.
/*
File Operations - 32-bit
The bits 0-4 contain the identifier of the file operation that has happened.
The bits 5-31 are bit flags that carry additional information on the operation.
The bits 0-5 contain the identifier of the file operation that has happened.
The bits 6-31 are bit flags that carry additional information on the operation.
A macro allows for accessing the file operation in a convenient way.
*/
#define OTF_FILEOP_BITS 0x0000001f
@ -251,7 +252,8 @@ typedef enum OTF_ATTR_TYPE_enum {
OTF_ATTR_IsOMPThread = 3, /**< */
OTF_ATTR_IsCellSPUThread = 4, /**< */
OTF_ATTR_hasGroupCounters = 5, /**< */
OTF_ATTR_hasEnterLeaveRecords = 6 /**< */
OTF_ATTR_hasEnterLeaveRecords = 6, /**< */
OTF_ATTR_IsCommunicator = 7 /**< */
} OTF_ATTR_TYPE;

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

@ -1,36 +1,40 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h"
#endif
#include "OTF_Definitions.h"
#include "OTF_Errno.h"
#include <stdarg.h>
#include <stdio.h>
char otf_strerr[OTF_ERR_LEN] = "No errors occurred.";
int otf_errno = OTF_NO_ERROR;
void OTF_Error( const char* format, ... ) {
va_list ap;
va_start( ap, format );
vsnprintf( otf_strerr, OTF_ERR_LEN, format, ap );
otf_errno = OTF_ERROR;
#ifdef OTF_VERBOSE
fprintf( stderr, "%s", otf_strerr );
#endif /* OTF_VERBOSE */
void OTF_fprintf( FILE* stream, const char* format, ... ) {
va_list ap;
va_start(ap, format);
va_end( ap );
}
vsnprintf( otf_strerr, OTF_ERR_LEN, format, ap );
otf_errno = OTF_ERROR;
fprintf( stream, "%s", otf_strerr );
void OTF_Warning( const char* format, ... ) {
va_end(ap);
}
va_list ap;
va_start( ap, format );
#else
#ifdef OTF_VERBOSE
vfprintf( stderr, format, ap );
#endif /* OTF_VERBOSE */
void OTF_fprintf( FILE* stream, const char* format, ... ) {
va_list ap;
va_start(ap, format);
vsnprintf( otf_strerr, OTF_ERR_LEN, format, ap );
otf_errno = OTF_ERROR;
va_end(ap);
}
#endif
va_end( ap );
}

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

@ -32,19 +32,16 @@
#define OTF_ERRNO_H
#include <stdio.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** @cond Errno.h */
/** the following line is ignored by doxygen */
/** the following lines is ignored by doxygen */
void OTF_fprintf( FILE* stream, const char* format, ... );
void OTF_Error( const char* format, ... );
void OTF_Warning( const char* format, ... );
/** @endcond */

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

@ -168,88 +168,90 @@ OTF_File* OTF_File_open( const char* filename,
OTF_File* OTF_File_open_with_external_buffer( uint32_t len, const char* buffer,
uint8_t is_compressed, OTF_FileMode mode ) {
OTF_File* ret;
OTF_File* ret;
ret= (OTF_File*) malloc( sizeof(OTF_File) );
if( NULL == ret ) {
ret= (OTF_File*) malloc( sizeof(OTF_File) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
}
return NULL;
}
OTF_File_init( ret );
OTF_File_init( ret );
ret->externalbuffer= buffer;
ret->externalpos= 0;
ret->externallen= (uint64_t) len;
ret->externalbuffer= buffer;
ret->externalpos= 0;
ret->externallen= (uint64_t) len;
ret->mode = mode;
ret->mode = mode;
if ( is_compressed ) {
if ( is_compressed ) {
#ifdef HAVE_ZLIB
/* alloc zlib stuff */
ret->z= malloc( sizeof(z_stream) );
if( NULL == ret->z ) {
/* alloc zlib stuff */
ret->z= malloc( sizeof(z_stream) );
if( NULL == ret->z ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n", __FUNCTION__, __FILE__, __LINE__ );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
free( ret );
ret= NULL;
return NULL;
}
free( ret );
ret= NULL;
ret->z->next_in= NULL;
ret->z->avail_in= 0;
ret->z->zalloc= NULL;
ret->z->zfree= NULL;
ret->z->opaque= NULL;
return NULL;
}
inflateInit( ret->z );
ret->z->next_in= NULL;
ret->z->avail_in= 0;
ret->z->zalloc= NULL;
ret->z->zfree= NULL;
ret->z->opaque= NULL;
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
inflateInit( ret->z );
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n", __FUNCTION__, __FILE__, __LINE__ );
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
free( ret->zbuffer );
ret->zbuffer= NULL;
free( ret->z );
ret->z= NULL;
free( ret );
ret= NULL;
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
}
free( ret->zbuffer );
ret->zbuffer= NULL;
free( ret->z );
ret->z= NULL;
free( ret );
ret= NULL;
return NULL;
}
#else /* HAVE_ZLIB */
free( ret );
ret= NULL;
free( ret );
ret= NULL;
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"built without HAVE_ZLIB, still trying to open with compressed buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"built without HAVE_ZLIB, still trying to open with compressed buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
return NULL;
#endif /* HAVE_ZLIB */
} else {
} else {
/* normal, don't need any special setup */
}
/* normal, don't need any special setup */
}
ret->manager= NULL;
ret->manager= NULL;
return ret;
return ret;
}
@ -265,7 +267,7 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return (size_t) -1;
@ -274,7 +276,7 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
if( OTF_FILEMODE_WRITE != file->mode ) {
OTF_fprintf ( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current file->mode is not OTF_FILEMODE_WRITE. writing forbidden.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -282,15 +284,9 @@ size_t OTF_File_write( OTF_File* file, const void* ptr, size_t size ) {
}
/*
OTF_fprintf( stderr, "OTF_File_write: %u / %u file handles\n",
OTF_FileManager_getCount( file->manager ),
OTF_FileManager_getNumber( file->manager ) );
*/
if( 0 == OTF_File_revive( file, OTF_FILEMODE_WRITE ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_revive() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -301,58 +297,53 @@ 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;
while (file->z->avail_in > 0)
{
status = deflate(file->z, Z_FULL_FLUSH);
if (status == Z_STREAM_ERROR)
{
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"error in compressing, status %i.\n",
__FUNCTION__, __FILE__, __LINE__, status );
return byteswritten;
}
while (file->z->avail_out == 0)
{
size_t towrite = file->zbuffersize - file->z->avail_out;
if (towrite != fwrite(file->zbuffer, 1, towrite, file->file))
{
OTF_fprintf(stderr, "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);
if (status == Z_STREAM_ERROR)
{
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"error in compressing, status %i.\n",
__FUNCTION__, __FILE__, __LINE__, status );
assert(status != Z_STREAM_ERROR);
return byteswritten;
}
}
byteswritten = size - file->z->avail_in;
}
/* compress the data without using the ybuffer */
file->z->avail_in = size;
file->z->next_in = (void*)ptr;
while (file->z->avail_in > 0) {
status = deflate(file->z, Z_FULL_FLUSH);
if (status == Z_STREAM_ERROR) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"error in compressing, status %i.\n",
__FUNCTION__, __FILE__, __LINE__, status );
return byteswritten;
}
while (file->z->avail_out == 0) {
size_t towrite = file->zbuffersize - file->z->avail_out;
if (towrite != fwrite(file->zbuffer, 1, towrite, file->file)) {
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);
if (status == Z_STREAM_ERROR) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"error in compressing, status %i.\n",
__FUNCTION__, __FILE__, __LINE__, status );
assert(status != Z_STREAM_ERROR);
return byteswritten;
}
}
byteswritten = size - file->z->avail_in;
}
} else {
#endif /* HAVE_ZLIB */
/*
OTF_fprintf( stderr, "OTF_File_write(): buffer %p, size %u file %p\n", ptr,
(uint32_t) size, file->file );
*/
byteswritten= fwrite( ptr, 1, size, file->file );
if( byteswritten < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"less bytes written than expected %u < %u.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) byteswritten,
(uint32_t) size );
@ -379,7 +370,7 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
if( OTF_FILEMODE_WRITE == file->mode ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current file->mode is OTF_FILEMODE_WRITE. reading forbidden.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -388,7 +379,7 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
if( 0 == OTF_File_revive( file, OTF_FILEMODE_READ ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_revive() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -422,7 +413,7 @@ size_t OTF_File_read( OTF_File* file, void* ptr, size_t size ) {
status = inflate( file->z, Z_SYNC_FLUSH );
if ( status != Z_OK ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"error in uncompressing, status %u.\n",
__FUNCTION__, __FILE__, __LINE__, status );
@ -464,7 +455,7 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return -1;
@ -473,7 +464,7 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
if( OTF_FILEMODE_WRITE == file->mode ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current file->mode is OTF_FILEMODE_WRITE. seeking forbidden.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -483,7 +474,7 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
if( 0 == OTF_File_revive( file, OTF_FILEMODE_SEEK ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_revive() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -499,28 +490,17 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
do {
/*
OTF_fprintf( stderr, "OTF_File_seek() with zlib: jump to %llu\n",
(unsigned long long) pos );
*/
/* OLD:
read= fread( file->zbuffer, 1, file->zbuffersize, file->file );
*/
read= OTF_File_read_internal( file, file->zbuffer, file->zbuffersize );
/*
OTF_fprintf( stderr, "OTF_File_seek() with zlib: read %llu bytes\n",
(unsigned long long) read );
*/
file->z->next_in= file->zbuffer;
file->z->avail_in= (uInt) read;
file->z->total_in= 0;
/* re-initialize z object */
inflateReset(file->z);
inflateReset(file->z);
/* do not sync at very beginning of compressed stream because it
would skip the first block */
@ -542,19 +522,14 @@ int OTF_File_seek( OTF_File* file, uint64_t pos ) {
if ( Z_DATA_ERROR == sync ) {
/* do not break here, this might happen with larger zlib chunks */
/*OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"Z_DATA_ERROR.\n",
__FUNCTION__, __FILE__, __LINE__ );
/* do not break here, this might happen with larger zlib chunks
return -1;
*/
continue;
*/
}
if ( Z_STREAM_ERROR == sync ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Z_STREAM_ERROR.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -575,7 +550,7 @@ uint64_t OTF_File_tell( OTF_File* file ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return (uint64_t) -1;
@ -599,7 +574,7 @@ uint64_t OTF_File_size( OTF_File* file ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return (uint64_t) -1;
@ -608,10 +583,10 @@ uint64_t OTF_File_size( OTF_File* file ) {
if ( stat( file->filename, &st ) == -1 ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"stat() failed: %s\n",
__FUNCTION__, __FILE__, __LINE__,
strerror(errno) );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"stat() failed: %s\n",
__FUNCTION__, __FILE__, __LINE__,
strerror(errno) );
return 0;
} else {
@ -633,7 +608,7 @@ int OTF_File_close( OTF_File* file ) {
if ( NULL == file ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"file has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -651,47 +626,52 @@ int OTF_File_close( OTF_File* file ) {
} else {
size_t towrite;
/* flush buffer */
if( 0 == OTF_File_revive( file, OTF_FILEMODE_WRITE ) ) {
size_t towrite;
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_revive() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
}
status = deflate(file->z, Z_FULL_FLUSH);
assert(status != Z_STREAM_ERROR);
towrite = file->zbuffersize - file->z->avail_out;
byteswritten = 0;
if (towrite > 0)
byteswritten = fwrite(file->zbuffer, 1, towrite, file->file);
if (towrite != byteswritten)
{
OTF_fprintf(stderr, "ERROR in function %s, file: %s, line: %i:\n"
"Failed to write compressed buffer of size %lu\n",
__FUNCTION__, __FILE__, __LINE__, towrite);
}
while (file->z->avail_out != file->zbuffersize)
{
file->z->avail_out = file->zbuffersize;
file->z->next_out = file->zbuffer;
deflate(file->z, Z_FULL_FLUSH);
assert(status != Z_STREAM_ERROR);
towrite = file->zbuffersize - file->z->avail_out;
if (towrite > 0)
fwrite(file->zbuffer, 1, towrite, file->file);
}
deflateEnd( file->z );
/* flush buffer */
if( 0 == OTF_File_revive( file, OTF_FILEMODE_WRITE ) ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_revive() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
}
status = deflate( file->z, Z_FULL_FLUSH );
assert( status != Z_STREAM_ERROR );
towrite = file->zbuffersize - file->z->avail_out;
byteswritten = 0;
if (towrite > 0)
byteswritten = fwrite( file->zbuffer, 1, towrite, file->file );
if (towrite != byteswritten) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n"
"Failed to write compressed buffer of size %lu\n",
__FUNCTION__, __FILE__, __LINE__, towrite );
}
while (file->z->avail_out != file->zbuffersize) {
file->z->avail_out = file->zbuffersize;
file->z->next_out = file->zbuffer;
deflate( file->z, Z_FULL_FLUSH );
assert(status != Z_STREAM_ERROR);
towrite = file->zbuffersize - file->z->avail_out;
if (towrite > 0)
fwrite( file->zbuffer, 1, towrite, file->file );
}
deflateEnd( file->z );
}
free( file->z );
file->z = NULL;
file->z = NULL;
free( file->zbuffer );
file->zbuffer = NULL;
file->zbuffer = NULL;
}
#endif /* HAVE_ZLIB */
if ( NULL != file->file ) {
@ -715,9 +695,9 @@ OTF_FileStatus OTF_File_status( OTF_File* file ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return OTF_FILESTATUS_UNKNOWN;
}
@ -743,9 +723,9 @@ void OTF_File_suspend( OTF_File* file ) {
if ( NULL != file->externalbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"not yet supported in 'external buffer' mode.\n",
__FUNCTION__, __FILE__, __LINE__ );
return;
}
@ -778,12 +758,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
/* file currently closed, aka open or reopen */
/*
OTF_fprintf( stderr, "OTF_File_revive() READ: ask FileManager for free handle\n" );
*/
if ( 0 == OTF_FileManager_guaranteeFile( file->manager ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_guaranteeFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -816,7 +793,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
} else {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for reading. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -835,7 +812,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if( NULL == file->file ) {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for reading. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -851,7 +828,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if ( 0 == OTF_FileManager_registerFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_registerFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -861,12 +838,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
} else {
/* file already opened */
/*
OTF_fprintf( stderr, "OTF_File_revive() READ: update FileManagers LRU list\n" );
*/
if ( 0 == OTF_FileManager_touchFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_touchFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -884,12 +858,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
/* file currently closed */
/*
OTF_fprintf( stderr, "OTF_File_revive() WRITE: ask FileManager for free handle\n" );
*/
if ( 0 == OTF_FileManager_guaranteeFile( file->manager ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_guaranteeFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -904,7 +875,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if( NULL == file->file ) {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for writing. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -920,7 +891,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if( NULL == file->file ) {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for writing. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -929,12 +900,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
}
}
/*
OTF_fprintf( stderr, "OTF_File_revive() WRITE: register opened file with FileManager\n" );
*/
if ( 0 == OTF_FileManager_registerFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_registerFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -944,12 +912,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
} else {
/* file already opened */
/*
OTF_fprintf( stderr, "OTF_File_revive() WRITE: update FileManagers LRU list\n" );
*/
if ( 0 == OTF_FileManager_touchFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_touchFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -967,12 +932,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
/* file currently closed */
/*
OTF_fprintf( stderr, "OTF_File_revive() READ: ask FileManager for free handle\n" );
*/
if ( 0 == OTF_FileManager_guaranteeFile( file->manager ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_guaranteeFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -987,7 +949,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if( NULL == file->file ) {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for reading. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -1009,7 +971,7 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
if( NULL == file->file ) {
/* show this error every time */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open file %s for reading. Maybe the number of "
"opened filehandles exceeds your system's limit\n",
__FUNCTION__, __FILE__, __LINE__, file->filename );
@ -1018,12 +980,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
}
}
/*
OTF_fprintf( stderr, "OTF_File_revive() SEEK: register opened file with FileManager\n" );
*/
if ( 0 == OTF_FileManager_registerFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_registerFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1033,12 +992,9 @@ int OTF_File_revive( OTF_File* file, OTF_FileMode mode ) {
} else {
/* file already opened */
/*
OTF_fprintf( stderr, "OTF_File_revive() READ: update FileManagers LRU list\n" );
*/
if ( 0 == OTF_FileManager_touchFile( file->manager, file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_touchFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1067,7 +1023,7 @@ void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
void *tmp;
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -1075,13 +1031,13 @@ void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"zbuffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"zbuffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -1094,7 +1050,7 @@ void OTF_File_setZBufferSize( OTF_File* file, uint32_t size ) {
tmp = realloc( file->zbuffer, size );
if (tmp == NULL)
{
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"No memory left to reallocate zlib buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
return;
@ -1121,7 +1077,7 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
/* Check input parameters */
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no filename has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1129,19 +1085,17 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
}
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
}
/* OTF_fprintf( stderr, "OTF_File_open_zlevel() zlevel: %u, filename: \"%s\"\n", zlevel, filename ); */
ret= (OTF_File*) malloc( sizeof(OTF_File) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1154,7 +1108,7 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
ret->filename= malloc( len +3 );
if( NULL == ret->filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1178,10 +1132,6 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
strncpy( ret->filename +len, ".z", 3 );
/*
OTF_fprintf( stderr, "try '%s'\n", ret->filename );
*/
if ( 0 != access( ret->filename, F_OK ) ) {
/* file still not found, give up */
@ -1196,7 +1146,7 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
ret->z= malloc( sizeof(z_stream) );
if( NULL == ret->z ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1217,10 +1167,10 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
inflateInit( ret->z );
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1241,16 +1191,16 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
#else /* HAVE_ZLIB */
if ( 0 != access( ret->filename, F_OK ) ) {
strncpy( ret->filename +len, ".z", 3 );
if ( 0 == access( ret->filename, F_OK ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"cannot open %s. Zlib is not enabled.\n",
__FUNCTION__, __FILE__, __LINE__, ret->filename );
strncpy( ret->filename +len, ".z", 3 );
}
if ( 0 == access( ret->filename, F_OK ) ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open %s. Zlib is not enabled.\n",
__FUNCTION__, __FILE__, __LINE__, ret->filename );
}
/* file still not found, give up */
free( ret->filename );
@ -1275,7 +1225,7 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
ret->z= malloc( sizeof(z_stream) );
if( NULL == ret->z ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1298,7 +1248,7 @@ OTF_File* OTF_File_open_zlevel( const char* filename, OTF_FileManager* manager,
ret->zbuffer= malloc( ret->zbuffersize );
if( NULL == ret->zbuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1337,13 +1287,6 @@ size_t OTF_File_read_internal( OTF_File* file, void* dest, size_t length ) {
actual_length= file->externallen - file->externalpos;
actual_length= ( length <= actual_length ) ? length : actual_length;
/*
OTF_fprintf( stderr, "OTF_File_read_internal from external buffer: "
"addr %x, length %llu, actual_length %llu, pos %llu, bufflen %llu\n",
file->externalbuffer,
(uint64_t)length, (uint64_t)actual_length, (uint64_t) file->externalpos, (uint64_t) file->externallen );
*/
memcpy( dest, file->externalbuffer + file->externalpos, actual_length );
file->externalpos += actual_length;

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

@ -76,7 +76,7 @@ void OTF_FileManager_finalize( OTF_FileManager* manager ) {
# ifdef OTF_DEBUG
if ( 0 < manager->count ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"open file remaining.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -108,7 +108,7 @@ OTF_FileManager* OTF_FileManager_open( uint32_t number ) {
OTF_FileManager* ret= (OTF_FileManager*) malloc( sizeof(OTF_FileManager) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -153,7 +153,7 @@ uint32_t OTF_FileManager_setNumber( OTF_FileManager* fh, uint32_t number ) {
if ( 0 == number ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"illegal value 0 ignored.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -171,39 +171,23 @@ return 1 on success, 0 otherwise (which is not supposed to happen) */
int OTF_FileManager_guaranteeFile( OTF_FileManager* m ) {
/*
OTF_fprintf( stderr, "OTF_FileManager_guaranteeFile()\n" );
*/
if ( m->count < m->number ) {
/* free file handles available */
/*
OTF_fprintf( stderr, " OTF_FileManager_guaranteeFile() free handles left\n" );
*/
return 1;
}
/*
OTF_fprintf( stderr, " OTF_FileManager_guaranteeFile() need new handles\n" );
*/
/* suspend last entry in list */
if ( 0 == OTF_FileManager_suspendFile( m, m->list->file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_FileManager_suspendFile() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
}
/*
OTF_fprintf( stderr, "post suspend %u / %u\n", m->count, m->number );
*/
return 1;
}
@ -212,13 +196,9 @@ int OTF_FileManager_guaranteeFile( OTF_FileManager* m ) {
int OTF_FileManager_registerFile( OTF_FileManager* m, OTF_File* file ) {
/*
OTF_fprintf( stderr, "OTF_FileManager_registerFile()\n" );
*/
if ( OTF_FILESTATUS_ACTIVE != OTF_File_status( file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"file not open.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -227,9 +207,9 @@ int OTF_FileManager_registerFile( OTF_FileManager* m, OTF_File* file ) {
if ( m->count >= m->number ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot register new file because limit %u exceeded, call "
"'OTF_FileManager_guaranteeFile()' before.\n",
"'OTF_FileManager_guaranteeFile()' before.\n",
__FUNCTION__, __FILE__, __LINE__, m->number );
return 0;
@ -237,9 +217,6 @@ int OTF_FileManager_registerFile( OTF_FileManager* m, OTF_File* file ) {
OTF_FileManager_listInsertAtHead( &(m->list), file );
/*
OTF_fprintf( stderr, " c++ %u -> %u\n", m->count, m->count+1 );
*/
m->count++;
return 1;
@ -252,10 +229,6 @@ return 1 on success or 0 for an suspended file. */
int OTF_FileManager_touchFile( OTF_FileManager* m, OTF_File* file ) {
/*
OTF_fprintf( stderr, "OTF_FileManager_touchFile()\n" );
*/
if ( OTF_FILESTATUS_ACTIVE != OTF_File_status( file ) ) {
return 0;
@ -275,15 +248,11 @@ internally. return 1 on success, 0 otherwise. */
int OTF_FileManager_suspendFile( OTF_FileManager* m, OTF_File* file ) {
/*
OTF_fprintf( stderr, "OTF_FileManager_suspendFile()\n" );
*/
if ( OTF_FILESTATUS_ACTIVE != OTF_File_status( file ) ) {
/* file not open, so cannot be suspended */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"file to be suspended is not open.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -292,16 +261,13 @@ int OTF_FileManager_suspendFile( OTF_FileManager* m, OTF_File* file ) {
if ( 0 == OTF_FileManager_listUnlinkAtTail( &(m->list), file ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"could not unlink this entry.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 0;
};
/*
OTF_fprintf( stderr, " c-- %u -> %u\n", m->count, m->count-1 );
*/
m->count--;
OTF_File_suspend( file );
@ -316,7 +282,7 @@ int OTF_FileManager_listInsertAtHead( OTF_FileList** list, OTF_File* entry ) {
OTF_FileList* newentry= (OTF_FileList*) malloc( sizeof(OTF_FileList) );
if( NULL == newentry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -325,30 +291,15 @@ int OTF_FileManager_listInsertAtHead( OTF_FileList** list, OTF_File* entry ) {
if ( NULL != (*list) ) {
/*
OTF_fprintf( stderr, "pre insert : %p --> %p (%p)\n",
*list, (*list)->next, (*list)->file );
*/
newentry->file= entry;
newentry->prev= (*list)->prev;
newentry->next= (*list);
/*
OTF_fprintf( stderr, "new entry : %p --> %p (%p)\n",
newentry, newentry->next, newentry->file );
*/
(*list)->prev->next= newentry;
(*list)->prev= newentry;
*list= newentry;
/*
OTF_fprintf( stderr, "post insert: %p --> %p (%p)\n",
*list, (*list)->next, (*list)->file );
*/
} else {
/* empty list */
@ -360,13 +311,6 @@ int OTF_FileManager_listInsertAtHead( OTF_FileList** list, OTF_File* entry ) {
*list= newentry;
}
/*
OTF_fprintf( stderr, "after OTF_FileManager_listInsertAtHead():\n" );
*/
/*
OTF_FileManager_listPrint( list );
*/
return 0;
}
@ -409,23 +353,10 @@ int OTF_FileManager_listUnlinkAtHead( OTF_FileList** list, OTF_File* file ) {
free( pos );
pos = NULL;
/*
OTF_fprintf( stderr, "after OTF_FileManager_listUnlinkAtHead() %p found:\n", file );
*/
/*
OTF_FileManager_listPrint( listHead, listTail );
*/
return 1;
}
/* not found */
/*
OTF_fprintf( stderr, "after OTF_FileManager_listUnlinkAtHead() %p not found:\n", file );
*/
/*
OTF_FileManager_listPrint( listHead, listTail );
*/
return 0;
}
@ -469,23 +400,10 @@ int OTF_FileManager_listUnlinkAtTail( OTF_FileList** list, OTF_File* file ) {
free( pos );
pos = NULL;
/*
OTF_fprintf( stderr, "after OTF_FileManager_listUnlinkAtHead() %p found:\n", file );
*/
/*
OTF_FileManager_listPrint( listHead, listTail );
*/
return 1;
}
/* not found */
/*
OTF_fprintf( stderr, "after OTF_FileManager_listUnlinkAtTail():\n" );
*/
/*
OTF_FileManager_listPrint( listHead, listTail );
*/
return 0;
}
@ -499,25 +417,25 @@ void OTF_FileManager_listPrint( OTF_FileList** list ) {
if ( NULL == *list ) {
OTF_fprintf( stderr, "empty list\n ----- \n" );
fprintf( stderr, "empty list\n ----- \n" );
return;
}
pos= *list;
OTF_fprintf( stderr, "head: %p --> %p (%p %u)\n", (void*)pos,
fprintf( stderr, "head: %p --> %p (%p %u)\n", (void*)pos,
(void*)pos->next, (void*)pos->file,
OTF_File_status( pos->file ) );
while ( pos != (*list)->prev ) {
pos= pos->next;
OTF_fprintf( stderr, " %p --> %p (%p %u)\n", (void*)pos,
fprintf( stderr, " %p --> %p (%p %u)\n", (void*)pos,
(void*)pos->next, (void*)pos->file,
OTF_File_status( pos->file ) );
}
OTF_fprintf( stderr, " ----- \n" );
fprintf( stderr, " ----- \n" );
}

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

@ -117,7 +117,7 @@ char* OTF_stripFilename( const char* filename ) {
if( NULL == p ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -132,7 +132,7 @@ char* OTF_stripFilename( const char* filename ) {
/* fail if the resulting filename is empty */
if ( '\0' == *ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"empty filename base.\n",
__FUNCTION__, __FILE__, __LINE__ );

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

@ -63,7 +63,7 @@ OTF_HandlerArray* OTF_HandlerArray_open() {
ret = (OTF_HandlerArray*) malloc( sizeof( OTF_HandlerArray ) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -74,7 +74,7 @@ OTF_HandlerArray* OTF_HandlerArray_open() {
OTF_NRECORDS * sizeof( OTF_FunctionPointer* ) );
if( NULL == ret->pointer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -87,7 +87,7 @@ OTF_HandlerArray* OTF_HandlerArray_open() {
ret->firsthandlerarg = (void**) malloc( OTF_NRECORDS * sizeof( void* ) );
if( NULL == ret->firsthandlerarg ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -110,7 +110,7 @@ int OTF_HandlerArray_close( OTF_HandlerArray* handlers ) {
if( NULL == handlers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"handlers have not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -132,7 +132,7 @@ int OTF_HandlerArray_setHandler( OTF_HandlerArray* handlers,
if( recordtype >= OTF_NRECORDS ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unknown record type %u.\n",
__FUNCTION__, __FILE__, __LINE__, recordtype );
@ -150,7 +150,7 @@ int OTF_HandlerArray_setFirstHandlerArg( OTF_HandlerArray* handlers,
if( recordtype >= OTF_NRECORDS ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unknown record type %u.\n",
__FUNCTION__, __FILE__, __LINE__, recordtype );
@ -268,18 +268,23 @@ int OTF_HandlerArray_getCopyHandler( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFKEYVALUE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefTimeRange,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefTimeRange,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefCounterAssignments,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefCounterAssignments,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_DefProcessSubstitutes,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, writer,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_NoOp,
@ -603,19 +608,24 @@ int OTF_HandlerArray_getCopyHandler_stream( OTF_HandlerArray* handlers,
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFKEYVALUE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefTimeRange,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefTimeRange,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFTIMERANGE_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefCounterAssignments,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefCounterAssignments,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_DefProcessSubstitutes,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, wstream,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) OTF_CopyHandler_stream_NoOp,
OTF_NOOP_RECORD );

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

@ -270,6 +270,14 @@ typedef int (OTF_Handler_DefCounterAssignments) ( void* userData,
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,
OTF_KeyValueList* list );
/* typedefs for OTF event records ****************************************** */
/* # OTF_NOOP_RECORD */

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

@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string.h>
uint8_t OTF_KeyValueList_getValue(OTF_KeyValueList *list, uint32_t key, OTF_Type otf_type, OTF_Value *otf_value);
OTF_KeyValueList *OTF_KeyValueList_new() {
@ -17,7 +18,7 @@ OTF_KeyValueList *OTF_KeyValueList_new() {
if (list == NULL) {
/* error: not enough memory left */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
return NULL;
@ -27,7 +28,7 @@ OTF_KeyValueList *OTF_KeyValueList_new() {
if (list->kvBegin == NULL) {
/* error: not enough memory left */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
free(list);
@ -46,7 +47,7 @@ OTF_KeyValueList *OTF_KeyValueList_new() {
if( OTF_KeyValueList_realloc(list, 9) ) {
/* an error ocurred while realloc */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -64,7 +65,7 @@ uint8_t OTF_KeyValueList_close(OTF_KeyValueList* list) {
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 1;
@ -92,7 +93,7 @@ uint8_t OTF_KeyValueList_reset(OTF_KeyValueList* list) {
if ( list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 1;
@ -137,7 +138,7 @@ uint8_t OTF_KeyValueList_realloc(OTF_KeyValueList* list, uint32_t num) {
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 1;
@ -176,7 +177,7 @@ uint8_t OTF_KeyValueList_appendPair(OTF_KeyValueList* list, OTF_KeyValuePair pai
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 255;
@ -201,7 +202,7 @@ uint8_t OTF_KeyValueList_appendPair(OTF_KeyValueList* list, OTF_KeyValuePair pai
/* an error ocurred while realloc */
if ( (list->size - list->count) < 1 ) {
/* if no memory left, return with error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -411,7 +412,7 @@ uint8_t OTF_KeyValueList_appendKeyValueList(OTF_KeyValueList *dest_list, OTF_Key
for( i = 0; i < source_list->count; i++ ) {
if ( 255 == OTF_KeyValueList_appendPair(dest_list, p->kvPair) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"error while appending OTF_KeyValueList.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -457,7 +458,7 @@ uint8_t OTF_KeyValueList_getValue(OTF_KeyValueList *list, uint32_t key, OTF_Type
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 255;
@ -482,258 +483,244 @@ uint8_t OTF_KeyValueList_getValue(OTF_KeyValueList *list, uint32_t key, OTF_Type
/* no key in list matches the searched key */
return 1;
}
uint8_t OTF_KeyValueList_getChar(OTF_KeyValueList *list, uint32_t key, char *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_CHAR, &otf_value)) ) {
*value = otf_value.otf_char;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getInt8(OTF_KeyValueList *list, uint32_t key, int8_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_INT8, &otf_value)) ) {
*value = otf_value.otf_int8;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getUint8(OTF_KeyValueList *list, uint32_t key, uint8_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_UINT8, &otf_value)) ) {
*value = otf_value.otf_uint8;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getInt16(OTF_KeyValueList *list, uint32_t key, int16_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_INT16, &otf_value)) ) {
*value = otf_value.otf_int16;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getUint16(OTF_KeyValueList *list, uint32_t key, uint16_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_UINT16, &otf_value)) ) {
*value = otf_value.otf_uint16;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getInt32(OTF_KeyValueList *list, uint32_t key, int32_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_INT32, &otf_value)) ) {
*value = otf_value.otf_int32;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getUint32(OTF_KeyValueList *list, uint32_t key, uint32_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_UINT32, &otf_value)) ) {
*value = otf_value.otf_uint32;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getInt64(OTF_KeyValueList *list, uint32_t key, int64_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_INT64, &otf_value)) ) {
*value = otf_value.otf_int64;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getUint64(OTF_KeyValueList *list, uint32_t key, uint64_t *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_UINT64, &otf_value)) ) {
*value = otf_value.otf_uint64;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getFloat(OTF_KeyValueList *list, uint32_t key, float *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_FLOAT, &otf_value)) ) {
*value = otf_value.otf_float;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getDouble(OTF_KeyValueList *list, uint32_t key, double *value) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_DOUBLE, &otf_value)) ) {
*value = otf_value.otf_double;
}
return ret;
return ret;
}
uint8_t OTF_KeyValueList_getByteArray(OTF_KeyValueList *list, uint32_t key, uint8_t *value, uint32_t *len) {
OTF_KeyValuePairList *p;
uint32_t i;
uint32_t max_len;
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 255;
}
p = list->kvBegin;
max_len = *len;
*len = 0;
OTF_KeyValuePairList *p;
uint32_t i;
uint32_t max_len;
/* search key */
for ( i=0; i<list->count; i++) {
if ( p->kvPair.key == key ) {
if ( p->kvPair.type == OTF_BYTE_ARRAY) {
if( p->kvPair.value.otf_byte_array.len <= OTF_KEYVALUE_MAX_ARRAY_LEN ) {
if( ( *len + p->kvPair.value.otf_byte_array.len ) > max_len ) {
/* allocated memory pointed by "value" is not big enough to store the howle byte array */
/* fill memory until the end and exit with an error-code */
memcpy(value, p->kvPair.value.otf_byte_array.array, max_len - *len);
*len = max_len;
return 255;
}
*len += p->kvPair.value.otf_byte_array.len;
memcpy(value, p->kvPair.value.otf_byte_array.array, p->kvPair.value.otf_byte_array.len);
/* end of byte array reached, all right */
return 0;
} else {
if( ( *len + OTF_KEYVALUE_MAX_ARRAY_LEN ) > max_len ) {
/* allocated memory pointed by "value" is not big enough to store the howle byte array */
/* fill memory until the end and exit with an error-code */
memcpy(value, p->kvPair.value.otf_byte_array.array, max_len - *len);
*len = max_len;
return 255;
}
*len += OTF_KEYVALUE_MAX_ARRAY_LEN;
memcpy(value, p->kvPair.value.otf_byte_array.array, OTF_KEYVALUE_MAX_ARRAY_LEN);
value += OTF_KEYVALUE_MAX_ARRAY_LEN;
}
} else {
/* type of found key differs */
return 2;
}
} else {
if( *len > 0 ) {
/* byte-array not completed */
return 255;
}
}
p = p->kvNext;
}
/* no key in list matches the searched key */
return 1;
if (list == NULL) {
/* error */
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
return 255;
}
p = list->kvBegin;
max_len = *len;
*len = 0;
/* search key */
for ( i=0; i<list->count; i++) {
if ( p->kvPair.key == key ) {
if ( p->kvPair.type == OTF_BYTE_ARRAY) {
if( p->kvPair.value.otf_byte_array.len <= OTF_KEYVALUE_MAX_ARRAY_LEN ) {
if( ( *len + p->kvPair.value.otf_byte_array.len ) > max_len ) {
/* allocated memory pointed by "value" is not big enough to store the howle byte array */
/* fill memory until the end and exit with an error-code */
memcpy(value, p->kvPair.value.otf_byte_array.array, max_len - *len);
*len = max_len;
return 255;
}
*len += p->kvPair.value.otf_byte_array.len;
memcpy(value, p->kvPair.value.otf_byte_array.array, p->kvPair.value.otf_byte_array.len);
/* end of byte array reached, all right */
return 0;
} else {
if( ( *len + OTF_KEYVALUE_MAX_ARRAY_LEN ) > max_len ) {
/* allocated memory pointed by "value" is not big enough to store the howle byte array */
/* fill memory until the end and exit with an error-code */
memcpy(value, p->kvPair.value.otf_byte_array.array, max_len - *len);
*len = max_len;
return 255;
}
*len += OTF_KEYVALUE_MAX_ARRAY_LEN;
memcpy(value, p->kvPair.value.otf_byte_array.array, OTF_KEYVALUE_MAX_ARRAY_LEN);
value += OTF_KEYVALUE_MAX_ARRAY_LEN;
}
} else {
/* type of found key differs */
return 2;
}
} else {
if( *len > 0 ) {
/* byte-array not completed */
return 255;
}
}
p = p->kvNext;
}
/* no key in list matches the searched key */
return 1;
}
uint8_t OTF_KeyValueList_getArrayLength(OTF_KeyValueList *list, uint32_t key, uint32_t *len) {
OTF_Value otf_value;
OTF_Value otf_value;
int ret;
if( ! (ret = OTF_KeyValueList_getValue(list, key, OTF_BYTE_ARRAY, &otf_value)) ) {
*len = otf_value.otf_byte_array.len;
}
return ret;
return ret;
}
OTF_Type OTF_KeyValueList_getTypeForKey(OTF_KeyValueList *list, uint32_t key) {
@ -743,7 +730,7 @@ OTF_Type OTF_KeyValueList_getTypeForKey(OTF_KeyValueList *list, uint32_t key) {
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -771,7 +758,7 @@ uint8_t OTF_KeyValueList_hasKey(OTF_KeyValueList *list, uint32_t key) {
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -800,7 +787,7 @@ uint8_t OTF_KeyValueList_removeKey(OTF_KeyValueList *list, uint32_t key) {
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -840,7 +827,7 @@ uint8_t OTF_KeyValueList_getKeyByIndex(OTF_KeyValueList *list, uint32_t index, u
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -884,7 +871,7 @@ uint8_t OTF_KeyValueList_getPairByIndex(OTF_KeyValueList *list, uint32_t index,
if (list == NULL) {
/* error */
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no list has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );

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

@ -137,6 +137,10 @@ the keywords identifying record types must follow some special rules:
#define OTF_KEYWORD_S_DEFCOUNTERASSIGNMENTS "CA"
#define OTF_KEYWORD_F_DEFCOUNTERASSIGNMENTS 'C'
#define OTF_KEYWORD_L_DEFPROCESSSUBSTITUTES "PROCESSSUBSTITUTES"
#define OTF_KEYWORD_S_DEFPROCESSSUBSTITUTES "PS"
#define OTF_KEYWORD_F_DEFPROCESSSUBSTITUTES 'P'
/* *** event record keywords *** */
#define OTF_KEYWORD_L_NOOP "NOOP"

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

@ -111,8 +111,10 @@ void OTF_MasterControl_finish( OTF_MasterControl* mc ) {
OTF_MasterControl_close( mc );
OTF_fprintf( stderr, "OTF_MasterControl_finish() deprecated, "
"use OTF_MasterControl_close() instead\n" );
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_finish() is deprecated, "
"use OTF_MasterControl_close() instead.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -137,12 +139,9 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
int r;
/* OTF_fprintf( stderr, "OTF_MasterControl_read()\n" ); */
if( NULL == mc ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"master control has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -159,7 +158,7 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
if ( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -169,7 +168,7 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
/*
if ( ! OTF_fileExists( filename ) ) {
OTF_fprintf( stderr, "ERROR in '%s'.c: "
OTF_Error( "ERROR in '%s'.c: "
"Invalid input file '%s'\n", __FUNCTION__, filename );
return 0;
}
@ -178,7 +177,7 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
buffer = OTF_RBuffer_open( filename, mc->manager );
if( NULL == buffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"could not open file \"%s\" for reading.\n",
__FUNCTION__, __FILE__, __LINE__, filename );
@ -190,8 +189,6 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
OTF_RBuffer_setSize( buffer, 1024 );
/* OTF_fprintf( stderr, "filename=%s\n", filename ); */
free( filename );
filename = NULL;
@ -210,20 +207,16 @@ int OTF_MasterControl_read( OTF_MasterControl* mc, const char* namestub ) {
continue;
}
/* OTF_fprintf( stderr ,"arg= %x\n", argument ); */
do {
value= OTF_RBuffer_readUint32( buffer );
/* OTF_fprintf( stderr ," v= %x\n", value ); */
r= OTF_MasterControl_append( mc, argument, value );
if ( 0 == r ) {
OTF_fprintf( stderr ,"OTF_MasterControl_read() "
"ERROR: appending (%u,%u)\n",
argument, value );
OTF_Error( "OTF_MasterControl_read() "
"ERROR: appending (%u,%u)\n",
argument, value );
}
} while ( OTF_RBuffer_testChar( buffer, ',' ) );
@ -247,7 +240,7 @@ OTF_MasterControl* OTF_MasterControl_new( OTF_FileManager* manager ) {
ret= (OTF_MasterControl*) malloc( sizeof(OTF_MasterControl) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -258,7 +251,7 @@ OTF_MasterControl* OTF_MasterControl_new( OTF_FileManager* manager ) {
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -288,7 +281,7 @@ OTF_MapEntry* OTF_MasterControl_insertMapEntry( OTF_MasterControl* mc,
mc->s * sizeof(OTF_MapEntry) );
if( NULL == mc->map ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -410,7 +403,7 @@ int OTF_MapEntry_insertValue( OTF_MapEntry* mc, uint32_t value ) {
mc->s * sizeof(uint32_t) );
if( NULL == mc->values ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -484,7 +477,7 @@ int OTF_MasterControl_insertRMapEntry( OTF_MasterControl* mc,
mc->rs * sizeof(OTF_Pair) );
if( NULL == mc->rmap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -542,7 +535,7 @@ int OTF_MasterControl_append( OTF_MasterControl* mc,
if ( 0 == argument || ((uint32_t) -1) == argument ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"invalid argument value %x.\n",
__FUNCTION__, __FILE__, __LINE__, argument );
@ -555,7 +548,7 @@ int OTF_MasterControl_append( OTF_MasterControl* mc,
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_insertRMapEntry() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -566,7 +559,7 @@ int OTF_MasterControl_append( OTF_MasterControl* mc,
entry = OTF_MasterControl_getMapEntry( mc, argument );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getMapEntry() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -607,16 +600,6 @@ uint32_t OTF_MasterControl_mapReverse( OTF_MasterControl* mc,
a= 0;
b= mc->rn;
/*
OTF_fprintf( stderr, "OTF_MasterControl_mapReverse\n" );
for ( c= a; c < b; ++c ) {
OTF_fprintf( stderr, " %u: %u\n",
mc->rmap[c].argument,
mc->rmap[c].value );
}
*/
if ( 0 >= mc->rn ) {
return 0;
@ -675,7 +658,7 @@ int OTF_MasterControl_write( OTF_MasterControl* mc, const char* namestub ) {
0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -685,7 +668,7 @@ int OTF_MasterControl_write( OTF_MasterControl* mc, const char* namestub ) {
buffer = OTF_WBuffer_open( filename, mc->manager );
if ( NULL == buffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_open( %s ) failed.\n",
__FUNCTION__, __FILE__, __LINE__, filename );
@ -742,7 +725,7 @@ int OTF_MasterControl_check( OTF_MasterControl* mc ) {
if ( mc->map[i].argument <= mc->map[i-1].argument ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"map not sorted at %u.\n",
__FUNCTION__, __FILE__, __LINE__, i );
@ -760,7 +743,7 @@ int OTF_MasterControl_check( OTF_MasterControl* mc ) {
if ( e->values[j] <= e->values[j-1] ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"map[%u] not sorted at %u.\n",
__FUNCTION__, __FILE__, __LINE__, i, j );
@ -774,7 +757,7 @@ int OTF_MasterControl_check( OTF_MasterControl* mc ) {
if ( mc->rmap[i].argument <= mc->rmap[i-1].argument ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"rmap not sorted at %u.\n",
__FUNCTION__, __FILE__, __LINE__, i );
@ -794,25 +777,25 @@ void OTF_MasterControl_print( OTF_MasterControl* mc ) {
OTF_MapEntry* e;
OTF_fprintf( stderr, "map:\n" );
fprintf( stderr, "map:\n" );
for ( i= 0; i < mc->n; i++ ) {
e= &(mc->map[i]);
OTF_fprintf( stderr, "%x: ", e->argument );
fprintf( stderr, "%x: ", e->argument );
for ( j= 0; j < e->n; j++ ) {
OTF_fprintf( stderr, "%x ", e->values[j] );
fprintf( stderr, "%x ", e->values[j] );
}
OTF_fprintf( stderr, "\n" );
fprintf( stderr, "\n" );
}
OTF_fprintf( stderr, "rmap:\n" );
fprintf( stderr, "rmap:\n" );
for ( i= 0; i < mc->rn; i++ ) {
OTF_fprintf( stderr, "%x: %x\n",
fprintf( stderr, "%x: %x\n",
mc->rmap[i].argument, mc->rmap[i].value );
}
}

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

@ -125,11 +125,13 @@ int OTF_Reader_readDefKeyValue( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid );
int OTF_Reader_readDefTimeRange( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid );
OTF_HandlerArray* handlers, uint32_t streamid );
int OTF_Reader_readDefCounterAssignments( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid );
OTF_HandlerArray* handlers, uint32_t streamid );
int OTF_Reader_readDefProcessSubstitutes( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid );
/* *** Event records *** ****************************************** */
@ -671,11 +673,11 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
return OTF_Reader_readDefCounter( buffer, handlers, streamid );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFCOUNTERASSIGNMENTS ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFCOUNTERASSIGNMENTS ) ) {
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFCOUNTERASSIGNMENTS ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFCOUNTERASSIGNMENTS ) ) {
return OTF_Reader_readDefCounterAssignments( buffer, handlers, streamid );
}
return OTF_Reader_readDefCounterAssignments( buffer, handlers, streamid );
}
break;
@ -733,6 +735,14 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
/* case OTF_KEYWORD_F_DEFPROCESS 'P' : */
case OTF_KEYWORD_F_DEFPROCESSGROUP /* 'P' */ :
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_DEFPROCESSORGROUPATTR ) ||
OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_L_DEFPROCESSORGROUPATTR ) ) {
return OTF_Reader_readDefProcessOrGroupAttributes( buffer, handlers, streamid );
}
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_DEFPROCESSGROUP ) ||
OTF_RBuffer_testKeyword( buffer,
@ -748,11 +758,11 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
}
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_DEFPROCESSORGROUPATTR ) ||
OTF_KEYWORD_S_DEFPROCESSSUBSTITUTES ) ||
OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_L_DEFPROCESSORGROUPATTR ) ) {
OTF_KEYWORD_L_DEFPROCESSSUBSTITUTES ) ) {
return OTF_Reader_readDefProcessOrGroupAttributes( buffer, handlers, streamid );
return OTF_Reader_readDefProcessSubstitutes( buffer, handlers, streamid );
}
break;
@ -785,11 +795,11 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
return OTF_Reader_readDefTimerResolution( buffer, handlers, streamid );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFTIMERANGE ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFTIMERANGE ) ) {
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_DEFTIMERANGE ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_DEFTIMERANGE ) ) {
return OTF_Reader_readDefTimeRange( buffer, handlers, streamid );
}
return OTF_Reader_readDefTimeRange( buffer, handlers, streamid );
}
break;
@ -1385,7 +1395,7 @@ int OTF_Reader_readDefProcessOrGroupAttributes( OTF_RBuffer* buffer,
uint32_t proc_token;
uint32_t attr_token;
if ( handlers->pointer[OTF_DEFATTRLIST_RECORD] == NULL ) {
if ( handlers->pointer[OTF_DEFPROCESSORGROUPATTR_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
@ -2235,103 +2245,154 @@ int OTF_Reader_readDefKeyValue( OTF_RBuffer* buffer,
}
}
int OTF_Reader_readDefTimeRange( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid ) {
int OTF_Reader_readDefTimeRange( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
uint64_t minTime;
uint64_t maxTime;
if ( handlers->pointer[OTF_DEFTIMERANGE_RECORD] == NULL ) {
uint64_t minTime;
uint64_t maxTime;
return OTF_RBuffer_readNewline( buffer );
}
if ( handlers->pointer[OTF_DEFTIMERANGE_RECORD] == NULL ) {
minTime= OTF_RBuffer_readUint64( buffer );
return OTF_RBuffer_readNewline( buffer );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_TIME ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_TIME ) ) {
minTime= OTF_RBuffer_readUint64( buffer );
maxTime= OTF_RBuffer_readUint64( buffer );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_TIME ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_TIME ) ) {
} else {
maxTime= OTF_RBuffer_readUint64( buffer );
PARSE_ERROR( buffer );
} else {
return 0;
}
PARSE_ERROR( buffer );
if ( OTF_RBuffer_readNewline( buffer ) ) {
return 0;
}
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
if ( OTF_RBuffer_readNewline( buffer ) ) {
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefTimeRange*)
handlers->pointer[OTF_DEFTIMERANGE_RECORD] )
( handlers->firsthandlerarg[OTF_DEFTIMERANGE_RECORD],
streamid,
minTime,
maxTime,
buffer->list ) ) );
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
} else {
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefTimeRange*)
handlers->pointer[OTF_DEFTIMERANGE_RECORD] )
( handlers->firsthandlerarg[OTF_DEFTIMERANGE_RECORD],
streamid,
minTime,
maxTime,
buffer->list ) ) );
PARSE_ERROR( buffer );
} else {
return 0;
}
PARSE_ERROR( buffer );
return 0;
}
}
int OTF_Reader_readDefCounterAssignments( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers,
uint32_t streamid ) {
int OTF_Reader_readDefCounterAssignments( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
uint32_t counter;
uint32_t number_of_members;
if ( handlers->pointer[OTF_DEFCOUNTERASSIGNMENTS_RECORD] == NULL ) {
uint32_t counter;
uint32_t number_of_members;
return OTF_RBuffer_readNewline( buffer );
}
if ( handlers->pointer[OTF_DEFCOUNTERASSIGNMENTS_RECORD] == NULL ) {
counter= OTF_RBuffer_readUint32( buffer );
return OTF_RBuffer_readNewline( buffer );
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_MEMBERS ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_MEMBERS ) ) {
counter= OTF_RBuffer_readUint32( buffer );
number_of_members= OTF_RBuffer_readArray( buffer,
&buffer->array,
&buffer->arraysize );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_MEMBERS ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_MEMBERS ) ) {
} else {
number_of_members= OTF_RBuffer_readArray( buffer,
&buffer->array,
&buffer->arraysize );
PARSE_ERROR( buffer );
} else {
return 0;
}
PARSE_ERROR( buffer );
if ( OTF_RBuffer_readNewline( buffer ) ) {
return 0;
}
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
if ( OTF_RBuffer_readNewline( buffer ) ) {
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefCounterAssignments*)
handlers->pointer[OTF_DEFCOUNTERASSIGNMENTS_RECORD] )
( handlers->firsthandlerarg[OTF_DEFCOUNTERASSIGNMENTS_RECORD],
streamid,
counter,
number_of_members,
buffer->array,
buffer->list ) ) );
/* 0 is considered as the non-error return value of call-back handlers,
but the current function returns 0 on errors! */
} else {
return ( OTF_RETURN_OK /*0*/ == ( (
(OTF_Handler_DefCounterAssignments*)
handlers->pointer[OTF_DEFCOUNTERASSIGNMENTS_RECORD] )
( handlers->firsthandlerarg[OTF_DEFCOUNTERASSIGNMENTS_RECORD],
streamid,
counter,
number_of_members,
buffer->array,
buffer->list ) ) );
PARSE_ERROR( buffer );
} else {
return 0;
}
PARSE_ERROR( buffer );
return 0;
}
}
int OTF_Reader_readDefProcessSubstitutes( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
uint32_t representative;
uint32_t number_of_procs;
if ( handlers->pointer[OTF_DEFPROCESSSUBSTITUTES_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buffer );
}
representative= OTF_RBuffer_readUint32( buffer );
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_MEMBERS ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_MEMBERS ) ) {
number_of_procs= OTF_RBuffer_readArray( buffer,
&buffer->array,
&buffer->arraysize );
} 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_DefProcessSubstitutes*)
handlers->pointer[OTF_DEFPROCESSSUBSTITUTES_RECORD] )
( handlers->firsthandlerarg[OTF_DEFPROCESSSUBSTITUTES_RECORD],
streamid,
representative,
number_of_procs,
buffer->array,
buffer->list ) ) );
} else {
PARSE_ERROR( buffer );
return 0;
}
}
/* *** Event records *** ****************************************** */

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

@ -195,7 +195,7 @@ OTF_RBuffer* OTF_RBuffer_open( const char* filename, OTF_FileManager* manager )
/* Check the input parameters */
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been defined.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -205,7 +205,7 @@ OTF_RBuffer* OTF_RBuffer_open( const char* filename, OTF_FileManager* manager )
ret= (OTF_RBuffer*) malloc( sizeof(OTF_RBuffer) );
if ( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -219,7 +219,7 @@ OTF_RBuffer* OTF_RBuffer_open( const char* filename, OTF_FileManager* manager )
if ( NULL == ret->file ) {
/* *** commented because it can happen when defstream cannot be loaded
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_open() failed. filename '%s'\n",
__FUNCTION__, __FILE__, __LINE__, filename );
*/
@ -260,7 +260,7 @@ OTF_RBuffer* OTF_RBuffer_open_with_external_buffer( uint32_t len, const char* bu
ret= (OTF_RBuffer*) malloc( sizeof(OTF_RBuffer) );
if ( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -273,7 +273,7 @@ OTF_RBuffer* OTF_RBuffer_open_with_external_buffer( uint32_t len, const char* bu
if ( NULL == ret->file ) {
/* *** commented because it can happen when defstream cannot be loaded
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_open() failed. filename '%s'\n",
__FUNCTION__, __FILE__, __LINE__, filename );
*/
@ -331,7 +331,7 @@ int OTF_RBuffer_setSize( OTF_RBuffer* rbuffer, size_t size ) {
if ( size < 100 ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"buffer size %u too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) size );
@ -340,7 +340,7 @@ int OTF_RBuffer_setSize( OTF_RBuffer* rbuffer, size_t size ) {
if ( size < rbuffer->size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot shrink buffer from %u to %u.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) rbuffer->size,
(uint32_t) size );
@ -353,7 +353,7 @@ int OTF_RBuffer_setSize( OTF_RBuffer* rbuffer, size_t size ) {
rbuffer->size * sizeof(char) );
if( NULL == rbuffer->buffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -376,7 +376,7 @@ void OTF_RBuffer_setZBufferSize( OTF_RBuffer* rbuffer, uint32_t size ) {
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -384,13 +384,13 @@ void OTF_RBuffer_setZBufferSize( OTF_RBuffer* rbuffer, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
}
@ -410,7 +410,7 @@ int OTF_RBuffer_setJumpSize( OTF_RBuffer* rbuffer, size_t size ) {
if ( size < 100 ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"jump buffer size %u too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) size );
@ -419,7 +419,7 @@ int OTF_RBuffer_setJumpSize( OTF_RBuffer* rbuffer, size_t size ) {
if ( size > rbuffer->size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"buffer size is smaller than jump size %u.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) size );
@ -489,7 +489,7 @@ int OTF_RBuffer_guaranteeRecord( OTF_RBuffer* rbuffer ) {
/* no complete record available! end of file. */
/*
OTF_fprintf( stderr, "OTF_RBuffer_guaranteeRecord() "
OTF_Error( "OTF_RBuffer_guaranteeRecord() "
"cannot read, file exceeded\n" );
*/
@ -511,16 +511,11 @@ int OTF_RBuffer_guaranteeRecord( OTF_RBuffer* rbuffer ) {
while ( 1024*1024*100 > rbuffer->size ) {
/*
OTF_fprintf( stderr, "OTF_RBuffer_guaranteeRecord() double buffer size "
"%u -> %u!\n", rbuffer->size, 2* rbuffer->size );
*/
ret= OTF_RBuffer_setSize( rbuffer, 2* rbuffer->size );
if ( 1 != ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot double buffer size.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -530,7 +525,7 @@ int OTF_RBuffer_guaranteeRecord( OTF_RBuffer* rbuffer ) {
add= OTF_RBuffer_advance( rbuffer );
if ( 0 == add ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"file exceeded.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -544,7 +539,7 @@ int OTF_RBuffer_guaranteeRecord( OTF_RBuffer* rbuffer ) {
}
}
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"buffer is too small. Extending buffer has finally failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -568,7 +563,7 @@ char *OTF_RBuffer_printRecord( OTF_RBuffer* rbuffer ) {
ret= (char*) realloc( ret, size + REALLOCSIZE );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -599,7 +594,7 @@ size_t OTF_RBuffer_advance( OTF_RBuffer* rbuffer ) {
if ( 0 == rbuffer->size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"buffer size not set!\n",
__FUNCTION__, __FILE__, __LINE__ );
exit(1);
@ -607,7 +602,7 @@ size_t OTF_RBuffer_advance( OTF_RBuffer* rbuffer ) {
if( rbuffer->pos > rbuffer->end ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current position exceeds the file length.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -660,13 +655,11 @@ int OTF_RBuffer_jump( OTF_RBuffer* rbuffer, uint64_t filepos ) {
/* uint64_t currentPos; */
uint32_t i;
/* OTF_fprintf( stderr, "\tjump to %llu\n", (unsigned long long) filepos ); */
ret= OTF_File_seek( rbuffer->file, filepos );
if ( 0 != ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_seek() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -697,7 +690,7 @@ int OTF_RBuffer_jump( OTF_RBuffer* rbuffer, uint64_t filepos ) {
if ( 0 == OTF_RBuffer_guaranteeRecord( rbuffer ) ) {
/*
OTF_fprintf( stderr, "OTF_RBuffer_jump() "
OTF_Error( "OTF_RBuffer_jump() "
"ERROR: could not read far enough\n" );
*/
@ -715,7 +708,7 @@ int OTF_RBuffer_jump( OTF_RBuffer* rbuffer, uint64_t filepos ) {
if ( 0 == OTF_RBuffer_guaranteeRecord( rbuffer ) ) {
/*
OTF_fprintf( stderr, "OTF_RBuffer_jump() "
OTF_Error( "OTF_RBuffer_jump() "
"ERROR: could not read far enough\n" );
*/
@ -736,7 +729,7 @@ int OTF_RBuffer_jump( OTF_RBuffer* rbuffer, uint64_t filepos ) {
if ( 0 == OTF_RBuffer_guaranteeRecord( rbuffer ) ) {
/*
OTF_fprintf( stderr, "OTF_RBuffer_jump() "
OTF_Error( "OTF_RBuffer_jump() "
"ERROR: could not read far enough\n" );
*/
return 0;
@ -761,7 +754,7 @@ int OTF_RBuffer_jump( OTF_RBuffer* rbuffer, uint64_t filepos ) {
if ( 0 == OTF_RBuffer_guaranteeRecord( rbuffer ) ) {
/*
OTF_fprintf( stderr, "OTF_RBuffer_jump() "
OTF_Error( "OTF_RBuffer_jump() "
"ERROR: could not read far enough\n" );
*/
@ -821,7 +814,10 @@ uint64_t OTF_RBuffer_getCurrentTime( OTF_RBuffer* rbuffer ) {
if ( rbuffer->time == (uint64_t) -1 ) {
OTF_fprintf( stderr, "Warning: Invalid time\n" );
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"Invalid time.",
__FUNCTION__, __FILE__, __LINE__ );
}
return rbuffer->time;
@ -1024,10 +1020,6 @@ int OTF_RBuffer_getFileProperties( OTF_RBuffer* rbuffer ) {
}
/*
OTF_fprintf( stderr, "search min/max time\n" );
*/
/* get very first timestamp easily */
rbuffer->firstTime= rbuffer->time;
@ -1037,7 +1029,7 @@ int OTF_RBuffer_getFileProperties( OTF_RBuffer* rbuffer ) {
searchRange= ( SEARCH_RANGE < rbuffer->size ) ? SEARCH_RANGE : rbuffer->size;
if( 0 >= searchRange ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the search range is not allowed to be '0'.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1053,7 +1045,6 @@ int OTF_RBuffer_getFileProperties( OTF_RBuffer* rbuffer ) {
( pos > searchRange ) ) {
pos= pos - searchRange;
OTF_fprintf( stderr, " jumppos: %llu\n", (long long unsigned) pos );
}*/
while ( ( !OTF_RBuffer_jump( rbuffer, pos ) ) &&
( pos > 0 ) ) {
@ -1102,7 +1093,7 @@ int OTF_RBuffer_searchTime( OTF_RBuffer* rbuffer, uint64_t time ) {
if ( 0 == OTF_RBuffer_getFileProperties( rbuffer ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"could not determine file size (%llu) or first/last time"
" (%llx/%llx)\n",
__FUNCTION__, __FILE__, __LINE__,
@ -1126,7 +1117,7 @@ int OTF_RBuffer_searchTime( OTF_RBuffer* rbuffer, uint64_t time ) {
ret= OTF_RBuffer_jump( rbuffer, posA );
if ( 1 != ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unsuccessful jump to begin pos= %llu.\n",
__FUNCTION__, __FILE__, __LINE__, (unsigned long long) posA );
@ -1184,7 +1175,7 @@ int OTF_RBuffer_searchTime( OTF_RBuffer* rbuffer, uint64_t time ) {
ret= OTF_RBuffer_jump( rbuffer, posA );
if ( 1 != ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unsuccessful jump to begin pos= %llu.\n",
__FUNCTION__, __FILE__, __LINE__, (unsigned long long) posA );
@ -1197,7 +1188,7 @@ int OTF_RBuffer_searchTime( OTF_RBuffer* rbuffer, uint64_t time ) {
ret2= OTF_RBuffer_getRecord( rbuffer );
if( NULL == ret2 ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_getRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1429,30 +1420,30 @@ uint32_t OTF_RBuffer_readKeyValueList(OTF_RBuffer* buffer ) {
break;
case OTF_BYTE_ARRAY:
pair.value.otf_byte_array.len = OTF_RBuffer_readBytes( buffer,
pair.value.otf_byte_array.array, OTF_KEYVALUE_MAX_ARRAY_LEN);
if( pair.value.otf_byte_array.len > OTF_KEYVALUE_MAX_ARRAY_LEN ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
"byte-array exceeds the maximum length of %u bytes per line.\n",
__FUNCTION__, __FILE__, __LINE__, OTF_KEYVALUE_MAX_ARRAY_LEN );
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_LENGTH ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_LENGTH ) ) {
pair.value.otf_byte_array.array, OTF_KEYVALUE_MAX_ARRAY_LEN);
pair.value.otf_byte_array.len = OTF_RBuffer_readUint32( buffer );
if( pair.value.otf_byte_array.len > OTF_KEYVALUE_MAX_ARRAY_LEN ) {
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"byte-array exceeds the maximum length of %u bytes per line.\n",
__FUNCTION__, __FILE__, __LINE__, OTF_KEYVALUE_MAX_ARRAY_LEN );
PARSE_ERROR( buffer );
return 0;
}
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LOCAL_LENGTH ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LOCAL_LENGTH ) ) {
pair.value.otf_byte_array.len = OTF_RBuffer_readUint32( buffer );
}
}
break;
default:
/* Pasre error */
PARSE_ERROR( buffer );
@ -1460,7 +1451,7 @@ uint32_t OTF_RBuffer_readKeyValueList(OTF_RBuffer* buffer ) {
}
} else {
/* Parse error */
PARSE_ERROR( buffer );

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

@ -29,7 +29,7 @@
/* *** some macros *** ****************************************** */
#define PARSE_ERROR( buffer ) \
OTF_fprintf( stderr, "parse error in %s() %s:%u : %s\n", \
OTF_Error( "Parse error in function %s, file: %s, line: %i:\n %s\n", \
__FUNCTION__, __FILE__, __LINE__, OTF_RBuffer_printRecord( buffer ) );

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

@ -72,7 +72,7 @@ int OTF_RStream_finish( OTF_RStream* rstream ) {
ret &= tmpret;
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot close defbuffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -85,7 +85,7 @@ int OTF_RStream_finish( OTF_RStream* rstream ) {
ret &= tmpret;
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot close event buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -99,7 +99,7 @@ int OTF_RStream_finish( OTF_RStream* rstream ) {
ret &= tmpret;
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot close snapshots buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -113,7 +113,7 @@ int OTF_RStream_finish( OTF_RStream* rstream ) {
ret &= tmpret;
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot close statistics buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -127,7 +127,7 @@ int OTF_RStream_finish( OTF_RStream* rstream ) {
ret &= tmpret;
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot close defbuffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -147,7 +147,7 @@ OTF_RStream* OTF_RStream_open( const char* namestub, uint32_t id, OTF_FileManage
/* Check the input parameters */
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -157,7 +157,7 @@ OTF_RStream* OTF_RStream_open( const char* namestub, uint32_t id, OTF_FileManage
ret= (OTF_RStream*) malloc( sizeof(OTF_RStream) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -184,7 +184,7 @@ int OTF_RStream_close( OTF_RStream* rstream ) {
if( NULL == rstream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"rstream has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -212,7 +212,7 @@ OTF_RBuffer* OTF_RStream_getDefBuffer( OTF_RStream* rstream ) {
rstream->id, OTF_FILETYPE_DEF, 0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -266,7 +266,7 @@ int OTF_RStream_closeDefBuffer( OTF_RStream* rstream ) {
ret&= OTF_RBuffer_close( rstream->defBuffer );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing defbuffer failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -291,7 +291,7 @@ OTF_RBuffer* OTF_RStream_getEventBuffer( OTF_RStream* rstream ) {
rstream->id, OTF_FILETYPE_EVENT, 0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed for event file with name stub '%s' and ID %u.\n",
__FUNCTION__, __FILE__, __LINE__, rstream->namestub, rstream->id );
@ -305,7 +305,7 @@ OTF_RBuffer* OTF_RStream_getEventBuffer( OTF_RStream* rstream ) {
if ( NULL == rstream->eventBuffer ) {
/* *** commented because it can happen when file not exists
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_open() failed for filename '%s'.\n",
__FUNCTION__, __FILE__, __LINE__, filename );
*/
@ -333,7 +333,7 @@ int OTF_RStream_closeEventBuffer( OTF_RStream* rstream ) {
ret&= OTF_RBuffer_close( rstream->eventBuffer );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing event buffer failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -357,7 +357,7 @@ OTF_RBuffer* OTF_RStream_getSnapsBuffer( OTF_RStream* rstream ) {
rstream->id, OTF_FILETYPE_SNAPS, 0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -393,7 +393,7 @@ int OTF_RStream_closeSnapsBuffer( OTF_RStream* rstream ) {
ret&= OTF_RBuffer_close( rstream->snapsBuffer );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing snapshots buffer failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -417,7 +417,7 @@ OTF_RBuffer* OTF_RStream_getStatsBuffer( OTF_RStream* rstream ) {
rstream->id, OTF_FILETYPE_STATS, 0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -454,7 +454,7 @@ int OTF_RStream_closeStatsBuffer( OTF_RStream* rstream ) {
ret&= OTF_RBuffer_close( rstream->statsBuffer );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing statistics buffer failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -478,7 +478,7 @@ OTF_RBuffer* OTF_RStream_getMarkerBuffer( OTF_RStream* rstream ) {
rstream->id, OTF_FILETYPE_MARKER, 0, NULL );
if( NULL == filename ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_getFilename() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -514,7 +514,7 @@ int OTF_RStream_closeMarkerBuffer( OTF_RStream* rstream ) {
ret&= OTF_RBuffer_close( rstream->markerBuffer );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"closing defbuffer failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -532,7 +532,7 @@ void OTF_RStream_setBufferSizes( OTF_RStream* rstream, uint32_t size ) {
if ( 50 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended buffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -540,13 +540,13 @@ void OTF_RStream_setBufferSizes( OTF_RStream* rstream, uint32_t size ) {
} else if ( 500 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -570,7 +570,7 @@ void OTF_RStream_setZBufferSizes( OTF_RStream* rstream, uint32_t size ) {
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -578,13 +578,13 @@ void OTF_RStream_setZBufferSizes( OTF_RStream* rstream, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -612,7 +612,7 @@ void OTF_RStream_setRecordLimit( OTF_RStream* rstream, uint64_t limit ) {
if( limit == OTF_READ_ERROR ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"limit cannot be set to %llu. Reset to OTF_READ_MAXRECORDS.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) limit );
@ -651,7 +651,7 @@ uint64_t OTF_RStream_readDefinitions( OTF_RStream* rstream, OTF_HandlerArray* ha
if ( NULL == rstream->defBuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no def buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -716,7 +716,7 @@ uint64_t OTF_RStream_readEvents( OTF_RStream* rstream, OTF_HandlerArray* handler
rstream->eventBuffer= OTF_RStream_getEventBuffer( rstream );
if( NULL == rstream->eventBuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no event buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -745,7 +745,7 @@ uint64_t OTF_RStream_readEvents( OTF_RStream* rstream, OTF_HandlerArray* handler
if ( oldtime > currenttime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time does decrease!!! %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) currenttime,
@ -802,7 +802,7 @@ uint64_t OTF_RStream_readSnapshots( OTF_RStream* rstream, OTF_HandlerArray* hand
rstream->snapsBuffer= OTF_RStream_getSnapsBuffer( rstream );
if( NULL == rstream->snapsBuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no snapshots buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -831,7 +831,7 @@ uint64_t OTF_RStream_readSnapshots( OTF_RStream* rstream, OTF_HandlerArray* hand
if ( oldtime > currenttime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time does decrease!!! %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) currenttime,
@ -888,7 +888,7 @@ uint64_t OTF_RStream_readStatistics( OTF_RStream* rstream, OTF_HandlerArray* han
rstream->statsBuffer= OTF_RStream_getStatsBuffer( rstream );
if( NULL == rstream->statsBuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no statistics buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -917,7 +917,7 @@ uint64_t OTF_RStream_readStatistics( OTF_RStream* rstream, OTF_HandlerArray* han
if ( oldtime > currenttime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time does decrease!!! %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) currenttime,
@ -972,7 +972,7 @@ uint64_t OTF_RStream_readMarker( OTF_RStream* rstream, OTF_HandlerArray* handler
if ( NULL == rstream->markerBuffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"the stream has no def buffer.\n",
__FUNCTION__, __FILE__, __LINE__ );

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

@ -190,7 +190,7 @@ int OTF_ProcessList_init( OTF_ProcessList* list, OTF_MasterControl* mc ) {
n= OTF_MasterControl_getrCount( mc );
if ( 0 >= n ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no process has been defined in the master control.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -202,7 +202,7 @@ int OTF_ProcessList_init( OTF_ProcessList* list, OTF_MasterControl* mc ) {
list->processes= (uint32_t*) malloc( n * sizeof(uint32_t) );
if( NULL == list->processes ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -212,7 +212,7 @@ int OTF_ProcessList_init( OTF_ProcessList* list, OTF_MasterControl* mc ) {
list->status= (uint8_t*) malloc( n * sizeof(uint8_t) );
if( NULL == list->status ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -228,7 +228,7 @@ int OTF_ProcessList_init( OTF_ProcessList* list, OTF_MasterControl* mc ) {
pair= OTF_MasterControl_getREntryByIndex( mc, i );
if( NULL == pair ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getREntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -259,7 +259,7 @@ int OTF_ProcessList_init( OTF_ProcessList* list, OTF_MasterControl* mc ) {
if ( 1 != test ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"process list from MasterControl is not sorted.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -425,7 +425,7 @@ int OTF_Heap_initEventHeap( OTF_Heap* heap, OTF_Reader* reader ) {
heap->buffers= (OTF_RBuffer**) malloc( heap->s * sizeof(OTF_RBuffer*) );
if( NULL == heap->buffers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -437,7 +437,7 @@ int OTF_Heap_initEventHeap( OTF_Heap* heap, OTF_Reader* reader ) {
entry= OTF_MasterControl_getEntryByIndex( reader->mc, i );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getEntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -461,7 +461,7 @@ int OTF_Heap_initEventHeap( OTF_Heap* heap, OTF_Reader* reader ) {
stream= OTF_Reader_getStream( reader, entry->argument );
if( NULL == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot get stream '%llu'\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) entry->argument );
@ -480,7 +480,7 @@ int OTF_Heap_initEventHeap( OTF_Heap* heap, OTF_Reader* reader ) {
} else {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot open event buffer of stream %u.\n",
__FUNCTION__, __FILE__, __LINE__, entry->argument );
@ -520,7 +520,7 @@ int OTF_Heap_initDefHeap( OTF_Heap* heap, OTF_Reader* reader ) {
heap->buffers= (OTF_RBuffer**) malloc( heap->s * sizeof(OTF_RBuffer*) );
if( NULL == heap->buffers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -547,7 +547,7 @@ int OTF_Heap_initDefHeap( OTF_Heap* heap, OTF_Reader* reader ) {
entry= OTF_MasterControl_getEntryByIndex( reader->mc, i );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getEntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -570,7 +570,7 @@ int OTF_Heap_initDefHeap( OTF_Heap* heap, OTF_Reader* reader ) {
stream= OTF_Reader_getStream( reader, entry->argument );
if( NULL == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot get stream '%llu'\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) entry->argument );
@ -613,7 +613,7 @@ int OTF_Heap_initStatisticsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
heap->buffers= (OTF_RBuffer**) malloc( heap->s * sizeof(OTF_RBuffer*) );
if( NULL == heap->buffers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -625,7 +625,7 @@ int OTF_Heap_initStatisticsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
entry= OTF_MasterControl_getEntryByIndex( reader->mc, i );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getEntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -649,7 +649,7 @@ int OTF_Heap_initStatisticsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
stream= OTF_Reader_getStream( reader, entry->argument );
if( NULL == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot get stream '%llu'\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) entry->argument );
@ -698,7 +698,7 @@ int OTF_Heap_initSnapshotsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
heap->buffers= (OTF_RBuffer**) malloc( heap->s * sizeof(OTF_RBuffer*) );
if( NULL == heap->buffers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -710,7 +710,7 @@ int OTF_Heap_initSnapshotsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
entry= OTF_MasterControl_getEntryByIndex( reader->mc, i );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getEntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -734,7 +734,7 @@ int OTF_Heap_initSnapshotsHeap( OTF_Heap* heap, OTF_Reader* reader ) {
stream= OTF_Reader_getStream( reader, entry->argument );
if( NULL == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot get stream '%llu'\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) entry->argument );
@ -783,7 +783,7 @@ int OTF_Heap_initMarkerHeap( OTF_Heap* heap, OTF_Reader* reader ) {
heap->buffers= (OTF_RBuffer**) malloc( heap->s * sizeof(OTF_RBuffer*) );
if( NULL == heap->buffers ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -810,7 +810,7 @@ int OTF_Heap_initMarkerHeap( OTF_Heap* heap, OTF_Reader* reader ) {
entry= OTF_MasterControl_getEntryByIndex( reader->mc, i );
if( NULL == entry ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_getEntryByIndex() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -833,7 +833,7 @@ int OTF_Heap_initMarkerHeap( OTF_Heap* heap, OTF_Reader* reader ) {
stream= OTF_Reader_getStream( reader, entry->argument );
if( NULL == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot get stream '%llu'\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) entry->argument );
@ -993,10 +993,10 @@ int OTF_Heap_checksorted( OTF_Heap* heap ) {
/*
OTF_fprintf( stderr, "%u-heap with %u entries:\n", HEAP_CHILDRENCOUNT, heap->n );
fprintf( stderr, "%u-heap with %u entries:\n", HEAP_CHILDRENCOUNT, heap->n );
for ( i= 0; i < heap->n; i++ ) {
OTF_fprintf( stderr, "%i: %llu\n", i, heap->buffers[i]->time );
fprintf( stderr, "%i: %llu\n", i, heap->buffers[i]->time );
}
*/
@ -1156,7 +1156,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
ret = (OTF_Reader*) malloc( sizeof( OTF_Reader ) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1169,7 +1169,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1184,7 +1184,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
ret->mc= OTF_MasterControl_new( manager );
if( NULL == ret->mc ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_new() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1199,7 +1199,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
read= OTF_MasterControl_read( ret->mc, ret->namestub );
if( 0 == read ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_read() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1213,7 +1213,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
ret->processList= (OTF_ProcessList*) malloc( sizeof(OTF_ProcessList) );
if( NULL == ret->processList ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1228,7 +1228,7 @@ OTF_Reader* OTF_Reader_open( const char* namestub, OTF_FileManager* manager ) {
if( 0 == OTF_ProcessList_init( ret->processList, ret->mc ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_ProcessList_init() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1249,7 +1249,7 @@ int OTF_Reader_close( OTF_Reader* reader ) {
int ret=1;
if( NULL == reader ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no reader has been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1269,7 +1269,7 @@ int OTF_Reader_setBufferSizes( OTF_Reader* reader, uint32_t size ) {
if ( 50 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended buffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -1277,20 +1277,20 @@ int OTF_Reader_setBufferSizes( OTF_Reader* reader, uint32_t size ) {
} else if ( 500 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
}
reader->buffersizes= size;
return 1;
}
@ -1309,7 +1309,7 @@ void OTF_Reader_setZBufferSizes( OTF_Reader* reader, uint32_t size ) {
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -1317,13 +1317,13 @@ void OTF_Reader_setZBufferSizes( OTF_Reader* reader, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
}
@ -1403,7 +1403,7 @@ OTF_RStream* OTF_Reader_getStream( OTF_Reader* reader, uint32_t id ) {
reader->n * sizeof( OTF_RStream* ) );
if( NULL == reader->stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1493,7 +1493,7 @@ uint64_t OTF_Reader_readDefinitions( OTF_Reader* reader,
reader->definitionHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->definitionHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1502,7 +1502,7 @@ uint64_t OTF_Reader_readDefinitions( OTF_Reader* reader,
if( 0 == OTF_Heap_initDefHeap( reader->definitionHeap, reader ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initDefHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1564,7 +1564,7 @@ uint64_t OTF_Reader_readDefinitions( OTF_Reader* reader,
handlers, streamId );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseDefRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1596,7 +1596,7 @@ uint64_t OTF_Reader_readDefinitions( OTF_Reader* reader,
handlers, streamId );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownDefRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1652,7 +1652,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
reader->eventHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->eventHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1661,7 +1661,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
if( 0 == OTF_Heap_initEventHeap( reader->eventHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initEventHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1717,7 +1717,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1754,7 +1754,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->eventHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->eventHeap->buffers[i]->time,
@ -1809,7 +1809,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
# ifdef OTF_DEBUG
if ( oldtime > reader->eventHeap->progressCurrent ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time decreases. %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) reader->eventHeap->progressCurrent,
@ -1862,7 +1862,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
ret= OTF_Reader_readUnknownRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1897,7 +1897,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
ret= OTF_Reader_parseEventRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseEventRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1929,7 +1929,7 @@ uint64_t OTF_Reader_readEvents( OTF_Reader* reader, OTF_HandlerArray* handlers )
ret= OTF_Reader_readUnknownRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1981,7 +1981,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
reader->eventHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->eventHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1990,7 +1990,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
if( 0 == OTF_Heap_initEventHeap( reader->eventHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initEventHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2046,7 +2046,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2083,7 +2083,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->eventHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->eventHeap->buffers[i]->time,
@ -2170,7 +2170,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
ret= OTF_Reader_readUnknownRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2204,7 +2204,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
ret= OTF_Reader_parseEventRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseEventRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2235,7 +2235,7 @@ uint64_t OTF_Reader_readEventsUnsorted( OTF_Reader* reader, OTF_HandlerArray* ha
ret= OTF_Reader_readUnknownRecord( reader->eventHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2293,7 +2293,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
reader->snapshotsHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->snapshotsHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2302,7 +2302,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
if( 0 == OTF_Heap_initSnapshotsHeap( reader->snapshotsHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2361,7 +2361,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2399,7 +2399,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->snapshotsHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->snapshotsHeap->buffers[i]->time,
@ -2454,7 +2454,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
# ifdef OTF_DEBUG
if ( oldtime > reader->snapshotsHeap->progressCurrent ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time does decrease. %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) reader->snapshotsHeap->progressCurrent,
@ -2508,7 +2508,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
ret= OTF_Reader_readUnknownRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2542,7 +2542,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
ret= OTF_Reader_parseSnapshotsRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseSnapshotsRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2573,7 +2573,7 @@ uint64_t OTF_Reader_readSnapshots( OTF_Reader* reader,
ret= OTF_Reader_readUnknownRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2625,7 +2625,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
reader->snapshotsHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->snapshotsHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2634,7 +2634,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
if( 0 == OTF_Heap_initSnapshotsHeap( reader->snapshotsHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initSnapshotsHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2690,7 +2690,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2727,7 +2727,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->snapshotsHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->snapshotsHeap->buffers[i]->time,
@ -2813,7 +2813,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
ret= OTF_Reader_readUnknownRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2847,7 +2847,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
ret= OTF_Reader_parseSnapshotsRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseSnapshotsRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2878,7 +2878,7 @@ uint64_t OTF_Reader_readSnapshotsUnsorted( OTF_Reader* reader, OTF_HandlerArray*
ret= OTF_Reader_readUnknownRecord( reader->snapshotsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2934,7 +2934,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
reader->statisticsHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->statisticsHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -2943,7 +2943,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
if( 0 == OTF_Heap_initStatisticsHeap( reader->statisticsHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initStatisticsHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3003,7 +3003,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
reader->statisticsHeap->buffers[i] );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3041,7 +3041,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->statisticsHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->statisticsHeap->buffers[i]->time,
@ -3097,7 +3097,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
# ifdef OTF_DEBUG
if ( oldtime > reader->statisticsHeap->progressCurrent ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"Time does decrease. %llu < %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long) reader->statisticsHeap->progressCurrent,
@ -3151,7 +3151,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
ret= OTF_Reader_readUnknownRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3185,7 +3185,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
ret= OTF_Reader_parseStatisticsRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseStatisticsRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3216,7 +3216,7 @@ uint64_t OTF_Reader_readStatistics( OTF_Reader* reader,
ret= OTF_Reader_readUnknownRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3271,7 +3271,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
reader->statisticsHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->statisticsHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3280,7 +3280,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
if( 0 == OTF_Heap_initStatisticsHeap( reader->statisticsHeap, reader) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initStatisticsHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3336,7 +3336,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_RBuffer_searchTime() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3373,7 +3373,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
/* inlined OTF_RBuffer_getCurrentTime() */
if( reader->statisticsHeap->buffers[i]->time < reader->minTime ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"current time %llu < mintime %llu.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) reader->statisticsHeap->buffers[i]->time,
@ -3459,7 +3459,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
ret= OTF_Reader_readUnknownRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3493,7 +3493,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
ret= OTF_Reader_parseStatisticsRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseStatisticsRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3524,7 +3524,7 @@ uint64_t OTF_Reader_readStatisticsUnsorted( OTF_Reader* reader, OTF_HandlerArray
ret= OTF_Reader_readUnknownRecord( reader->statisticsHeap->buffers[0], handlers );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3577,7 +3577,7 @@ uint64_t OTF_Reader_readMarkers( OTF_Reader* reader, OTF_HandlerArray* handlers
reader->markerHeap= (OTF_Heap*) malloc( sizeof(OTF_Heap) );
if( NULL == reader->markerHeap ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3586,7 +3586,7 @@ uint64_t OTF_Reader_readMarkers( OTF_Reader* reader, OTF_HandlerArray* handlers
if( 0 == OTF_Heap_initMarkerHeap( reader->markerHeap, reader ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Heap_initDefHeap() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3647,7 +3647,7 @@ uint64_t OTF_Reader_readMarkers( OTF_Reader* reader, OTF_HandlerArray* handlers
ret= OTF_Reader_parseMarkerRecord( reader->markerHeap->buffers[i], handlers, streamId );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_parseMarkerRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3678,7 +3678,7 @@ uint64_t OTF_Reader_readMarkers( OTF_Reader* reader, OTF_HandlerArray* handlers
ret= OTF_Reader_readUnknownMarkerRecord( reader->markerHeap->buffers[i], handlers, streamId );
if ( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Reader_readUnknownMarkerRecord() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -3731,7 +3731,7 @@ void OTF_Reader_setRecordLimit( OTF_Reader* reader, uint64_t limit ) {
if( limit == OTF_READ_ERROR ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"limit cannot be set to %llu. Reset to OTF_READ_MAXRECORDS.\n",
__FUNCTION__, __FILE__, __LINE__,
(long long unsigned) limit );

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

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

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

@ -55,7 +55,7 @@ int OTF_WBuffer_finish( OTF_WBuffer* wbuffer ) {
/* buffer shall be empty now */
if( 0 != wbuffer->pos ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"buffer is not empty (but is supposed to).\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -92,7 +92,7 @@ int OTF_WBuffer_close( OTF_WBuffer* wbuffer ) {
int tmpret= OTF_WBuffer_flush( wbuffer );
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_flush() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -101,7 +101,7 @@ int OTF_WBuffer_close( OTF_WBuffer* wbuffer ) {
tmpret= OTF_File_close( wbuffer->file );
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_close() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -110,7 +110,7 @@ int OTF_WBuffer_close( OTF_WBuffer* wbuffer ) {
tmpret= OTF_WBuffer_finish( wbuffer );
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_finish() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -130,7 +130,7 @@ int OTF_WBuffer_setSize( OTF_WBuffer* wbuffer, size_t size ) {
if ( size < wbuffer->size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"cannot shrink buffer from %u to %u.\n",
__FUNCTION__, __FILE__, __LINE__, (uint32_t) wbuffer->size,
(uint32_t) size );
@ -142,7 +142,7 @@ int OTF_WBuffer_setSize( OTF_WBuffer* wbuffer, size_t size ) {
size * sizeof(char) );
if( NULL == wbuffer->buffer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -162,7 +162,7 @@ void OTF_WBuffer_setZBufferSize( OTF_WBuffer* wbuffer, uint32_t size ) {
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -170,13 +170,13 @@ void OTF_WBuffer_setZBufferSize( OTF_WBuffer* wbuffer, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"zbuffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
}
@ -201,7 +201,7 @@ int OTF_WBuffer_flush( OTF_WBuffer* wbuffer ) {
ret= OTF_File_write( wbuffer->file, wbuffer->buffer, wbuffer->pos );
if( ret != wbuffer->pos ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_write() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
retval= 0;
@ -225,7 +225,7 @@ int OTF_WBuffer_guarantee( OTF_WBuffer* wbuffer, size_t space ) {
if ( space > wbuffer->size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"requested %u bytes > buffer size %u.\n",
__FUNCTION__, __FILE__, __LINE__,
(uint32_t) space, wbuffer->size );
@ -235,7 +235,7 @@ int OTF_WBuffer_guarantee( OTF_WBuffer* wbuffer, size_t space ) {
if( 0 == OTF_WBuffer_flush( wbuffer ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_flush() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -291,7 +291,7 @@ int OTF_WBuffer_setTimeAndProcess( OTF_WBuffer* wbuffer,
there should be _no_ way to avoid this error message! */
if ( ( (uint64_t) -1 ) != wbuffer->time ) {
OTF_fprintf( stderr, "OTF ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"time not increasing. (t= %llu, p= %u)\n",
__FUNCTION__, __FILE__, __LINE__,
(unsigned long long int) t, (unsigned int) p );
@ -320,7 +320,7 @@ uint32_t OTF_WBuffer_writeKeyword( OTF_WBuffer* wbuffer,
int ret= OTF_WBuffer_guarantee( wbuffer, l );
if( 0 == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -348,7 +348,7 @@ uint32_t OTF_WBuffer_writeString( OTF_WBuffer* wbuffer, const char* string ) {
if( 0 == OTF_WBuffer_guarantee( wbuffer, l+2 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -388,7 +388,7 @@ uint32_t OTF_WBuffer_writeChar( OTF_WBuffer* wbuffer, const char character ) {
if( 0 == OTF_WBuffer_guarantee( wbuffer, 1 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -419,7 +419,7 @@ uint32_t OTF_WBuffer_writeUint8( OTF_WBuffer* wbuffer, uint8_t value ) {
/* at max 2 digits will be written */
if( 0 == OTF_WBuffer_guarantee( wbuffer, 2 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -467,7 +467,7 @@ uint32_t OTF_WBuffer_writeUint16( OTF_WBuffer* wbuffer, uint16_t value ) {
/* at max 4 digits will be written */
if( 0 == OTF_WBuffer_guarantee( wbuffer, 4 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -514,7 +514,7 @@ uint32_t OTF_WBuffer_writeUint32( OTF_WBuffer* wbuffer, uint32_t value ) {
/* at max 8 digits will be written */
if( 0 == OTF_WBuffer_guarantee( wbuffer, 8 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -561,7 +561,7 @@ uint32_t OTF_WBuffer_writeUint64( OTF_WBuffer* wbuffer, uint64_t value ) {
/* at max 16 digits will be written */
if( 0 == OTF_WBuffer_guarantee( wbuffer, 16 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -599,7 +599,7 @@ uint32_t OTF_WBuffer_writeNewline( OTF_WBuffer* wbuffer ) {
if( 0 == OTF_WBuffer_guarantee( wbuffer, 1 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -626,7 +626,7 @@ uint32_t OTF_WBuffer_writeBytes( OTF_WBuffer* wbuffer, const uint8_t *value, uin
/* at max 2 * len digits will be written */
if( 0 == OTF_WBuffer_guarantee( wbuffer, len*2 ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_WBuffer_guarantee() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -867,7 +867,7 @@ OTF_WBuffer* OTF_WBuffer_open_zlevel( const char* filename,
OTF_WBuffer* ret= (OTF_WBuffer*) malloc( sizeof(OTF_WBuffer) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -878,7 +878,7 @@ OTF_WBuffer* OTF_WBuffer_open_zlevel( const char* filename,
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -890,7 +890,7 @@ OTF_WBuffer* OTF_WBuffer_open_zlevel( const char* filename,
ret->file= OTF_File_open_zlevel( filename, manager, OTF_FILEMODE_WRITE, compression );
if( NULL == ret->file ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_File_open() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );

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

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

@ -617,8 +617,9 @@ int OTF_WStream_writeDefKeyValue( OTF_WStream* wstream, uint32_t key,
* @see OTF_Writer_writeDefKeyValueKV()
* \ingroup wstream
*/
int OTF_WStream_writeDefKeyValueKV( OTF_WStream* wstream, uint32_t key, OTF_Type type,
const char* name, const char *description, OTF_KeyValueList* list );
int OTF_WStream_writeDefKeyValueKV( OTF_WStream* wstream, uint32_t key,
OTF_Type type, const char* name, const char *description,
OTF_KeyValueList* list );
/** Write a DEFTIMERANGE record including an OTF_KeyValueList to
@ -626,21 +627,27 @@ int OTF_WStream_writeDefKeyValueKV( OTF_WStream* wstream, uint32_t key, OTF_Type
* @see OTF_Writer_writeDefTimeRange()
* \ingroup wstream
*/
int OTF_WStream_writeDefTimeRange( OTF_WStream* wstream,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list );
int OTF_WStream_writeDefTimeRange( OTF_WStream* wstream, uint64_t minTime,
uint64_t maxTime, OTF_KeyValueList* list );
/** Write a DEFCOUNTERASSIGNMENTS record including an OTF_KeyValueList to
* stream 'wstream'.
* @see OTF_Writer_writeDefCounterAssignments()
* \ingroup wstream
*/
int OTF_WStream_writeDefCounterAssignments( OTF_WStream* wstream,
uint32_t counter_token,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
int OTF_WStream_writeDefCounterAssignments( OTF_WStream* wstream,
uint32_t counter_token, uint32_t number_of_members,
const uint32_t* procs_or_groups, OTF_KeyValueList* list );
/** Write a DEFPROCESSSUBTITUTES record including an OTF_KeyValueList to
* stream 'wstream'.
* @see OTF_Writer_writeDefProcessSubsitutes()
* \ingroup wstream
*/
int OTF_WStream_writeDefProcessSubstitutes( OTF_WStream* wstream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list );
/* *** event record write handlers *** ************************************* */

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

@ -112,7 +112,7 @@ int OTF_Writer_finish( OTF_Writer* writer ) {
tmpret= OTF_MasterControl_write( writer->mc, writer->namestub );
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_write() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -121,7 +121,7 @@ int OTF_Writer_finish( OTF_Writer* writer ) {
tmpret= OTF_Writer_closeAllStreams( writer );
if( 0 == tmpret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Writer_closeAllStreams() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
}
@ -152,7 +152,7 @@ OTF_Writer* OTF_Writer_open( const char* namestub, uint32_t m, OTF_FileManager*
if( NULL == manager ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"manager has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -162,7 +162,7 @@ OTF_Writer* OTF_Writer_open( const char* namestub, uint32_t m, OTF_FileManager*
ret= (OTF_Writer*) malloc( sizeof(OTF_Writer) );
if( NULL == ret ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -180,7 +180,7 @@ OTF_Writer* OTF_Writer_open( const char* namestub, uint32_t m, OTF_FileManager*
ret->mc= OTF_MasterControl_new( ret->manager );
if( NULL == ret->mc ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_new() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -201,7 +201,7 @@ int OTF_Writer_close( OTF_Writer* writer ) {
if( NULL == writer ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"writer has not been specified.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -210,7 +210,7 @@ int OTF_Writer_close( OTF_Writer* writer ) {
if( 0 == OTF_Writer_finish( writer ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_Writer_finish() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -239,7 +239,7 @@ int OTF_Writer_setCompression( OTF_Writer* writer, OTF_FileCompression
} else {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"compression is no expected value (%u). ignored.\n",
__FUNCTION__, __FILE__, __LINE__, compression );
@ -276,7 +276,7 @@ void OTF_Writer_setBufferSizes( OTF_Writer* writer, uint32_t size ) {
if ( 50 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended buffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -284,13 +284,13 @@ void OTF_Writer_setBufferSizes( OTF_Writer* writer, uint32_t size ) {
} else if ( 500 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"buffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
}
@ -313,7 +313,7 @@ void OTF_Writer_setZBufferSizes( OTF_Writer* writer, uint32_t size ) {
if ( 32 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"intended zbuffer size %u is too small, rejected.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -321,13 +321,13 @@ void OTF_Writer_setZBufferSizes( OTF_Writer* writer, uint32_t size ) {
} else if ( 512 > size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "ERROR in function %s, file: %s, line: %i:\n "
"buffer size %u is very small, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
} else if ( 10 * 1024 *1024 < size ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Warning( "ERROR in function %s, file: %s, line: %i:\n "
"buffer size %u is rather big, accepted though.\n",
__FUNCTION__, __FILE__, __LINE__, size );
@ -355,7 +355,7 @@ void OTF_Writer_setFormat( OTF_Writer* writer, uint32_t format ) {
if ( format > 1 ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"unknown ouput format chosen.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -428,7 +428,7 @@ OTF_WStream* OTF_Writer_getStream( OTF_Writer* writer, uint32_t streamId ) {
/* not found, create & append at position 'a' */
/*
OTF_fprintf(stderr," at %u\n", a );
fprintf(stderr," at %u\n", a );
*/
if ( writer->s <= writer->n ) {
@ -438,7 +438,7 @@ OTF_WStream* OTF_Writer_getStream( OTF_Writer* writer, uint32_t streamId ) {
writer->s * sizeof(OTF_WStream*) );
if( NULL == writer->streams ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no memory left.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -474,7 +474,7 @@ uint32_t OTF_Writer_assignProcess( OTF_Writer* writer,
if ( 0 == stream ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"stream id must not be '0'.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -483,7 +483,7 @@ uint32_t OTF_Writer_assignProcess( OTF_Writer* writer,
if( 0 == OTF_MasterControl_append( writer->mc, stream, process ) ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"OTF_MasterControl_append() failed.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -513,7 +513,7 @@ uint32_t OTF_Writer_mapProcess( OTF_Writer* writer, uint32_t process ) {
if ( 0 == ret ) {
/*
OTF_fprintf( stderr, "OTF_Writer_mapProcess() %u unknown\n", process );
fprintf( stderr, "OTF_Writer_mapProcess() %u unknown\n", process );
*/
ret= (uint32_t) -1;
@ -532,7 +532,7 @@ uint32_t OTF_Writer_mapProcess( OTF_Writer* writer, uint32_t process ) {
must take care!*/
if( 0 >= n ) {
OTF_fprintf( stderr, "ERROR in function %s, file: %s, line: %i:\n "
OTF_Error( "ERROR in function %s, file: %s, line: %i:\n "
"no processes/stream have been defined.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1001,7 +1001,7 @@ int OTF_Writer_writeDefSclFileKV( OTF_Writer* writer, uint32_t streamid,
int OTF_Writer_writeOtfVersion( OTF_Writer* writer, uint32_t streamid ) {
OTF_fprintf( stderr, "WARNING in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"calling depricated function. ignored.\n",
__FUNCTION__, __FILE__, __LINE__ );
@ -1155,6 +1155,25 @@ int OTF_Writer_writeDefCounterAssignments( OTF_Writer* writer,
}
int OTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer, uint32_t streamid,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* list ) {
OTF_WStream* stream= OTF_Writer_getStream( writer, (uint32_t) streamid );
if ( 0 == writer->versionWritten ) {
OTF_WStream_writeOtfVersion( OTF_Writer_getStream( writer, 0 ) );
writer->versionWritten= 1;
}
return OTF_WStream_writeDefProcessSubstitutes( stream, representative,
numberOfProcs, (uint32_t*) procs, list );
}
/* *** Event Records *** ****************************************** */
int OTF_Writer_writeNoOpKV( OTF_Writer* writer, uint64_t time,
@ -1977,7 +1996,7 @@ int OTF_Writer_writeDefMarker( OTF_Writer* writer, uint32_t streamID,
#ifdef OTF_DEBUG
if ( 0 != streamID ) {
OTF_fprintf( stderr, "WARNING in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"streamID value of '%u' is ignored, '0' is used instead\n",
__FUNCTION__, __FILE__, __LINE__, streamID );
}
@ -1994,7 +2013,7 @@ int OTF_Writer_writeDefMarkerKV( OTF_Writer* writer, uint32_t streamID,
#ifdef OTF_DEBUG
if ( 0 != streamID ) {
OTF_fprintf( stderr, "WARNING in function %s, file: %s, line: %i:\n "
OTF_Warning( "WARNING in function %s, file: %s, line: %i:\n "
"streamID value of '%u' is ignored, '0' is used instead\n",
__FUNCTION__, __FILE__, __LINE__, streamID );
}

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

@ -1081,6 +1081,38 @@ int OTF_Writer_writeDefCounterAssignments( OTF_Writer* writer,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
/**
* Writes a ProcessSubstitutes definition record
*
* @param userData Pointer to user data which can be set with
* OTF_HandlerArray_setFirstHandlerArg().
* @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.
*
* \ingroup writer
*/
int OTF_Writer_writeDefProcessSubstitutes( OTF_Writer* writer,
uint32_t streamid,
uint32_t representative,
uint32_t numberOfProcs,
const uint32_t* procs,
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.

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

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

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

@ -0,0 +1,11 @@
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

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

@ -0,0 +1,63 @@
/* -*- c -*- */
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include <otfaux.h>
static void
process_handler( void* data,
uint64_t process,
uint32_t start_pixel,
uint32_t function )
{
printf( "%lx: %x/%x\n", process, start_pixel, function );
}
int
main(int ac, char *av[])
{
OTF_FileManager* manager;
OTFAUX_ThumbnailWriter* writer;
OTFAUX_ThumbnailReader* reader;
OTFAUX_Thumbnail_Data data;
uint32_t start_pixels[7] = { 2, 5, 23, 49, 63, 76, 80 };
uint32_t functions[7] = { 1, 2, 3, 2, 3, 2, 1 };
uint32_t height, width;
int i;
manager = OTF_FileManager_open( 16 );
writer = OTFAUX_ThumbnailWriter_create( "test_thumbnail.otf",
4,
16,
manager );
for ( i = 1; i <= 4; i++ )
{
data.start_pixel = start_pixels;
data.function = functions;
data.size = 7;
OTFAUX_ThumbnailWriter_writeProcess( writer, i, &data );
}
OTFAUX_ThumbnailWriter_destroy( writer );
reader = OTFAUX_ThumbnailReader_create( "test_thumbnail.otf",
manager );
OTFAUX_ThumbnailReader_getDimension( reader, &height, &width );
printf( "%xx%x\n", height, width );
OTFAUX_ThumbnailReader_read( reader, process_handler, NULL );
OTFAUX_ThumbnailReader_destroy( reader );
OTF_FileManager_close( manager );
return 0;
}

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

@ -12,10 +12,4 @@ else
TMP3 =
endif
if AMHAVEMPI
TMP4 = otfmerge-mpi otfprofile-mpi
else
TMP4 =
endif
SUBDIRS = $(TMP1) $(TMP2) $(TMP3) $(TMP4)
SUBDIRS = $(TMP1) $(TMP2) $(TMP3)

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

@ -6,7 +6,7 @@ if AMBUILDBINARIES
bin_PROGRAMS = otfcompress
install-exec-hook:
(cd $(DESTDIR)$(bindir); rm -f otfdecompress; \
(cd $(DESTDIR)$(bindir); rm -f otfdecompress$(EXEEXT); \
$(LN_S) otfcompress$(EXEEXT) otfdecompress$(EXEEXT))
uninstall-local:
rm -f $(DESTDIR)$(bindir)/otfdecompress$(EXEEXT)

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

@ -8,6 +8,9 @@
#endif
#include <stdio.h>
#include <string.h>
#include "OTF_inttypes.h"
#include "OTF_Platform.h"
#include "otf.h"
@ -35,64 +38,93 @@ int main( int argc, char** argv ) {
int i;
char tmp[1024];
char includes[1024]= "";
char libs[1024]= "";
if( argc == 1 ) {
SHOW_HELPTEXT;
return 0;
}
for( i= 1; i < argc; ++i ) {
if( 0 == strcmp( argv[i], "-h" ) || 0 == strcmp( argv[i], "--help" )) {
if( 0 == strcmp( argv[i], "-h" ) ||
0 == strcmp( argv[i], "--help" ) ) {
SHOW_HELPTEXT;
return 0;
} else if ( 0 == strcmp( argv[i], "--version" ) ) {
printf( "%u.%u.%u %s\n", OTF_VERSION_MAJOR, OTF_VERSION_MINOR, OTF_VERSION_SUB, OTF_VERSION_STRING );
printf( "%u.%u.%u %s\n",
OTF_VERSION_MAJOR, OTF_VERSION_MINOR,
OTF_VERSION_SUB, OTF_VERSION_STRING );
return 0;
} else if ( 0 == strcmp( argv[i], "--have-zlib" ) ) {
#ifdef HAVE_ZLIB
printf( "yes\n" );
#else
printf( "no\n" );
#endif
printf( "yes\n" );
#else /* HAVE_ZLIB */
printf( "no\n" );
#endif /* HAVE_ZLIB */
return 0;
} else if ( 0 == strcmp( argv[i], "--includes" ) ) {
printf( "-I%s\n", OTFCONFIG_INCLUDEDIR );
if ( !(*includes) ) {
strncpy( includes, "-I"OTFCONFIG_INCLUDEDIR,
sizeof( includes) - 1 );
}
} else if ( 0 == strcmp( argv[i], "--libs" ) ) {
#ifdef HAVE_ZLIB
snprintf( tmp, sizeof(tmp) -1, "-L%s -lotfaux -lotf -lz\n",
OTFCONFIG_LIBDIR );
#else /* HAVE_ZLIB */
snprintf( tmp, sizeof(tmp) -1, "-L%s -lotfaux -lotf\n",
OTFCONFIG_LIBDIR );
#endif /* HAVE_ZLIB */
if ( !(*libs) ) {
printf( "%s", tmp );
strncpy( libs,
"-L"OTFCONFIG_LIBDIR" -lotfaux -lotf",
sizeof( libs ) - 1 );
#ifdef HAVE_ZLIB
strncat( libs, " -lz",
sizeof( libs ) - strlen( libs ) - 1 );
#endif /* HAVE_ZLIB */
}
} else if ( 0 == strcmp( argv[i], "--sizes" ) ) {
/* print size of integer types */
printf( " sizeof(%s)= %llu\n", " int8_t ", (long long unsigned) sizeof(int8_t) );
printf( " sizeof(%s)= %llu\n", " int16_t ", (long long unsigned) sizeof(int16_t) );
printf( " sizeof(%s)= %llu\n", " int32_t ", (long long unsigned) sizeof(int32_t) );
printf( " sizeof(%s)= %llu\n", " int64_t ", (long long unsigned) sizeof(int64_t) );
printf( " sizeof(%s)= %llu\n", " uint8_t ", (long long unsigned) sizeof(uint8_t) );
printf( " sizeof(%s)= %llu\n", " uint16_t ", (long long unsigned) sizeof(uint16_t) );
printf( " sizeof(%s)= %llu\n", " uint32_t ", (long long unsigned) sizeof(uint32_t) );
printf( " sizeof(%s)= %llu\n", " uint64_t ", (long long unsigned) sizeof(uint64_t) );
printf( " sizeof(%s)= %llu\n", " int8_t ",
(long long unsigned) sizeof(int8_t) );
printf( " sizeof(%s)= %llu\n", " int16_t ",
(long long unsigned) sizeof(int16_t) );
printf( " sizeof(%s)= %llu\n", " int32_t ",
(long long unsigned) sizeof(int32_t) );
printf( " sizeof(%s)= %llu\n", " int64_t ",
(long long unsigned) sizeof(int64_t) );
printf( " sizeof(%s)= %llu\n", " uint8_t ",
(long long unsigned) sizeof(uint8_t) );
printf( " sizeof(%s)= %llu\n", " uint16_t ",
(long long unsigned) sizeof(uint16_t) );
printf( " sizeof(%s)= %llu\n", " uint32_t ",
(long long unsigned) sizeof(uint32_t) );
printf( " sizeof(%s)= %llu\n", " uint64_t ",
(long long unsigned) sizeof(uint64_t) );
return 0;
}
}
if ( *includes ) {
printf( "%s%c", includes, *libs ? ' ' : '\n' );
}
if ( *libs ) {
printf( "%s\n", libs );
}
return 0;
}

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

@ -241,12 +241,38 @@ int handleDefProcessGroup( void* userData, uint32_t stream,
return OTF_RETURN_OK;
}
#define CASE_RETURN(type) \
case OTF_ATTR_##type: return #type
static const char* attrToString( OTF_ATTR_TYPE type ) {
switch( type ) {
CASE_RETURN( IsMPIRank );
CASE_RETURN( IsPThread );
CASE_RETURN( IsOMPThread );
CASE_RETURN( IsCellSPUThread );
CASE_RETURN( hasGroupCounters );
CASE_RETURN( hasEnterLeaveRecords );
CASE_RETURN( IsCommunicator );
case OTF_ATTR_UNKNOWN:
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>", type );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
int handleDefAttributeList( void* userData, uint32_t stream,
uint32_t attr_token, uint32_t num, OTF_ATTR_TYPE* array,
OTF_KeyValueList* kvlist ) {
uint32_t i;
uint32_t i;
Control* c= (Control*) userData;
@ -258,12 +284,12 @@ int handleDefAttributeList( void* userData, uint32_t stream,
fprintf( c->outfile, "(#%llu) \tDefAttributeList: stream %u, attr_token %u, attributes ",
(long long unsigned) c->num, stream, attr_token);
for( i= 0; i < (num - 1); ++i ) {
fprintf( c->outfile, "%u, ", array[i] );
const char* sep = "";
for( i= 0; i < num; ++i ) {
fprintf( c->outfile, "%s%s", sep, attrToString( array[i] ) );
sep = ", ";
}
fprintf( c->outfile, "%u", array[i] );
printKeyValueList(c, kvlist);
}
}
@ -345,6 +371,29 @@ int handleDefFunctionGroup( void* userData, uint32_t stream,
}
#define CASE_RETURN(name) \
case OTF_COLLECTIVE_TYPE_##name: return #name
static const char* collOpTypeToString( uint32_t type ) {
switch( type ) {
CASE_RETURN( BARRIER );
CASE_RETURN( ONE2ALL );
CASE_RETURN( ALL2ONE );
CASE_RETURN( ALL2ALL );
case OTF_COLLECTIVE_TYPE_UNKNOWN:
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>", type );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
int handleDefCollectiveOperation( void* userData, uint32_t stream,
uint32_t collOp, const char* name, uint32_t type, OTF_KeyValueList* kvlist ) {
@ -357,8 +406,8 @@ int handleDefCollectiveOperation( void* userData, uint32_t stream,
++c->num;
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) \tDefCollective: stream %u, collective %u, name \"%s\", type %u",
(long long unsigned) c->num, stream, collOp, name, type );
fprintf( c->outfile, "(#%llu) \tDefCollective: stream %u, collective %u, name \"%s\", type %s",
(long long unsigned) c->num, stream, collOp, name, collOpTypeToString( type ) );
printKeyValueList(c, kvlist);
}
@ -369,6 +418,67 @@ int handleDefCollectiveOperation( void* userData, uint32_t stream,
}
#define CASE_RETURN(prefix, name) \
case OTF_COUNTER_##prefix##_##name: return #name
static const char* counterTypeToString( uint32_t properties ) {
switch( properties & OTF_COUNTER_TYPE_BITS ) {
CASE_RETURN( TYPE, ACC );
CASE_RETURN( TYPE, ABS );
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>",
properties & OTF_COUNTER_TYPE_BITS );
return unknown_buffer;
}
}
}
static const char* counterScopeToString( uint32_t properties ) {
switch( properties & OTF_COUNTER_SCOPE_BITS ) {
CASE_RETURN( SCOPE, START );
CASE_RETURN( SCOPE, POINT );
CASE_RETURN( SCOPE, LAST );
CASE_RETURN( SCOPE, NEXT );
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>",
properties & OTF_COUNTER_SCOPE_BITS );
return unknown_buffer;
}
}
}
static const char* counterVarTypeToString( uint32_t properties ) {
switch( properties & OTF_COUNTER_VARTYPE_BITS ) {
CASE_RETURN( VARTYPE, UNSIGNED8 );
CASE_RETURN( VARTYPE, SIGNED8 );
CASE_RETURN( VARTYPE, UNSIGNED4 );
CASE_RETURN( VARTYPE, SIGNED4 );
CASE_RETURN( VARTYPE, UNSIGNED2 );
CASE_RETURN( VARTYPE, SIGNED2 );
CASE_RETURN( VARTYPE, FLOAT );
CASE_RETURN( VARTYPE, DOUBLE );
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>",
properties & OTF_COUNTER_VARTYPE_BITS );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
int handleDefCounter( void* userData, uint32_t stream, uint32_t counter,
const char* name, uint32_t properties, uint32_t counterGroup,
const char* unit, OTF_KeyValueList* kvlist ) {
@ -376,14 +486,20 @@ int handleDefCounter( void* userData, uint32_t stream, uint32_t counter,
Control* c= (Control*) userData;
c->counter_props[counter] = properties;
if( c->records[OTF_DEFCOUNTER_RECORD] ) {
++c->num;
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) \tDefCounter: stream %u, counter %u, name \"%s\", properties %u, group %u, unit \"%s\"",
(long long unsigned) c->num, stream, counter, name, properties, counterGroup, unit );
fprintf( c->outfile, "(#%llu) \tDefCounter: stream %u, "
"counter %u, name \"%s\", properties %s/%s/%s, group %u, unit \"%s\"",
(long long unsigned) c->num, stream, counter, name,
counterTypeToString( properties ),
counterScopeToString( properties ),
counterVarTypeToString( properties ),
counterGroup, unit );
printKeyValueList(c, kvlist);
}
@ -555,10 +671,41 @@ int handleDefFileGroup( void* userData, uint32_t stream,
}
int handleDefKeyValue( void *userData, uint32_t streamid, uint32_t token, OTF_Type type,
const char *name, const char* desc, OTF_KeyValueList* kvlist ) {
#define CASE_RETURN(type) \
case OTF_##type: return #type
static const char* keyValueTypeToString( OTF_Type type ) {
switch( type ) {
CASE_RETURN( CHAR );
CASE_RETURN( INT8 );
CASE_RETURN( UINT8 );
CASE_RETURN( INT16 );
CASE_RETURN( UINT16 );
CASE_RETURN( INT32 );
CASE_RETURN( UINT32 );
CASE_RETURN( INT64 );
CASE_RETURN( UINT64 );
CASE_RETURN( FLOAT );
CASE_RETURN( DOUBLE );
CASE_RETURN( BYTE_ARRAY );
case OTF_UNKNOWN:
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>", type );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
int handleDefKeyValue( void *userData, uint32_t streamid, uint32_t token,
OTF_Type type, const char *name, const char* desc,
OTF_KeyValueList* kvlist )
{
Control* c= (Control*) userData;
@ -567,8 +714,9 @@ int handleDefKeyValue( void *userData, uint32_t streamid, uint32_t token, OTF_Ty
++c->num;
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) \tDefKeyValue: stream %u, token %u, type %u, name \"%s\", desc \"%s\"",
(long long unsigned) c->num, streamid, token, type, name, desc );
fprintf( c->outfile, "(#%llu) \tDefKeyValue: stream %u, token %u, type %s, name \"%s\", desc \"%s\"",
(long long unsigned) c->num, streamid, token,
keyValueTypeToString( type ), name, desc );
printKeyValueList(c, kvlist);
}
@ -578,69 +726,102 @@ int handleDefKeyValue( void *userData, uint32_t streamid, uint32_t token, OTF_Ty
}
int handleDefTimeRange( void* userData,
uint32_t streamid,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* kvlist ) {
int handleDefTimeRange( void* userData, uint32_t streamid, uint64_t minTime,
uint64_t maxTime, OTF_KeyValueList* kvlist )
{
Control* c= (Control*) userData;
Control* c= (Control*) userData;
if ( c->records[OTF_DEFTIMERANGE_RECORD] ) {
if ( c->records[OTF_DEFTIMERANGE_RECORD] ) {
++c->num;
if ( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
++c->num;
if ( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile,
"(#%llu) \tDefTimeRange: stream %u, "
"[%llu, %llu]",
(long long unsigned) c->num,
streamid,
(long long unsigned) minTime,
(long long unsigned) maxTime );
fprintf( c->outfile,
"(#%llu) \tDefTimeRange: stream %u, "
"[%llu, %llu]",
(long long unsigned) c->num,
streamid,
(long long unsigned) minTime,
(long long unsigned) maxTime );
printKeyValueList( c, kvlist );
}
}
printKeyValueList( c, kvlist );
}
}
return OTF_RETURN_OK;
return OTF_RETURN_OK;
}
int handleDefCounterAssignments( void* userData,
uint32_t streamid,
uint32_t counter_token,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* kvlist ) {
uint32_t i;
Control* c= (Control*) userData;
int handleDefCounterAssignments( void* userData, uint32_t streamid,
uint32_t counter_token, uint32_t number_of_members,
const uint32_t* procs_or_groups, OTF_KeyValueList* kvlist )
{
Control* c= (Control*) userData;
uint32_t i;
if ( c->records[OTF_DEFCOUNTERASSIGNMENTS_RECORD] ) {
if ( c->records[OTF_DEFCOUNTERASSIGNMENTS_RECORD] ) {
++c->num;
if ( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
const char* sep= "";
++c->num;
if ( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile,
"(#%llu) \tDefCounterAssignments: stream %u, "
"counter_token %u, assignees ",
(long long unsigned) c->num,
streamid,
counter_token );
const char* sep= "";
for ( i= 0; i < number_of_members; ++i ) {
fprintf( c->outfile, "%s%u", sep, procs_or_groups[i] );
sep= ", ";
}
fprintf( c->outfile,
"(#%llu) \tDefCounterAssignments: stream %u, "
"counter_token %u, assignees ",
(long long unsigned) c->num,
streamid,
counter_token );
printKeyValueList( c, kvlist );
}
}
for ( i= 0; i < number_of_members; ++i ) {
return OTF_RETURN_OK;
fprintf( c->outfile, "%s%u", sep, procs_or_groups[i] );
sep= ", ";
}
printKeyValueList( c, kvlist );
}
}
return OTF_RETURN_OK;
}
int handleDefProcessSubstitutes( void* userData, uint32_t streamid,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* kvlist ) {
Control* c= (Control*) userData;
uint32_t i;
if ( c->records[OTF_DEFPROCESSSUBSTITUTES_RECORD] ) {
++c->num;
if ( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
const char* sep= "";
fprintf( c->outfile,
"(#%llu) \tDefProcessSubstitutes: stream %u, "
"representative process %u, procs ",
(long long unsigned) c->num,
streamid,
representative );
for ( i= 0; i < numberOfProcs; ++i ) {
fprintf( c->outfile, "%s%u", sep, procs[i] );
sep= ", ";
}
printKeyValueList( c, kvlist );
}
}
return OTF_RETURN_OK;
}
int handleNoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* kvlist ) {
@ -665,6 +846,7 @@ int handleNoOp( void* userData, uint64_t time, uint32_t process,
return OTF_RETURN_OK;
}
int handleEnter( void* userData, uint64_t time, uint32_t function,
uint32_t process, uint32_t source, OTF_KeyValueList* kvlist ) {
@ -767,6 +949,55 @@ int handleRecvMsg( void* userData, uint64_t time, uint32_t recvProc,
}
static void printCounterValue( Control* c, uint32_t counter, uint64_t value ) {
uint32_t properties = OTF_COUNTER_VARTYPE_UNSIGNED8;
std::map<uint32_t,uint32_t>::const_iterator it
= c->counter_props.find( counter );
if( it != c->counter_props.end() ) {
properties= it->second & OTF_COUNTER_VARTYPE_BITS;
}
switch( properties ) {
case OTF_COUNTER_VARTYPE_UNSIGNED8:
case OTF_COUNTER_VARTYPE_UNSIGNED4:
case OTF_COUNTER_VARTYPE_UNSIGNED2: {
uint64_t conv_value = OTF_Counter2Unsigned( value );
fprintf( c->outfile, "%llu", (unsigned long long) conv_value );
break;
}
case OTF_COUNTER_VARTYPE_SIGNED8:
case OTF_COUNTER_VARTYPE_SIGNED4:
case OTF_COUNTER_VARTYPE_SIGNED2: {
int64_t conv_value = OTF_Counter2Signed( value );
fprintf( c->outfile, "%lld", (long long) conv_value );
break;
}
case OTF_COUNTER_VARTYPE_FLOAT: {
float conv_value = OTF_Counter2Float( value );
fprintf( c->outfile, "%f", conv_value );
break;
}
case OTF_COUNTER_VARTYPE_DOUBLE: {
double conv_value = OTF_Counter2Double( value );
fprintf( c->outfile, "%f", conv_value );
break;
}
default:
fprintf( c->outfile, "<invalid>" );
}
}
int handleCounter( void* userData, uint64_t time, uint32_t process,
uint32_t counter, uint64_t value, OTF_KeyValueList* kvlist ) {
@ -779,9 +1010,10 @@ int handleCounter( void* userData, uint64_t time, uint32_t process,
++c->num;
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) \t%llu Counter: process %u, counter %u, value %llu",
fprintf( c->outfile, "(#%llu) \t%llu Counter: process %u, counter %u, value ",
(long long unsigned) c->num, (long long unsigned) time,
process, counter, (long long unsigned) value );
process, counter );
printCounterValue( c, counter, value );
printKeyValueList(c, kvlist);
}
@ -1256,6 +1488,68 @@ int handleCollopSummary( void* userData, uint64_t time, uint32_t process,
}
#define CASE_RETURN(op) \
case OTF_FILEOP_##op: return #op
static const char* fileOpToString( uint32_t operation ) {
switch( operation & OTF_FILEOP_BITS ) {
CASE_RETURN( OPEN );
CASE_RETURN( CLOSE );
CASE_RETURN( READ );
CASE_RETURN( WRITE );
CASE_RETURN( SEEK );
CASE_RETURN( UNLINK );
CASE_RETURN( RENAME );
CASE_RETURN( DUP );
CASE_RETURN( SYNC );
CASE_RETURN( LOCK );
CASE_RETURN( UNLOCK );
case OTF_FILEOP_OTHER:
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>",
operation & OTF_FILEOP_BITS );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
#define PRINT_FLAG(flag) \
if( io_flags & OTF_IOFLAG_##flag ) { \
fprintf( c->outfile, "%s%s", sep, #flag ); \
io_flags &= ~OTF_IOFLAG_##flag; \
sep = ", "; \
}
static void printIoFlags( Control* c, uint32_t operation ) {
uint32_t io_flags = operation & OTF_IOFLAGS_BITS;
if( !io_flags ) {
fprintf( c->outfile, "%s", "EMPTY" );
}
const char* sep = "";
PRINT_FLAG( IOFAILED )
PRINT_FLAG( ASYNC )
PRINT_FLAG( COLL )
PRINT_FLAG( DIRECT )
PRINT_FLAG( SYNC )
PRINT_FLAG( ISREADLOCK )
if( io_flags ) {
fprintf( c->outfile, "%sUNKNOWN <%u>", sep, io_flags );
}
}
#undef PRINT_FLAG
int handleFileOperation( void* userData, uint64_t time,
uint32_t fileid, uint32_t process,
uint64_t handleid, uint32_t operation,
@ -1270,11 +1564,12 @@ int handleFileOperation( void* userData, uint64_t time,
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) \t%llu FileOperation: file ID %llu, "
"process %llu, handle ID %llu, operation %llu, "
"bytes %llu, duration %llu, source %llu",
"process %llu, handle ID %llu, operation %s, flags ",
(long long unsigned) c->num, (long long unsigned) time,
(long long unsigned) fileid, (long long unsigned) process,
(long long unsigned) handleid, (long long unsigned) operation,
(long long unsigned) handleid, fileOpToString( operation ) );
printIoFlags( c, operation );
fprintf( c->outfile, ", bytes %llu, duration %llu, source %llu",
(long long unsigned) bytes, (long long unsigned) duration,
(long long unsigned) source);
@ -1326,15 +1621,17 @@ int handleEndFileOperation( void* userData, uint64_t time,
fprintf( c->outfile, "(#%llu) \t%llu EndFileOperation: "
"process %llu, file ID %llu, "
"matching ID %llu, handle ID %llu, operation %llu, "
"bytes %llu, source %llu",
"matching ID %llu, handle ID %llu, "
"operation %s, flags ",
(long long unsigned) c->num,
(long long unsigned) time,
(long long unsigned) process,
(long long unsigned) fileid,
(long long unsigned) matchingId,
(long long unsigned) handleId,
(long long unsigned) operation,
(long long unsigned) handleId,
fileOpToString( operation ) );
printIoFlags( c, operation );
fprintf( c->outfile, ", bytes %llu, source %llu",
(long long unsigned) bytes,
(long long unsigned) scltoken );
@ -1520,6 +1817,27 @@ int handleUnknown( void* userData, uint64_t time, uint32_t process,
}
#define CASE_RETURN(name) \
case OTF_MARKER_TYPE_##name: return #name
static const char* markerTypeToString( uint32_t type ) {
switch( type ) {
CASE_RETURN( ERROR );
CASE_RETURN( WARNING );
CASE_RETURN( HINT );
default: {
static char unknown_buffer[ 64 ];
sprintf( unknown_buffer, "UNKNOWN <%u>", type );
return unknown_buffer;
}
}
}
#undef CASE_RETURN
int handleDefMarker( void *userData, uint32_t stream, uint32_t token, const char* name,
uint32_t type, OTF_KeyValueList* kvlist ) {
@ -1530,8 +1848,9 @@ int handleDefMarker( void *userData, uint32_t stream, uint32_t token, const char
++c->num;
if( c->num >= c->minNum && c->num <= c->maxNum && ! c->silent_mode ) {
fprintf( c->outfile, "(#%llu) DefMarker: ID %u, name \"%s\", type %u",
(long long unsigned) c->num, token, name, type );
fprintf( c->outfile, "(#%llu) DefMarker: ID %u, name \"%s\", type %s",
(long long unsigned) c->num, token, name,
markerTypeToString( type ) );
printKeyValueList(c, kvlist);
}

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

@ -10,6 +10,7 @@
#include "config.h"
#endif
#include <map>
#include "OTF_inttypes.h"
@ -32,6 +33,8 @@ typedef struct {
bool records[OTF_NRECORDS]; /* enabled record types */
std::map<uint32_t,uint32_t> counter_props;
FILE* outfile;
} Control;
@ -93,19 +96,16 @@ int handleDefVersion( void* userData, uint32_t stream, uint8_t major,
int handleDefKeyValue( void *userData, uint32_t streamid, uint32_t token,
OTF_Type type, const char *name, const char *desc, OTF_KeyValueList* kvlist );
int handleDefTimeRange( void* userData,
uint32_t streamid,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* kvlist );
int handleDefTimeRange( void* userData, uint32_t streamid, uint64_t minTime,
uint64_t maxTime, OTF_KeyValueList* kvlist );
int handleDefCounterAssignments( void* userData,
uint32_t streamid,
uint32_t counter_token,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* kvlist );
int handleDefCounterAssignments( void* userData, uint32_t streamid,
uint32_t counter_token, uint32_t number_of_members,
const uint32_t* procs_or_groups, OTF_KeyValueList* kvlist );
int handleDefProcessSubstitutes( void* userData, uint32_t streamid,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList* kvlist );
int handleNoOp( void* userData, uint64_t time, uint32_t process,
OTF_KeyValueList* kvlist );

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

@ -379,6 +379,12 @@ int main ( int argc, const char** argv ) {
&fha,
OTF_DEFCOUNTERASSIGNMENTS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) handleDefProcessSubstitutes,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers,
&fha,
OTF_DEFPROCESSSUBSTITUTES_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) handleNoOp,

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

@ -1,17 +0,0 @@
INCLUDES = -I$(top_builddir)/otflib -I$(top_srcdir)/otflib $(MPI_INCLUDE_LINE)
if AMBUILDBINARIES
bin_PROGRAMS = \
otfmerge-mpi
endif
CC = $(MPICC)
otfmerge_mpi_CFLAGS = $(MPICFLAGS)
otfmerge_mpi_LDADD = $(top_builddir)/otflib/libotf.la $(MPI_LIB_LINE)
otfmerge_mpi_DEPENDENCIES = $(top_builddir)/otflib/libotf.la
otfmerge_mpi_SOURCES = \
handler.h \
otfmerge-mpi.c \
handler.c

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

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

@ -1,270 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Johannes Spazier
*/
#ifndef HANDLER_H
#define HANDLER_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#if defined(HAVE_SYS_SELECT_H) && HAVE_SYS_SELECT_H
# include <sys/select.h>
#else /* HAVE_SYS_SELECT_H */
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
#endif /* HAVE_SYS_SELECT_H */
#include <mpi.h>
#include "otf.h"
/* data structures */
typedef struct {
int id;
int num_cpus;
int *cpus;
} OutStream;
typedef struct {
int num_ostreams;
OutStream *ostreams;
} RankData;
typedef struct {
double progress;
uint8_t is_alive;
} ProgressBuf;
typedef struct {
MPI_Request request;
ProgressBuf value;
ProgressBuf buf;
int num_cpus;
double percent;
} ProgressInfo;
typedef struct {
int my_rank;
int num_ranks;
int ranks_alive;
double tmp_progress;
MPI_Datatype buftype;
} GlobalData;
/* function declarations */
double update_progress( ProgressInfo* info, GlobalData* data, int cur_ostream, int num_ostreams);
int finish_everything( char *infile, char* outfile, ProgressInfo* info,
RankData* rank_data, int ret );
void setDefinitionHandlerArray( OTF_HandlerArray* handlers, OTF_WStream* wstream);
void setEventHandlerArray( OTF_HandlerArray* handlers, OTF_WStream* wstream);
/* handlers */
/* definitions */
int handleDefinitionComment (void *userData, uint32_t stream, const char *comment,
OTF_KeyValueList *list);
int handleDefTimerResolution (void *userData, uint32_t stream, uint64_t ticksPerSecond,
OTF_KeyValueList *list);
int handleDefProcess (void *userData, uint32_t stream, uint32_t process, const char *name,
uint32_t parent, OTF_KeyValueList *list);
int handleDefProcessGroup (void *userData, uint32_t stream, uint32_t procGroup, const char *name,
uint32_t numberOfProcs, const uint32_t *procs, OTF_KeyValueList *list);
int handleDefAttributeList (void *userData, uint32_t stream, uint32_t attr_token, uint32_t num,
OTF_ATTR_TYPE *array, OTF_KeyValueList *list);
int handleDefProcessOrGroupAttributes(void *userData, uint32_t stream, uint32_t proc_token,
uint32_t attr_token, OTF_KeyValueList *list);
int handleDefFunction (void *userData, uint32_t stream, uint32_t func, const char *name,
uint32_t funcGroup, uint32_t source, OTF_KeyValueList *list);
int handleDefFunctionGroup (void *userData, uint32_t stream, uint32_t funcGroup,
const char *name, OTF_KeyValueList *list);
int handleDefCollectiveOperation (void *userData, uint32_t stream, uint32_t collOp,
const char *name, uint32_t type, OTF_KeyValueList *list);
int handleDefCounter (void *userData, uint32_t stream, uint32_t counter, const char *name,
uint32_t properties, uint32_t counterGroup, const char *unit, OTF_KeyValueList *list);
int handleDefCounterGroup (void *userData, uint32_t stream, uint32_t counterGroup, const char *name,
OTF_KeyValueList *list);
int handleDefScl (void *userData, uint32_t stream, uint32_t source, uint32_t sourceFile,
uint32_t line, OTF_KeyValueList *list);
int handleDefSclFile (void *userData, uint32_t stream, uint32_t sourceFile, const char *name,
OTF_KeyValueList *list);
int handleDefCreator (void *userData, uint32_t stream, const char *creator, OTF_KeyValueList *list);
int handleDefVersion (void *userData, uint32_t stream, uint8_t major, uint8_t minor,
uint8_t sub, const char *string);
int handleDefFile (void *userData, uint32_t stream, uint32_t token, const char *name,
uint32_t group, OTF_KeyValueList *list);
int handleDefFileGroup (void *userData, uint32_t stream, uint32_t token, const char *name,
OTF_KeyValueList *list);
int handleDefKeyValue (void *userData, uint32_t stream, uint32_t token, OTF_Type type,
const char *name, const char *desc, OTF_KeyValueList *list);
int handleDefTimeRange( void* userData,
uint32_t stream,
uint64_t counter_token,
uint64_t number_of_members,
OTF_KeyValueList* kvlist );
int handleDefCounterAssignments( void* userData,
uint32_t stream,
uint32_t counter_token,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* kvlist );
/* events */
int handleNoOp (void *userData, uint64_t time, uint32_t process, OTF_KeyValueList *list);
int handleEnter (void *userData, uint64_t time, uint32_t function, uint32_t process,
uint32_t source, OTF_KeyValueList *list);
int handleLeave( void *userData, uint64_t time, uint32_t function, uint32_t process,
uint32_t source, OTF_KeyValueList *list );
int handleSendMsg( void *userData, uint64_t time, uint32_t sender, uint32_t receiver,
uint32_t group, uint32_t type, uint32_t length, uint32_t source, OTF_KeyValueList *list);
int handleRecvMsg( void *userData, uint64_t time, uint32_t recvProc, uint32_t sendProc,
uint32_t group, uint32_t type, uint32_t length, uint32_t source, OTF_KeyValueList *list);
int handleCounter( void *userData, uint64_t time, uint32_t process, uint32_t counter,
uint64_t value, OTF_KeyValueList *list);
int handleCollectiveOperation( void *userData, uint64_t time, uint32_t process, uint32_t collective,
uint32_t procGroup, uint32_t rootProc, uint32_t sent, uint32_t received, uint64_t duration,
uint32_t source, OTF_KeyValueList *list);
int handleBeginCollectiveOperation( void *userData, uint64_t time, uint32_t process, uint32_t collOp,
uint64_t matchingId, uint32_t procGroup, uint32_t rootProc, uint64_t sent, uint64_t received,
uint32_t scltoken, OTF_KeyValueList *list);
int handleEndCollectiveOperation( void *userData, uint64_t time, uint32_t process,
uint64_t matchingId, OTF_KeyValueList *list);
int handleEventComment( void *userData, uint64_t time, uint32_t process, const char *comment,
OTF_KeyValueList *list);
int handleBeginProcess( void *userData, uint64_t time, uint32_t process, OTF_KeyValueList *list);
int handleEndProcess( void *userData, uint64_t time, uint32_t process, OTF_KeyValueList *list);
int handleFileOperation( void *userData, uint64_t time, uint32_t fileid, uint32_t process,
uint64_t handleid, uint32_t operation, uint64_t bytes, uint64_t duration, uint32_t source,
OTF_KeyValueList *list);
int handleBeginFileOperation( void *userData, uint64_t time, uint32_t process,
uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList *list);
int handleEndFileOperation( void *userData, uint64_t time, uint32_t process,
uint32_t fileid, uint64_t matchingId, uint64_t handleId, uint32_t operation, uint64_t bytes,
uint32_t scltoken, OTF_KeyValueList *list);
int handleRMAPut( void *userData, uint64_t time, uint32_t process, uint32_t origin,
uint32_t target, uint32_t communicator, uint32_t tag, uint64_t bytes,
uint32_t source, OTF_KeyValueList *list);
int handleRMAPutRemoteEnd( void *userData, uint64_t time, uint32_t process, uint32_t origin,
uint32_t target, uint32_t communicator, uint32_t tag, uint64_t bytes, uint32_t source,
OTF_KeyValueList *list);
int handleRMAGet( void *userData, uint64_t time, uint32_t process, uint32_t origin,
uint32_t target, uint32_t communicator, uint32_t tag, uint64_t bytes,
uint32_t source, OTF_KeyValueList *list);
int handleRMAEnd( void *userData, uint64_t time, uint32_t process, uint32_t remote,
uint32_t communicator, uint32_t tag, uint32_t source, OTF_KeyValueList *list);
/* snapshots */
int handleSnapshotComment (void *userData, uint64_t time, uint32_t process, const char *comment,
OTF_KeyValueList *list);
int handleEnterSnapshot (void *userData, uint64_t time, uint64_t originaltime, uint32_t function,
uint32_t process, uint32_t source, OTF_KeyValueList *list);
int handleSendSnapshot (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);
int handleOpenFileSnapshot (void *userData, uint64_t time, uint64_t originaltime, uint32_t fileid,
uint32_t process, uint64_t handleid, uint32_t source, OTF_KeyValueList *list);
int handleBeginCollopSnapshot(void *userData, uint64_t time, uint64_t originaltime, uint32_t process,
uint32_t collOp, uint64_t matchingId, uint32_t procGroup, uint32_t rootProc, uint64_t sent,
uint64_t received, uint32_t scltoken, OTF_KeyValueList *list);
int handleBeginFileOpSnapshot(void *userData, uint64_t time, uint64_t originaltime, uint32_t process,
uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList *list);
/* statistics */
int handleSummaryComment (void *userData, uint64_t time, uint32_t process,
const char *comment, OTF_KeyValueList *list);
int handleFunctionSummary (void *userData, uint64_t time, uint32_t function,
uint32_t process, uint64_t invocations, uint64_t exclTime, uint64_t inclTime,
OTF_KeyValueList *list);
int handleFunctionGroupSummary (void *userData, uint64_t time, uint32_t funcGroup,
uint32_t process, uint64_t invocations, uint64_t exclTime, uint64_t inclTime,
OTF_KeyValueList *list);
int handleMessageSummary (void *userData, uint64_t time, uint32_t process, uint32_t peer,
uint32_t comm, uint32_t type, uint64_t sentNumber, uint64_t receivedNumber,
uint64_t sentBytes, uint64_t receivedBytes, OTF_KeyValueList *list);
int handleCollopSummary (void *userData, uint64_t time, uint32_t process, uint32_t comm,
uint32_t collective, uint64_t sentNumber, uint64_t receivedNumber, uint64_t sentBytes,
uint64_t receivedBytes, OTF_KeyValueList *list);
int handleFileOperationSummary (void *userData, uint64_t time, uint32_t fileid,
uint32_t process, uint64_t nopen, uint64_t nclose, uint64_t nread, uint64_t nwrite,
uint64_t nseek, uint64_t bytesread, uint64_t byteswrite, OTF_KeyValueList *list);
int handleFileGroupOperationSummary (void *userData, uint64_t time, uint32_t groupid,
uint32_t process, uint64_t nopen, uint64_t nclose, uint64_t nread, uint64_t nwrite,
uint64_t nseek, uint64_t bytesread, uint64_t byteswrite, OTF_KeyValueList *list);
/* marker */
int handleDefMarker( void *userData, uint32_t stream, uint32_t token, const char *name,
uint32_t type, OTF_KeyValueList *list);
int handleMarker( void *userData, uint64_t time, uint32_t process, uint32_t token,
const char *text, OTF_KeyValueList *list);
/* unknown */
int handleUnknownRecord (void *userData, uint64_t time, uint32_t process, const char *record);
#endif /* HANDLER_H */

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

@ -1,988 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Johannes Spazier
*/
#include "handler.h"
#define fprintf_root if(my_rank == 0) fprintf
#define FINISH_EVERYTHING(ret) finish_everything( infile, outfile, info, &rank_data, ret )
#define SHOW_HELPTEXT if(my_rank == 0) { \
int l = 0; while( helptext[l] ) { fprintf( stdout, "%s", helptext[l++] ); } }
static const char* helptext[] = {
" otfmerge-mpi - an MPI implementation of otfmerge \n",
" \n",
" otfmerge-mpi [options] <input file name> \n",
" \n",
" options: \n",
" -h, --help show this help message \n",
" -V show OTF version \n",
" -n <n> set number of streams for output \n",
" set this to 0 for using one stream per process \n",
" default is 1 \n",
" -f <n> set max number of filehandles available per rank \n",
" -o <name> namestub of the output file (default 'out') \n",
" -rb <size> set buffersize of the reader (for each rank) \n",
" -wb <size> set buffersize of the writer (for each rank) \n",
" -stats cover statistics too \n",
" -snaps cover snapshots too \n",
" -z <zlevel> write compressed output \n",
" zlevel reaches from 0 to 9 where 0 is no \n",
" compression and 9 is the highest level \n",
" -l write long OTF format \n",
" -p show progress \n",
" \n", NULL };
int main(int argc, char **argv) {
/* for all processes */
int i, j;
int my_rank;
int num_ranks;
uint64_t ret_read;
int show_progress = 0;
int max_fhandles = 100;
char *outfile = NULL;
char *infile = NULL;
int rbufsize = 1024 * 1024;
int wbufsize = 1024 * 1024;
int format = OTF_WSTREAM_FORMAT_SHORT;
int read_stats = 0;
int read_snaps = 0;
OTF_FileCompression compression= 0;
RankData rank_data = { 0 ,NULL };
ProgressInfo *info = NULL;
GlobalData global_data;
/* only for root process (0) */
int num_cpus; /* number of cpus in input otf-file */
int *cpus; /* global array that contains all cpu-ids */
int offset;
int *p;
int num_ostreams = 1;
char *outfile_otf = NULL;
FILE *master_file = NULL;
OutStream *ostreams = NULL;
/* progress related */
uint64_t total_bytes = 0;
uint64_t cur_bytes = 0;
uint64_t cur_bytes_ges = 0;
uint64_t min, max, cur;
struct timeval tv;
/* OTF related */
OTF_Reader* reader = NULL;
OTF_WStream* wstream = NULL;
OTF_HandlerArray* handlers = NULL;
OTF_MasterControl* master = NULL;
OTF_FileManager* manager = NULL;
OTF_MapEntry* entry = NULL;
MPI_Status status;
int array_of_blocklengths[2];
MPI_Aint array_of_displacements[2];
MPI_Datatype array_of_types[2];
MPI_Aint first_var_address;
MPI_Aint second_var_address;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Comm_size(MPI_COMM_WORLD, &num_ranks);
/* store some important things in a global structure */
global_data.my_rank = my_rank;
global_data.num_ranks = num_ranks;
global_data.ranks_alive = num_ranks - 1;
/* argument handling */
if ( 1 >= argc ) {
SHOW_HELPTEXT
MPI_Finalize();
return 0;
}
for ( i = 1; i < argc; i++ ) {
if ( ( 0 == strcmp( "-o", argv[i] ) ) && ( i+1 < argc ) ) {
/* must be free'd at the end */
outfile = OTF_stripFilename( argv[i+1] );
++i;
} else if ( ( 0 == strcmp( "-n", argv[i] ) ) && ( i+1 < argc ) ) {
num_ostreams = atoi( argv[i+1] );
++i;
} else if ( 0 == strcmp( "-h", argv[i] ) || 0 == strcmp( "--help", argv[i] ) ) {
SHOW_HELPTEXT
return FINISH_EVERYTHING(0);
} else if ( 0 == strcmp( "-V", argv[i] ) ) {
fprintf_root( stdout, "%u.%u.%u \"%s\"\n", OTF_VERSION_MAJOR, OTF_VERSION_MINOR,
OTF_VERSION_SUB, OTF_VERSION_STRING );
return FINISH_EVERYTHING(0);
} else if ( 0 == strcmp( "-p", argv[i] ) ) {
show_progress = 1;
} else if ( ( 0 == strcmp( "-f", argv[i] ) ) && ( i+1 < argc ) ) {
max_fhandles = atoi( argv[i+1] );
++i;
} else if ( ( 0 == strcmp( "-rb", argv[i] ) ) && ( i+1 < argc ) ) {
rbufsize = atoi( argv[i+1] );
++i;
} else if ( ( 0 == strcmp( "-wb", argv[i] ) ) && ( i+1 < argc ) ) {
wbufsize = atoi( argv[i+1] );
++i;
} else if ( ( 0 == strcmp( "-z", argv[i] ) ) && ( i+1 < argc ) ) {
compression = atoi( argv[i+1] );
++i;
} else if ( 0 == strcmp( "-l", argv[i] ) ) {
format = OTF_WSTREAM_FORMAT_LONG;
} else if ( 0 == strcmp( "-snaps", argv[i] ) ) {
read_snaps = 1;
} else if ( 0 == strcmp( "-stats", argv[i] ) ) {
read_stats = 1;
} else {
if ( '-' != argv[i][0] ) {
/* must be free'd at the end */
infile = OTF_stripFilename( argv[i] );
} else {
fprintf_root( stderr, "Error: unknown option: '%s'\n", argv[i] );
return FINISH_EVERYTHING(1);
}
}
}
if( ! outfile ) {
outfile = strdup("out");
} else if( outfile[ strlen(outfile) -1 ] == '/' ) {
strncat( outfile, "out", 3 );
}
/* must be free'd at the end */
outfile_otf = OTF_getFilename( outfile, 0, OTF_FILETYPE_MASTER, 0, NULL);
/* check for neccessary options */
if( infile == NULL ) {
fprintf_root( stderr, "Error: no input file given.\n");
return FINISH_EVERYTHING(1);
}
if ( max_fhandles < 1 ) {
fprintf_root( stderr, "Error: less than 1 filehandle is not permitted.\n" );
return FINISH_EVERYTHING(1);
}
if ( num_ostreams < 0 ) {
fprintf_root( stderr, "Error: the number of streams must not be negative.\n" );
return FINISH_EVERYTHING(1);
}
if ( wbufsize < 0 || rbufsize < 0 ) {
fprintf_root( stderr, "Error: buffersize must be greater or equal 0.\n" );
return FINISH_EVERYTHING(1);
}
if ( my_rank == 0 ) {
/* read master of input file */
manager = OTF_FileManager_open( max_fhandles );
if( NULL == manager ) {
fprintf( stderr, "Error: unable to initialize file manager.\n" );
return FINISH_EVERYTHING(1);
}
master = OTF_MasterControl_new( manager );
OTF_MasterControl_read( master, infile );
/* get the total number of processes in the otf master file */
num_cpus = OTF_MasterControl_getrCount( master );
/* set one stream per process */
if ( num_ostreams == 0 || num_ostreams > num_cpus ) {
num_ostreams = num_cpus;
}
/* allocate memory */
ostreams = (OutStream*) malloc( num_ostreams * sizeof(OutStream) );
cpus = (int*) malloc( num_cpus * sizeof(int) );
p = cpus;
/* allocate memory for the info array */
info = (ProgressInfo*) malloc( num_ranks * sizeof(ProgressInfo) );
/* fill the global cpus-array */
i = 0;
while( 1 ) {
entry = OTF_MasterControl_getEntryByIndex( master, i );
if( entry == NULL) {
break;
}
for( j=0; (uint32_t)j < entry->n; j++) {
*p++ = entry->values[j];
}
i++;
}
/* open new master file for output */
master_file = fopen( outfile_otf, "w");
if( NULL == master_file ) {
fprintf( stderr, "Error: unable to open file \"%s\".\n", outfile_otf);
free(cpus);
free( ostreams );
OTF_MasterControl_close( master );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
/* fill all ostreams with data and write the new master file */
offset = 0;
for( i = 0; i < num_ostreams; i++ ) {
ostreams[i].id = i + 1;
ostreams[i].num_cpus = ( num_cpus / num_ostreams) +
( i < ( num_cpus % num_ostreams) ? 1 : 0 );
ostreams[i].cpus = (int*) malloc( ostreams[i].num_cpus * sizeof(int) );
/* append stream-id to new otf master file */
fprintf( master_file, "%x:", ostreams[i].id);
for(j = 0; j < ostreams[i].num_cpus; j++) {
ostreams[i].cpus[j] = cpus[offset + j];
/* append cpu-id to master file */
fprintf( master_file, "%x", ostreams[i].cpus[j]);
if ( (j + 1) < ostreams[i].num_cpus) {
fprintf( master_file, ",");
}
}
fprintf( master_file, "\n");
offset += ostreams[i].num_cpus;
}
/* close new master file */
fclose(master_file);
/* free global cpus-array, because it is not needed anymore */
if( cpus ) {
free(cpus);
cpus = NULL;
}
offset = 0;
/* send needed data to all ranks */
for( i = (num_ranks - 1); i >= 0; i-- ) {
/* get number of output-streams, rank i has to handle */
rank_data.num_ostreams = ( num_ostreams / num_ranks) +
( i < ( num_ostreams % num_ranks) ? 1 : 0 );
if( i > 0) {
/* send number of output-streams to rank i */
MPI_Ssend( &(rank_data.num_ostreams), 1, MPI_INT, i, 0, MPI_COMM_WORLD);
} else {
/* save number of output-streams for rank 0 in rank_data */
rank_data.ostreams = (OutStream*) malloc( rank_data.num_ostreams * sizeof(OutStream) );
}
info[i].num_cpus = 0;
/* go through all output-streams of rank i */
for(j = 0; j < rank_data.num_ostreams; j++) {
if( i > 0 ) {
/* send data to rank */
MPI_Ssend( &(ostreams[offset + j].id), 1, MPI_INT, i, 0, MPI_COMM_WORLD);
MPI_Ssend( &(ostreams[offset + j].num_cpus), 1, MPI_INT, i, 0, MPI_COMM_WORLD);
MPI_Ssend( ostreams[offset + j].cpus, ostreams[offset + j].num_cpus, MPI_INT, i, 0, MPI_COMM_WORLD);
} else {
/* save data for rank 0 */
rank_data.ostreams[j].id = ostreams[offset + j].id;
rank_data.ostreams[j].num_cpus = ostreams[offset + j].num_cpus;
rank_data.ostreams[j].cpus = (int*) malloc(rank_data.ostreams[j].num_cpus * sizeof(int));
memcpy(rank_data.ostreams[j].cpus, ostreams[offset + j].cpus,
rank_data.ostreams[j].num_cpus * (sizeof(int)));
}
info[i].num_cpus += ostreams[offset + j].num_cpus;
}
offset += rank_data.num_ostreams;
}
/* can be free'd here because all MPI_Ssends are finished --> they are synchron */
for( i = 0; i < num_ostreams; i++ ) {
if( ostreams[i].cpus ) {
free( ostreams[i].cpus );
ostreams[i].cpus = NULL;
}
}
if( ostreams ) {
free( ostreams );
ostreams = NULL;
}
/* initialize the info array */
for( i = 0; i < num_ranks; i++ ) {
info[i].percent = (double) info[i].num_cpus / (double) num_cpus;
info[i].request = MPI_REQUEST_NULL;
info[i].value.progress = 0.0;
info[i].value.is_alive = 1;
}
/* close master */
OTF_MasterControl_close( master );
OTF_FileManager_close( manager );
} else {
info = (ProgressInfo*) malloc( 1 * sizeof(ProgressInfo) );
info[0].request = MPI_REQUEST_NULL;
info[0].value.progress = 0.0;
info[0].value.is_alive = 1;
/* receive number of output-streams for this rank */
MPI_Recv( &(rank_data.num_ostreams), 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
/* allocate memory for output-streams */
rank_data.ostreams = (OutStream*) malloc( rank_data.num_ostreams * sizeof(OutStream) );
/* go through all output streams */
for( i = 0; i < rank_data.num_ostreams; i++ ) {
/* receive id of output-stream and number of cpus in this stream */
MPI_Recv( &(rank_data.ostreams[i].id), 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
MPI_Recv( &(rank_data.ostreams[i].num_cpus), 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
/* allocate memory for cpus in stream */
rank_data.ostreams[i].cpus = (int*) malloc( rank_data.ostreams[i].num_cpus * sizeof(int) );
/* receive all cpu-ids */
MPI_Recv( rank_data.ostreams[i].cpus, rank_data.ostreams[i].num_cpus, MPI_INT, 0, 0, MPI_COMM_WORLD, &status );
}
}
if( show_progress ) {
/* create new mpi datatype to transfer the progress */
/* struct {
double progress;
uint8_t is_alive;
};
*/
array_of_blocklengths[0] = 1;
array_of_blocklengths[1] = 1;
MPI_Address( &(info[0].value.progress), &first_var_address );
MPI_Address( &(info[0].value.is_alive), &second_var_address);
array_of_displacements[0] = (MPI_Aint) 0;
array_of_displacements[1] = second_var_address - first_var_address;
array_of_types[0] = MPI_DOUBLE;
array_of_types[1] = MPI_BYTE;
MPI_Type_struct( 2, array_of_blocklengths, array_of_displacements,
array_of_types, &(global_data.buftype) );
MPI_Type_commit( &(global_data.buftype) );
}
manager = OTF_FileManager_open( max_fhandles );
if( NULL == manager ) {
fprintf( stderr, "Error: unable to initialize file manager.\n" );
return FINISH_EVERYTHING(1);
}
/* the root process should read the definitions now */
if( my_rank == 0 ) {
wstream = OTF_WStream_open( outfile, 0, manager );
OTF_WStream_setBufferSizes( wstream, wbufsize );
OTF_WStream_setCompression( wstream, compression );
OTF_WStream_setFormat( wstream, format );
handlers = OTF_HandlerArray_open();
setDefinitionHandlerArray( handlers, wstream );
reader = OTF_Reader_open( infile, manager);
if( reader == NULL) {
fprintf( stderr, "Error: unable to open file %s.\n", infile );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
OTF_Reader_setBufferSizes( reader, rbufsize );
if( OTF_READ_ERROR == OTF_Reader_readDefinitions( reader, handlers ) ) {
fprintf( stderr, "Error: while reading definitions from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
if( OTF_READ_ERROR == OTF_Reader_readMarkers( reader, handlers ) ) {
fprintf( stderr, "Error: while reading markers from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
/* close everything */
OTF_HandlerArray_close( handlers );
OTF_Reader_close( reader );
OTF_WStream_close( wstream );
}
/*MPI_Barrier(MPI_COMM_WORLD);*/
for( i = 0; i < rank_data.num_ostreams; i++ ) {
total_bytes = 0;
cur_bytes = 0;
cur_bytes_ges = 0;
wstream = OTF_WStream_open( outfile, rank_data.ostreams[i].id, manager );
OTF_WStream_setBufferSizes( wstream, wbufsize );
OTF_WStream_setCompression( wstream, compression );
OTF_WStream_setFormat( wstream, format );
handlers = OTF_HandlerArray_open();
setEventHandlerArray( handlers, wstream );
reader = OTF_Reader_open( infile, manager);
if( reader == NULL) {
fprintf_root( stderr, "Error: unable to open file %s.\n", infile );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
OTF_Reader_setBufferSizes( reader, rbufsize );
OTF_Reader_setProcessStatusAll ( reader, 0 );
for( j = 0; j < rank_data.ostreams[i].num_cpus; j++ ) {
OTF_Reader_setProcessStatus( reader, rank_data.ostreams[i].cpus[j], 1 );
}
if( show_progress ) {
OTF_Reader_setRecordLimit( reader, 0 );
if( OTF_READ_ERROR == OTF_Reader_readEvents( reader, handlers ) ) {
fprintf( stderr, "Error: while reading events from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
if( read_snaps ) {
if( OTF_READ_ERROR == OTF_Reader_readSnapshots( reader, handlers ) ) {
fprintf( stderr, "Error: while reading snaphots from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
}
if( read_stats ) {
if( OTF_READ_ERROR == OTF_Reader_readStatistics( reader, handlers ) ) {
fprintf( stderr, "Error: while reading statistics from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
}
OTF_Reader_eventBytesProgress( reader, &min, &cur, &max );
/* (min - max) is erroneous because with small traces min == max --> division by zero */
total_bytes += max; /* max - min */
if( read_snaps ) {
OTF_Reader_snapshotBytesProgress( reader, &min, &cur, &max );
total_bytes += max; /* max - min */
}
if( read_stats ) {
OTF_Reader_statisticBytesProgress( reader, &min, &cur, &max );
total_bytes += max; /* max - min */
}
OTF_Reader_setRecordLimit( reader, 100000 );
}
while( 0 != ( ret_read = OTF_Reader_readEvents( reader, handlers ) ) ) {
if( ret_read == OTF_READ_ERROR) {
fprintf( stderr, "Error: while reading events from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
if( show_progress ) {
OTF_Reader_eventBytesProgress( reader, &min, &cur, &max );
cur_bytes = cur; /* cur - min */
/* calculate rank specific progress for the current stream */
global_data.tmp_progress = (double) ( (double) cur_bytes / (double) total_bytes );
update_progress( info, &global_data, i, rank_data.num_ostreams );
}
}
cur_bytes_ges = cur_bytes;
/* read snapshots */
if( read_snaps ) {
while( 0 != ( ret_read = OTF_Reader_readSnapshots( reader, handlers ) ) ) {
if( ret_read == OTF_READ_ERROR) {
fprintf( stderr, "Error: while reading snapshots from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
if( show_progress ) {
OTF_Reader_snapshotBytesProgress( reader, &min, &cur, &max );
cur_bytes = cur; /* cur - min */
/* calculate rank specific progress for the current stream */
global_data.tmp_progress = (double) ( (double) (cur_bytes + cur_bytes_ges) / (double) total_bytes );
update_progress( info, &global_data, i, rank_data.num_ostreams );
}
}
}
cur_bytes_ges += cur_bytes;
/* read statistics */
if( read_stats ) {
while( 0 != ( ret_read = OTF_Reader_readStatistics( reader, handlers ) ) ) {
if( ret_read == OTF_READ_ERROR) {
fprintf( stderr, "Error: while reading statistics from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
if( show_progress ) {
OTF_Reader_statisticBytesProgress( reader, &min, &cur, &max );
cur_bytes = cur; /* cur - min */
/* calculate rank specific progress for the current stream */
global_data.tmp_progress = (double) ( (double) (cur_bytes + cur_bytes_ges) / (double) total_bytes );
update_progress( info, &global_data, i, rank_data.num_ostreams );
}
}
}
/* read markers */
while( 0 != ( ret_read = OTF_Reader_readMarkers( reader, handlers ) ) ) {
if( ret_read == OTF_READ_ERROR) {
fprintf( stderr, "Error: while reading markers from file %s\n", infile );
OTF_Reader_close( reader );
OTF_HandlerArray_close( handlers );
OTF_WStream_close( wstream );
OTF_FileManager_close( manager );
return FINISH_EVERYTHING(1);
}
}
/* close everything */
OTF_HandlerArray_close( handlers );
OTF_Reader_close( reader );
OTF_WStream_close( wstream );
}
/* wait for other processes to finish */
if( show_progress ) {
if( my_rank == 0 ) {
/* set own progress to 100 % */
global_data.tmp_progress = 1.0;
/* check every 0.2 sec for new progress until all ranks have finished */
while( 1 ) {
/* update_progress() returns 0 if all ranks finished */
if( ! update_progress( info, &global_data, 0, 1) ) {
break;
}
/* sleep 0.2 s --> select is used because of portability */
tv.tv_sec = 0;
tv.tv_usec = 200000;
select(0, NULL, NULL, NULL, &tv);
}
printf("%7.2f %% done\n", 100.0);
fflush( stdout );
/* clear all open requests in info array */
for( i = 1; i < num_ranks; i++ ) {
if( info[i].request != MPI_REQUEST_NULL ) {
MPI_Cancel( &(info[i].request) );
}
}
} else {
/* rank != 0 has finished and sends a last message to ranks 0 */
/* first wait until the previous msg was received by rank 0 */
MPI_Wait( &(info[0].request), &status );
/* fill buffer with valid values */
info[0].value.progress = 100.0;
info[0].value.is_alive = 0;
/* send message and wait until the buffer is free for reuse */
MPI_Isend( &(info[0].value.progress), 1, global_data.buftype, 0, 0, MPI_COMM_WORLD, &(info[0].request));
MPI_Wait( &(info[0].request), &status );
}
}
OTF_FileManager_close( manager );
/* clear everything and exit */
return FINISH_EVERYTHING(0);
}
double update_progress( ProgressInfo* info, GlobalData *data, int cur_ostream, int num_ostreams) {
/* progress is a sum of all progresses sent by other ranks (proportionable) */
static double progress = 0.0;
static int tmp = 0;
MPI_Status status;
int flag = 0;
int j;
char signs[2] = {' ','.'};
if( data->my_rank != 0 ) {
/* check if previous msg was received by rank 0 already
--> if not, do nothing in this function;
else calculate new progress and send the result to root later on */
MPI_Test( &(info[0].request), &flag, &status );
}
/* calculate progress if necessary */
if( data->my_rank == 0 || flag ) {
info[0].value.progress = data->tmp_progress / (double)num_ostreams
+ (double)cur_ostream * ( 1.0 / (double)num_ostreams );
info[0].value.progress *= 100.0;
}
/* show progress */
if( data->my_rank == 0) {
/* set the roots progress as the global progress first (in the rigth proportion) */
progress = info[0].value.progress * info[0].percent;
/* listen to all ranks for new messages */
for( j = 1; j < data->num_ranks; j++ ) {
/* check if a new MPI_Irecv is necessary/if the previous msg was received */
if ( MPI_REQUEST_NULL == info[j].request ) {
/* irecv with derived datatype --> double progress, uint8_t is_alive */
MPI_Irecv( &(info[j].buf.progress), 1, data->buftype, j, 0, MPI_COMM_WORLD, &(info[j].request) );
}
/* test if current msg was received */
MPI_Test( &(info[j].request), &flag, &status );
if( flag ) {
/* got new values */
/* MPI_REQUEST_NULL indicates that a new MPI_Irecv is necessary */
info[j].request = MPI_REQUEST_NULL;
/* the receive-buffer must be copied because its value is needed later on
and the buffer itself is locked by MPI_Irecv */
info[j].value.progress = info[j].buf.progress;
/* check if it was the last msg from rank j
--> the second field of the buffer (is_alive) would be 0 */
if( ! info[j].buf.is_alive ) {
/* decrease the number of still living ranks */
data->ranks_alive--;
}
}
/* add the progress of rank j proportionally to the global progress */
progress += info[j].value.progress * info[j].percent;
}
/* print progress */
printf("%7.2f %% %c\r", progress, signs[tmp]);
fflush(stdout);
tmp ^= 1;
} else {
/* flag is only set if the send-buffer can be used again and a msg is necessary therefore */
if( flag ) {
/* send in synchronous mode --> this is because with MPI_Test we want to know if the root has
started a matching receive operation already and not only if we can reuse the send-buffer */
MPI_Issend( &(info[0].value.progress), 1, data->buftype, 0, 0, MPI_COMM_WORLD, &(info[0].request));
}
}
/* returns 0 if all ranks have finished */
return data->ranks_alive;
}
int finish_everything( char *infile, char* outfile, ProgressInfo* info, RankData* data, int ret ) {
int i;
if( infile )
free( infile );
if( outfile )
free( outfile );
if( info )
free( info );
if ( data->ostreams ) {
for( i = 0; i < data->num_ostreams; i++ ) {
if( data->ostreams[i].cpus )
free( data->ostreams[i].cpus );
}
free( data->ostreams );
}
if( ret == 0 ) {
MPI_Finalize();
} else {
MPI_Abort( MPI_COMM_WORLD, ret );
}
return ret;
}

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

@ -1,19 +1,18 @@
INCLUDES = -I$(top_builddir)/otflib -I$(top_srcdir)/otflib
if AMBUILDBINARIES
bin_PROGRAMS = \
otfmerge
if AMHAVEMPI
SUBDIRS = . mpi
endif
otfmerge_LDADD = $(top_builddir)/otflib/libotf.la
otfmerge_DEPENDENCIES = $(otfmerge_LDADD)
otfmerge_SOURCES = \
handler.h \
hash.h \
otfmerge.c \
handler.c \
hash.c
if AMBUILDBINARIES
bin_PROGRAMS = otfmerge
endif
OTFMERGESRCDIR = $(srcdir)
include $(srcdir)/Makefile.common
INCLUDES = $(COMMONINCLUDES)
otfmerge_CFLAGS = $(COMMONCFLAGS)
otfmerge_LDADD = $(COMMONLDADD)
otfmerge_DEPENDENCIES = $(COMMONDEPENDENCIES)
otfmerge_SOURCES = $(COMMONSOURCES)
EXTRA_DIST = \
otfmerge_vs08.vcproj

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

@ -0,0 +1,13 @@
COMMONINCLUDES = \
-I$(OTFMERGESRCDIR) \
-I$(top_builddir)/otflib -I$(top_srcdir)/otflib \
-I$(top_builddir)/otfauxlib -I$(top_srcdir)/otfauxlib
COMMONCFLAGS =
COMMONLDADD = $(top_builddir)/otflib/libotf.la
COMMONDEPENDENCIES = $(top_builddir)/otflib/libotf.la
COMMONSOURCES = \
$(OTFMERGESRCDIR)/handler.h \
$(OTFMERGESRCDIR)/handler.c \
$(OTFMERGESRCDIR)/otfmerge.c

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

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

@ -1,281 +1,163 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
Authors: Johannes Spazier
*/
#ifndef HANDLER_H
#define HANDLER_H
#ifdef HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include "OTF_inttypes.h"
#include "OTF_Writer.h"
#if defined(HAVE_SYS_SELECT_H) && HAVE_SYS_SELECT_H
# include <sys/select.h>
#else /* HAVE_SYS_SELECT_H */
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
#endif /* HAVE_SYS_SELECT_H */
#ifdef OTFMERGE_MPI
# include "mpi.h"
#endif /* OTFMERGE_MPI */
#include "otf.h"
/* data structures */
typedef struct {
uint32_t deftoken;
char *name;
uint32_t group;
uint32_t scltoken;
}functionT;
int id;
int num_cpus;
int *cpus;
} OutStream;
typedef struct {
uint32_t deftoken;
char* name;
}functiongroupT;
int num_ostreams;
OutStream *ostreams;
} RankData;
typedef struct {
uint32_t streamid;
uint64_t ticksPerSecond;
functionT *functions;
int nfunctions; /* number of functions in the functioninfo-array */
int sfunctions; /* size of the functioninfo-array */
functiongroupT *functiongroups;
int nfunctiongroups; /* number of groups in the functiongroup-array */
int sfunctiongroups; /* size of the functiongroups-array */
}streaminfoT;
typedef struct hashtabS
{
streaminfoT entry;
int entryvecsize;
streaminfoT *p_entryvec;
}hashtabT;
double progress;
uint8_t is_alive;
} ProgressBuf;
typedef struct {
#ifdef OTFMERGE_MPI
MPI_Request request;
#endif /* OTFMERGE_MPI */
ProgressBuf value;
ProgressBuf buf;
int num_cpus;
double percent;
} ProgressInfo;
OTF_Writer *writer;
hashtabT *hash;
int nstreaminfos; /* number of streams in the streaminfos-array */
int error;
}fcbT;
/* *** Definition handler *** ************************************* */
int handleDefinitionComment( void* firsthandlerarg, uint32_t streamid,
const char* comment, OTF_KeyValueList *list );
int handleDefTimerResolution( void* firsthandlerarg,
uint32_t streamid, uint64_t ticksPerSecond, OTF_KeyValueList *list );
int handleDefProcess( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, uint32_t paren, OTF_KeyValueList *list );
int handleDefProcessGroup( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, uint32_t n, uint32_t* array, OTF_KeyValueList *list );
int handleDefAttributeList( void* userData, uint32_t stream,
uint32_t attr_token, uint32_t num, OTF_ATTR_TYPE* array, OTF_KeyValueList* list );
int handleDefProcessOrGroupAttributes( void* userData, uint32_t stream,
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList* list );
int handleDefFunction( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, uint32_t group, uint32_t scltoken, OTF_KeyValueList *list );
int handleDefFunctionGroup( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, OTF_KeyValueList *list );
int handleDefCollectiveOperation( void* firsthandlerarg, uint32_t streamid,
uint32_t collOp, const char* name, uint32_t type, OTF_KeyValueList *list );
int handleDefCounter( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, uint32_t properties,
uint32_t countergroup, const char* unit, OTF_KeyValueList *list );
int handleDefCounterGroup( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* name, OTF_KeyValueList *list );
int handleDefScl( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, uint32_t sclfile, uint32_t sclline, OTF_KeyValueList *list );
int handleDefSclFile( void* firsthandlerarg, uint32_t streamid,
uint32_t deftoken, const char* filename, OTF_KeyValueList *list );
int handleDefCreator( void* firsthandlerarg, uint32_t streamid,
const char* creator, OTF_KeyValueList *list );
int handleDefFile( void* firsthandlerarg, uint32_t stream, uint32_t token,
const char* name, uint32_t group, OTF_KeyValueList *list );
int handleDefFileGroup( void* firsthandlerarg, uint32_t stream,
uint32_t token, const char* name, OTF_KeyValueList *list );
int handleDefKeyValue( void *fcbx, uint32_t streamid, uint32_t token,
OTF_Type type, const char *name, const char *desc, OTF_KeyValueList *list);
int handleDefTimeRange( void* fcbx,
uint32_t streamid,
uint64_t minTime,
uint64_t maxTime,
OTF_KeyValueList* list );
int handleDefCounterAssignments( void* fcbx,
uint32_t streamid,
uint32_t counter_token,
uint32_t number_of_members,
const uint32_t* procs_or_groups,
OTF_KeyValueList* list );
/* *** Event handler *** ****************************************** */
int handleNoOp( void* firsthandlerarg, uint64_t time,
uint32_t process, OTF_KeyValueList *list );
int handleEventComment( void* firsthandlerarg, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList *list );
int handleCounter( void* firsthandlerarg, uint64_t time,
uint32_t process, uint32_t counter_token, uint64_t value, OTF_KeyValueList *list );
int handleEnter( void* firsthandlerarg, uint64_t time,
uint32_t statetoken, uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList *list );
int handleCollectiveOperation( void* firsthandlerarg, uint64_t time,
uint32_t process, uint32_t functionToken, uint32_t communicator,
uint32_t rootprocess, uint32_t sent, uint32_t received,
uint64_t duration, uint32_t scltoken, OTF_KeyValueList *list );
int handleBeginCollectiveOperation( void* fcb, uint64_t time, uint32_t process,
uint32_t collOp, uint64_t matchingId, uint32_t procGroup,
uint32_t rootprocess, uint64_t sent, uint64_t received,
uint32_t scltoken, OTF_KeyValueList *list );
int handleEndCollectiveOperation( void* fcb, uint64_t time, uint32_t process,
uint64_t matchingId, OTF_KeyValueList *list );
int handleRecvMsg( void* firsthandlerarg, uint64_t time,
uint32_t receiver, uint32_t sender, uint32_t communicator,
uint32_t msgtype, uint32_t msglength,
uint32_t scltoken, OTF_KeyValueList *list );
int handleSendMsg( void* firsthandlerarg, uint64_t time,
uint32_t sender, uint32_t receiver, uint32_t communicator,
uint32_t msgtype, uint32_t msglength, uint32_t scltoken, OTF_KeyValueList *list );
int handleLeave( void* firsthandlerarg, uint64_t time,
uint32_t statetoken, uint32_t cpuid, uint32_t scltoken, OTF_KeyValueList *list );
int handleBeginProcess( void* firsthandlerarg, uint64_t time,
uint32_t process, OTF_KeyValueList *list );
int handleEndProcess( void* firsthandlerarg, uint64_t time,
uint32_t process, OTF_KeyValueList *list );
int handleFileOperation( void* firsthandlerarg, uint64_t time, uint32_t fileid,
uint32_t process, uint64_t handleid, uint32_t operation, uint64_t bytes,
uint64_t duration, uint32_t source, OTF_KeyValueList *list );
int handleBeginFileOperation( void* fcb, uint64_t time, uint32_t process,
uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList *list );
int handleEndFileOperation( void* fcb, uint64_t time, uint32_t process,
uint32_t fileid, uint64_t matchingId, uint64_t handleId, uint32_t operation,
uint64_t bytes, uint32_t scltoken, OTF_KeyValueList *list );
int handleRMAPut( void* firsthandlerarg, uint64_t time, uint32_t process,
uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
uint64_t bytes, uint32_t scltoken, OTF_KeyValueList *list );
int handleRMAPutRemoteEnd( void* firsthandlerarg, uint64_t time,
uint32_t process, uint32_t origin, uint32_t target,
uint32_t communicator, uint32_t tag, uint64_t bytes,
uint32_t scltoken, OTF_KeyValueList *list );
int handleRMAGet( void* firsthandlerarg, uint64_t time, uint32_t process,
uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
uint64_t bytes, uint32_t scltoken, OTF_KeyValueList *list);
int handleRMAEnd( void* firsthandlerarg, uint64_t time, uint32_t process,
uint32_t remote, uint32_t communicator, uint32_t tag, uint32_t scltoken, OTF_KeyValueList *list );
typedef struct {
int my_rank;
int num_ranks;
int ranks_alive;
double tmp_progress;
#ifdef OTFMERGE_MPI
MPI_Datatype buftype;
#endif /* OTFMERGE_MPI */
} GlobalData;
/* *** Handlers for OTF snapshot records ****************************** */
/* function declarations */
double update_progress( ProgressInfo* info, GlobalData* data, int cur_ostream,
int num_ostreams );
int finish_everything( char *infile, char* outfile, ProgressInfo* info,
RankData* rank_data, int ret );
void setDefinitionHandlerArray( OTF_HandlerArray* handlers,
OTF_WStream* wstream);
void setEventHandlerArray( OTF_HandlerArray* handlers, OTF_WStream* wstream );
int handleSnapshotComment( void *firsthandlerarg, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList *list );
int handleEnterSnapshot( void *firsthandlerarg, uint64_t time,
uint64_t originaltime, uint32_t function, uint32_t process,
uint32_t source, OTF_KeyValueList *list );
/* handlers */
int handleSendSnapshot( void *firsthandlerarg, 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 );
int handleOpenFileSnapshot( void* firsthandlerarg, uint64_t time,
uint64_t originaltime, uint32_t fileid, uint32_t process,
uint64_t handleid, uint32_t source, OTF_KeyValueList *list );
int handleDefinitionComment( void *userData, uint32_t stream,
const char *comment, OTF_KeyValueList *list );
int handleBeginCollopSnapshot( void *fcb, uint64_t time,
uint64_t originaltime, uint32_t process, uint32_t collOp,
uint64_t matchingId, uint32_t procGroup, uint32_t rootProc,
uint64_t sent, uint64_t received, uint32_t scltoken, OTF_KeyValueList *list);
int handleBeginFileOpSnapshot( void *userData, uint64_t time,
uint64_t originaltime, uint32_t process, uint64_t matchingId,
uint32_t scltoken, OTF_KeyValueList *list);
/* *** Summary handler *** ****************************************** */
int handleDefTimerResolution( void *userData, uint32_t stream,
uint64_t ticksPerSecond, OTF_KeyValueList *list );
int handleSummaryComment( void* firsthandlerarg, uint64_t time,
uint32_t process, const char* comment, OTF_KeyValueList *list );
int handleFunctionSummary( void* firsthandlerarg,
uint64_t time, uint32_t function, uint32_t process,
uint64_t count, uint64_t excltime, uint64_t incltime, OTF_KeyValueList *list );
int handleDefProcess( void *userData, uint32_t stream, uint32_t process,
const char *name, uint32_t parent, OTF_KeyValueList *list );
int handleFunctionGroupSummary( void* firsthandlerarg,
uint64_t time, uint32_t functiongroup, uint32_t process,
uint64_t count, uint64_t excltime, uint64_t incltime, OTF_KeyValueList *list );
int handleDefProcessGroup( void *userData, uint32_t stream, uint32_t procGroup,
const char *name, uint32_t numberOfProcs, const uint32_t *procs,
OTF_KeyValueList *list );
int handleMessageSummary( void* firsthandlerarg,
uint64_t time, uint32_t process, uint32_t peer,
uint32_t comm, uint32_t tag, uint64_t number_sent, uint64_t number_recvd,
uint64_t bytes_sent, uint64_t bytes_recved, OTF_KeyValueList *list );
int handleDefAttributeList( void *userData, uint32_t stream,
uint32_t attr_token, uint32_t num, OTF_ATTR_TYPE *array,
OTF_KeyValueList *list );
int handleCollopSummary( void* firsthandlerarg,
uint64_t time, uint32_t process, uint32_t comm, uint32_t collective,
uint64_t number_sent, uint64_t number_recvd, uint64_t bytes_sent,
uint64_t bytes_recved, OTF_KeyValueList *list );
int handleDefProcessOrGroupAttributes( void *userData, uint32_t stream,
uint32_t proc_token, uint32_t attr_token, OTF_KeyValueList *list);
int handleDefFunction( void *userData, uint32_t stream, uint32_t func,
const char *name, uint32_t funcGroup, uint32_t source,
OTF_KeyValueList *list );
int handleFileOperationSummary( void* firsthandlerarg, uint64_t time, uint32_t fileid,
uint32_t process, uint64_t nopen, uint64_t nclose, uint64_t nread,
uint64_t nwrite, uint64_t nseek, uint64_t bytesread, uint64_t byteswrite, OTF_KeyValueList *list );
int handleDefFunctionGroup( void *userData, uint32_t stream, uint32_t funcGroup,
const char *name, OTF_KeyValueList *list );
int handleFileGroupOperationSummary( void* firsthandlerarg, uint64_t time,
uint32_t groupid, uint32_t process, uint64_t nopen, uint64_t nclose,
uint64_t nread, uint64_t nwrite, uint64_t nseek, uint64_t bytesread,
uint64_t byteswrite, OTF_KeyValueList *list );
int handleDefCollectiveOperation(void *userData, uint32_t stream,
uint32_t collOp, const char *name, uint32_t type,
OTF_KeyValueList *list );
int handleDefCounter( void *userData, uint32_t stream, uint32_t counter,
const char *name, uint32_t properties, uint32_t counterGroup,
const char *unit, OTF_KeyValueList *list );
/* *** Marker handler *** ******************************************* */
int handleDefCounterGroup( void *userData, uint32_t stream,
uint32_t counterGroup, const char *name, OTF_KeyValueList *list );
int handleDefScl( void *userData, uint32_t stream, uint32_t source,
uint32_t sourceFile, uint32_t line, OTF_KeyValueList *list );
int handleDefMarker( void *userData, uint32_t stream,
uint32_t token, const char* name, uint32_t type, OTF_KeyValueList *list );
int handleDefSclFile( void *userData, uint32_t stream, uint32_t sourceFile,
const char *name, OTF_KeyValueList *list );
int handleMarker( void *userData, uint64_t time,
uint32_t process, uint32_t token, const char* text, OTF_KeyValueList *list );
int handleDefCreator( void *userData, uint32_t stream, const char *creator,
OTF_KeyValueList *list );
/* *** Misc handlers *** ******************************************** */
int handleDefVersion( void *userData, uint32_t stream, uint8_t major,
uint8_t minor, uint8_t sub, const char *string );
int handleUnknown( void* fcb, uint64_t time, uint32_t process, const char* record );
int handleDefFile( void *userData, uint32_t stream, uint32_t token,
const char *name, uint32_t group, OTF_KeyValueList *list );
int handleDefFileGroup( void *userData, uint32_t stream, uint32_t token,
const char *name, OTF_KeyValueList *list );
#endif /* OTF_handleH */
int handleDefKeyValue( void *userData, uint32_t stream, uint32_t token,
OTF_Type type, const char *name, const char *desc,
OTF_KeyValueList *list );
int handleDefTimeRange( void* userData, uint32_t stream, uint64_t minTime,
uint64_t maxTime, OTF_KeyValueList *list );
int handleDefCounterAssignments( void* userData, uint32_t stream,
uint32_t counter_token, uint32_t number_of_members,
const uint32_t* procs_or_groups, OTF_KeyValueList *list );
int handleDefProcessSubstitutes( void* userData, uint32_t stream,
uint32_t representative, uint32_t numberOfProcs, const uint32_t* procs,
OTF_KeyValueList *list );
int handleDefMarker( void *userData, uint32_t stream, uint32_t token,
const char *name, uint32_t type, OTF_KeyValueList *list );
int handleUnknownRecord( void *userData, uint64_t time, uint32_t process,
const char *record );
#endif /* HANDLER_H */

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

@ -1,163 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include "hash.h"
hashtabT* hash_new( ) {
int i;
hashtabT* ret;
ret = ( hashtabT* ) malloc( sizeof( hashtabT ) * HASH_SIZE );
for( i = 0; i < HASH_SIZE; i++) {
ret[i].entry.streamid = 0;
ret[i].entry.ticksPerSecond = 0;
ret[i].entry.functions = NULL;
ret[i].entry.nfunctions = 0;
ret[i].entry.sfunctions = 0;
ret[i].entry.functiongroups = NULL;
ret[i].entry.nfunctiongroups = 0;
ret[i].entry.sfunctiongroups = 0;
ret[i].entryvecsize = -1;
ret[i].p_entryvec = 0;
}
return ret;
}
void hash_delete( hashtabT *hash ) {
int i;
int a;
int b;
for( i = 0; i < HASH_SIZE; i++) {
/* del functions (free namestrings) */
if( hash[i].entry.functions != NULL ) {
for( a= 0; a < hash[i].entry.nfunctions; ++a ) {
if( NULL != hash[i].entry.functions[a].name ) {
free( hash[i].entry.functions[a].name );
}
}
free( hash[i].entry.functions );
}
/* del functiongroups (free namestrings) */
if( hash[i].entry.functiongroups != NULL ) {
for( a= 0; a < hash[i].entry.nfunctiongroups; ++a ) {
if( NULL != hash[i].entry.functiongroups[a].name ) {
free( hash[i].entry.functiongroups[a].name );
}
}
free( hash[i].entry.functiongroups );
}
if ( hash[i].entryvecsize > 0 ) {
for( a= 0; a < hash[i].entryvecsize ; ++a ) {
/* del functions (free namestrings) */
if( hash[i].p_entryvec[a].functions != NULL ) {
for( b= 0; b < hash[i].p_entryvec[a].nfunctions; ++b ) {
if( NULL != hash[i].p_entryvec[a].functions[b].name ) {
free( hash[i].p_entryvec[a].functions[b].name );
}
}
free( hash[i].p_entryvec[a].functions );
}
/* del functiongroups (free namestrings) */
if( hash[i].p_entryvec[a].functiongroups != NULL ) {
for( b= 0; b < hash[i].p_entryvec[a].nfunctiongroups; ++b ) {
if( NULL != hash[i].p_entryvec[a].functiongroups[b].name ) {
free( hash[i].p_entryvec[a].functiongroups[b].name );
}
}
free( hash[i].p_entryvec[a].functiongroups );
}
}
free( hash[i].p_entryvec );
}
}
free( hash );
}
void hash_add( hashtabT *hash, uint32_t entry ) {
uint32_t hashkey = entry;
HASH_GET_KEY( hashkey );
if ( hash[hashkey].entryvecsize == -1 ) {
hash[hashkey].entry.streamid = entry;
hash[hashkey].entry.ticksPerSecond= 0;
hash[hashkey].entry.functions= NULL;
hash[hashkey].entry.nfunctions= 0;
hash[hashkey].entry.sfunctions= 0;
hash[hashkey].entry.functiongroups= NULL;
hash[hashkey].entry.nfunctiongroups= 0;
hash[hashkey].entry.sfunctiongroups= 0;
hash[hashkey].entryvecsize = 0;
} else { /* realloc the entryvector and insert the new entry */
hash[hashkey].p_entryvec = (streaminfoT *) realloc( hash[hashkey].p_entryvec,
sizeof( streaminfoT ) * ( hash[hashkey].entryvecsize + 1) );
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].streamid = entry;;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].ticksPerSecond= 0;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].functions= NULL;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].nfunctions= 0;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].sfunctions= 0;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].functiongroups= NULL;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].nfunctiongroups= 0;
hash[hashkey].p_entryvec[hash[hashkey].entryvecsize].sfunctiongroups= 0;
hash[hashkey].entryvecsize++;
}
}
streaminfoT* hash_search( hashtabT *hash, uint32_t entry) {
int i;
uint32_t hashkey = entry;
HASH_GET_KEY( hashkey );
if ( hash[hashkey].entry.streamid == entry ) {
return &hash[hashkey].entry;
} else {
for( i = 0; i < hash[hashkey].entryvecsize; i++ ) {
if ( hash[hashkey].p_entryvec[i].streamid == entry )
return &(hash[hashkey].p_entryvec[i]);
}
}
return NULL;
}

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

@ -1,41 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifndef HASH_H
#define HASH_H
#include "handler.h"
/* *** macros ****************************************/
/* 0x100 = 4096 */
#define HASH_SIZE 0x1000
#define HASH_GET_KEY(key) \
{ \
key += ~(key << 15); \
key ^= (key >> 10); \
key += (key << 3); \
key ^= (key >> 6); \
key += ~(key << 11); \
key ^= (key >> 16); \
key &= HASH_SIZE - 1; \
}
/* initialize the hash */
hashtabT* hash_new( void );
/* free all mem of the hash */
void hash_delete( hashtabT *hash );
/* add an entry to the hash */
void hash_add( hashtabT *hash, uint32_t entry );
/* search an entry in the hash */
streaminfoT* hash_search( hashtabT *hash, uint32_t entry);
#endif /* HASH_H */

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

@ -0,0 +1,16 @@
if AMBUILDBINARIES
bin_PROGRAMS = otfmerge-mpi
endif
OTFMERGESRCDIR = $(srcdir)/..
include $(srcdir)/../Makefile.common
CC = $(MPICC)
INCLUDES = $(COMMONINCLUDES) $(MPI_INCLUDE_LINE)
otfmerge_mpi_CFLAGS = -DOTFMERGE_MPI $(COMMONCFLAGS) $(MPICFLAGS)
otfmerge_mpi_LDADD = $(COMMONLDADD) $(MPI_LIB_LINE)
otfmerge_mpi_DEPENDENCIES = $(COMMONDEPENDENCIES)
otfmerge_mpi_SOURCES = $(COMMONSOURCES)

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

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

@ -1,386 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="otfmerge"
ProjectGUID="{1B9223C8-DE20-4538-8214-776C6017D22B}"
RootNamespace="otfmerge"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../debug"
IntermediateDirectory="tmp"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../;../../otflib/"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
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="VCLinkerTool"
AdditionalDependencies="libotf.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../../debug"
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../;../../otflib/"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_ZLIB"
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="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release Static|Win32"
OutputDirectory="../../release_static_32bit"
IntermediateDirectory="tmp_32bit"
ConfigurationType="1"
UseOfMFC="0"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../;../../otflib/"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libotf.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../release_static_32bit"
IgnoreAllDefaultLibraries="false"
DelayLoadDLLs="$(NOINHERIT)"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release Static|x64"
OutputDirectory="../../release_static_64bit"
IntermediateDirectory="tmp_64bit"
ConfigurationType="1"
UseOfMFC="0"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../;../../otflib/"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libotf.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../release_static_64bit"
IgnoreAllDefaultLibraries="false"
DelayLoadDLLs="$(NOINHERIT)"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Quelldateien"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\handler.c"
>
</File>
<File
RelativePath=".\hash.c"
>
</File>
<File
RelativePath=".\otfmerge.c"
>
</File>
</Filter>
<Filter
Name="Headerdateien"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\handler.h"
>
</File>
<File
RelativePath=".\hash.h"
>
</File>
</Filter>
<Filter
Name="Ressourcendateien"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

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

@ -1,29 +0,0 @@
INCLUDES = \
-I$(top_builddir)/otflib -I$(top_srcdir)/otflib \
-I$(top_builddir)/otfauxlib -I$(top_srcdir)/otfauxlib \
$(MPI_INCLUDE_LINE)
if AMBUILDBINARIES
bin_PROGRAMS = \
otfprofile-mpi
endif
CXX = $(MPICXX)
otfprofile_mpi_CXXFLAGS = $(MPICXXFLAGS)
otfprofile_mpi_LDADD = $(top_builddir)/otflib/libotf.la $(MATHLIB) $(MPI_LIB_LINE)
otfprofile_mpi_DEPENDENCIES = $(top_builddir)/otflib/libotf.la
otfprofile_mpi_SOURCES = \
collect_data.h \
create_latex.h \
datastructs.h \
otfprofile-mpi.h \
reduce_data.h \
summarize_data.h \
collect_data.cpp \
create_latex.cpp \
otfprofile-mpi.cpp \
reduce_data.cpp \
summarize_data.cpp \
summarize_data.h

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

@ -1,906 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Robert Dietrich, Matthias Jurenz
*/
using namespace std;
#include <cassert>
#include <iostream>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "otf.h"
#include "OTF_Platform.h"
#include "collect_data.h"
#include "otfprofile-mpi.h"
#include "summarize_data.h"
#include "reduce_data.h"
#include "create_latex.h"
/* define the following macro to synchronize the error indicator with all
worker ranks
This enforces that all ranks will be terminated by calling MPI_Abort if
anyone fails. This is necessary to work around a bug that appears at least
with Open MPI where calling MPI_Abort on one task doesn't terminate all
other ranks. */
#define SYNC_ERROR
/* define the following macro to print result data to stdout */
/*#define SHOW_RESULTS*/
/* parse command line options
return 0 if succeeded, 1 if help text or version showed, -1 if failed */
static int parse_command_line( int argc, char** argv, AllData& alldata );
/* assign trace processes to analysis processes explicitly in order to allow
sophisticated grouping of MPI ranks/processes/threads/GPU threads/etc.
in the future, return true if succeeded */
static bool assign_procs_to_ranks( AllData& alldata );
#ifdef SHOW_RESULTS
/* show results on stdout */
static void show_results( const AllData& alldata );
#endif /* SHOW_RESULTS */
/* show helptext */
static void show_helptext( void );
int main( int argc, char** argv ) {
int ret= 0;
/* start MPI */
int my_rank;
int num_ranks;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank );
MPI_Comm_size(MPI_COMM_WORLD, &num_ranks );
AllData alldata( my_rank, num_ranks );
do {
/* step 0: parse command line options */
if ( 0 != ( ret= parse_command_line( argc, argv, alldata ) ) ) {
if ( 1 == ret ) {
ret= 0;
} else { /* -1 == ret */
ret= 1;
}
break;
}
VerbosePrint( alldata, 1, true, "initializing\n" );
MPI_Barrier( MPI_COMM_WORLD );
/* step 1: assign trace processes to analysis processes */
if ( !assign_procs_to_ranks( alldata ) ) {
ret= 1;
break;
}
MPI_Barrier( MPI_COMM_WORLD );
if ( 1 <= alldata.params.verbose_level && 0 == my_rank ) {
alldata.measureBlockMap[ "analyze data" ].start();
}
/* step 2: collect data by reading input trace file */
if ( !CollectData( alldata ) ) {
ret= 1;
break;
}
MPI_Barrier( MPI_COMM_WORLD );
/* step 3: summarize data; every analysis rank summarizes it's local
data independently */
if ( !SummarizeData( alldata ) ) {
ret= 1;
break;
}
MPI_Barrier( MPI_COMM_WORLD );
/* step 4: reduce data to master */
if ( !ReduceData( alldata ) ) {
ret= 1;
break;
}
MPI_Barrier( MPI_COMM_WORLD );
if ( 1 <= alldata.params.verbose_level && 0 == my_rank ) {
alldata.measureBlockMap[ "analyze data" ].stop();
}
/* step 5: produce outputs */
/* step 5.1: write CSV data */
/* the master coordinates the length of each workers CSV text output,
then every worker writes the own portion of the result CSV file
(or couple of files) */
/* do later */
/* MPI_Barrier( MPI_COMM_WORLD ); */
/* the master generates the result data from the global data
reduced above */
if ( 0 == my_rank ) {
#ifdef SHOW_RESULTS
/* step 5.2: show result data on stdout */
show_results( alldata );
#endif /* SHOW_RESULTS */
alldata.measureBlockMap[ "produce output" ].start();
/* step 5.3: generate PGF output */
if ( !CreateTex( alldata ) ) {
ret= 1;
break;
}
alldata.measureBlockMap[ "produce output" ].stop();
}
} while( false );
/* either finalize or abort on error */
if ( 0 == ret ) {
/* show runtime measurement results */
if ( 1 <= alldata.params.verbose_level && 0 == my_rank ) {
cout << "runtime measurement results:" << endl;
for ( map < string, MeasureBlock >::const_iterator it=
alldata.measureBlockMap.begin();
it != alldata.measureBlockMap.end(); it++ ) {
cout << " " << it->first << ": " << it->second.duration()
<< "s" << endl;
}
}
MPI_Finalize();
VerbosePrint( alldata, 1, true, "done\n" );
} else {
MPI_Abort( MPI_COMM_WORLD, ret );
}
return ret;
}
static int parse_command_line( int argc, char** argv, AllData& alldata ) {
int ret= 0;
Params& params= alldata.params;
/* parse command line options */
enum { ERR_OK, ERR_OPT_UNKNOWN, ERR_ARG_MISSING, ERR_ARG_INVALID };
int parse_error= ERR_OK;
int i;
for ( i = 1; i < argc; i++ ) {
/* -h, --help */
if ( 0 == strcmp( "-h", argv[i] ) ||
0 == strcmp( "--help", argv[i] ) ) {
if ( 0 == alldata.myRank ) {
show_helptext();
}
ret= 1;
break;
/* -V */
} else if ( 0 == strcmp( "-V", argv[i] ) ) {
if ( 0 == alldata.myRank ) {
printf( "%u.%u.%u \"%s\"\n",
OTF_VERSION_MAJOR, OTF_VERSION_MINOR, OTF_VERSION_SUB,
OTF_VERSION_STRING );
}
ret= 1;
break;
/* -v */
} else if ( 0 == strcmp( "-v", argv[i] ) ) {
params.verbose_level++;
/* -p */
} else if ( 0 == strcmp( "-p", argv[i] ) ) {
params.progress= true;
/* -f */
} else if ( 0 == strcmp( "-f", argv[i] ) ) {
if ( i == argc - 1 ) {
parse_error= ERR_ARG_MISSING;
break;
}
int tmp= atoi( argv[i+1] );
if ( 0 >= tmp ) {
parse_error= ERR_ARG_INVALID;
break;
}
params.max_file_handles= tmp;
i++;
/* -b */
} else if ( 0 == strcmp( "-b", argv[i] ) ) {
if ( i == argc - 1 ) {
parse_error= ERR_ARG_MISSING;
break;
}
int tmp= atoi( argv[i+1] );
if ( 0 >= tmp ) {
parse_error= ERR_ARG_INVALID;
break;
}
params.buffer_size= tmp;
i++;
/* -o */
} else if ( 0 == strcmp( "-o", argv[i] ) ) {
if ( i == argc - 1 ) {
parse_error= ERR_ARG_MISSING;
break;
}
params.output_file_prefix= argv[++i];
/* --stat */
} else if ( 0 == strcmp( "--stat", argv[i] ) ) {
params.read_from_stats= true;
#if defined(PDFTEX) && defined(HAVE_PGFPLOTS_1_4) && HAVE_PGFPLOTS_1_4
/* --nopdf */
} else if ( 0 == strcmp( "--nopdf", argv[i] ) ) {
params.create_pdf= false;
#endif /* PDFTEX && HAVE_PGFPLOTS_1_4 */
/* input file or unknown option */
} else {
if ( 0 == params.input_file_prefix.length() ) {
char* tmp= OTF_stripFilename( argv[i] );
if ( tmp ) {
params.input_file_prefix= tmp;
free( tmp );
}
} else {
parse_error= ERR_OPT_UNKNOWN;
break;
}
}
}
/* show specific message on error */
if ( ERR_OK != parse_error ) {
if ( 0 == alldata.myRank ) {
switch( parse_error ) {
case ERR_OPT_UNKNOWN:
cerr << "ERROR: Unknown option '" << argv[i] << "'."
<< endl;
break;
case ERR_ARG_MISSING:
cerr << "ERROR: Expected argument for option '" << argv[i]
<< "'." << endl;
break;
case ERR_ARG_INVALID:
cerr << "ERROR: Invalid argument for option '" << argv[i]
<< "'." << endl;
break;
default:
break;
}
}
ret= -1;
/* show help text if no input trace file is given */
} else if ( 0 == params.input_file_prefix.length() ) {
if ( 0 == alldata.myRank ) {
show_helptext();
}
ret= 1;
}
return ret;
}
static bool assign_procs_to_ranks( AllData& alldata ) {
bool error= false;
OTF_FileManager* manager= NULL;
OTF_MasterControl* master= NULL;
if ( 0 == alldata.myRank ) {
/* rank 0 reads OTF master control of input trace file */
manager= OTF_FileManager_open( 1 );
assert( manager );
master= OTF_MasterControl_new( manager );
assert( master );
int master_read_ret=
OTF_MasterControl_read( master,
alldata.params.input_file_prefix.c_str() );
/* that's the first access to the input trace file; show tidy error
message if failed */
if ( 0 == master_read_ret ) {
cerr << "ERROR: Unable to open file '"
<< alldata.params.input_file_prefix << ".otf' for reading."
<< endl;
error= true;
}
}
/* broadcast error indicator to workers because Open MPI had all
ranks except rank 0 waiting endlessly in the MPI_Recv, when the '.otf' file
was absent. */
if ( SyncError( alldata, error, 0 ) ) {
return false;
}
if ( 0 == alldata.myRank ) {
do {
/* fill the global array of processes */
alldata.myProcessesNum= OTF_MasterControl_getrCount( master );
alldata.myProcessesList=
(uint32_t*)malloc( alldata.myProcessesNum * sizeof(uint32_t) );
assert( alldata.myProcessesList );
uint32_t i= 0;
uint32_t j= 0;
while( true ) {
OTF_MapEntry* entry =
OTF_MasterControl_getEntryByIndex( master, i );
if( NULL == entry) break;
for ( uint32_t k= 0; k< entry->n; k++ ) {
alldata.myProcessesList[j]= entry->values[k];
j++;
}
i++;
}
assert( alldata.myProcessesNum == j );
/* DEBUG */
/*cerr << "processes in trace: ";
for ( uint32_t k= 0; k < alldata.myProcessesNum; k++ ) {
cerr << alldata.myProcessesList[k] << " ";
}
cerr << endl;*/
/* now we may re-arrange the process list for a better layout
- note that this layout is optimal to re-use OTF streams
if there are multiple processes per stream
- one may read the OTF definitions to know how to re-arrange */
/* get number of ranks per worker, send to workers */
/* remaining ranks and remaining workers */
uint32_t r_ranks= alldata.myProcessesNum;
uint32_t r_workers= alldata.numRanks;
uint32_t pos= 0;
bool warn_for_empty= true;
for ( int w= 0; w < (int)alldata.numRanks; w++ ) {
uint32_t n= ( ( r_ranks / r_workers ) * r_workers < r_ranks) ?
( r_ranks / r_workers +1 ) : ( r_ranks / r_workers );
if ( ( 0 == n ) && warn_for_empty ) {
cerr << "Warning: more analysis ranks than trace processes, "
<< "ranks " << w << " to " << alldata.numRanks -1
<< " are unemployed" << endl;
warn_for_empty= false;
}
if ( 0 == w ) {
/* for master itself simply truncate processesList,
don't send and receive */
alldata.myProcessesNum= n;
} else {
MPI_Send( &n, 1, MPI_INT, w, 2, MPI_COMM_WORLD );
MPI_Send( alldata.myProcessesList + pos, n, MPI_INT,
w, 3, MPI_COMM_WORLD );
}
pos += n;
r_ranks -= n;
r_workers -= 1;
}
} while( false );
/* close OTF master control and file manager */
OTF_MasterControl_close( master );
OTF_FileManager_close( manager );
} else { /* 0 != my_rank */
/* workers receive number and sub-list of their ranks to process */
alldata.myProcessesNum= 0;
MPI_Status status;
MPI_Recv( &alldata.myProcessesNum, 1, MPI_INT, 0, 2, MPI_COMM_WORLD,
&status );
alldata.myProcessesList= (uint32_t*)malloc(
alldata.myProcessesNum * sizeof(uint32_t) );
assert( alldata.myProcessesList );
MPI_Recv( alldata.myProcessesList, alldata.myProcessesNum, MPI_INT, 0,
3, MPI_COMM_WORLD, &status );
}
/* DEBUG */
/*cerr << " worker " << my_rank << " handles: ";
for ( uint32_t v= 0; v < alldata.myProcessesNum; v++ ) {
cerr << alldata.myProcessesList[v] << " ";
}
cerr << endl;*/
return !error;
}
#ifdef SHOW_RESULTS
static void show_results( const AllData& alldata ) {
# define PRINT_MIN_MAX_AVG(v,u) (v.cnt) << " x avg " << ((double)(v.sum))/(v.cnt) << "(" << (v.min) << "-" << (v.max) << ") " << u
cout << endl << " global data per function: " << endl;
{
map< uint64_t, FunctionData >::const_iterator it= alldata.functionMapGlobal.begin();
map< uint64_t, FunctionData >::const_iterator itend= alldata.functionMapGlobal.end();
while ( itend != it ) {
cout << " global function " << it->first << " -> " ;
if ( it->second.count.cnt ) {
cout << "\t"<<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count,"[#]") <<
" exc: " << PRINT_MIN_MAX_AVG(it->second.excl_time,"[s]") <<
" inc: " << PRINT_MIN_MAX_AVG(it->second.incl_time,"[s]") << endl;
}
it++;
}
}
cout << endl << " global counter data per function: " << endl;
{
map< Pair, FunctionData, ltPair >::const_iterator it= alldata.counterMapGlobal.begin();
map< Pair, FunctionData, ltPair >::const_iterator itend= alldata.counterMapGlobal.end();
while ( itend != it ) {
cout << " global counter " << it->first.a << " per function " << it->first.b << " -> " << endl;
if ( it->second.count.cnt ) {
cout << "\t"<<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count,"[#]");
cout << " exc: ";
if ( it->second.excl_time.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.excl_time,"[#]");
} else {
cout << "0 [#]";
}
cout << " inc: ";
if ( it->second.incl_time.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.incl_time,"[#]");
} else {
cout << "0 [#]";
}
cout << endl;
}
it++;
}
}
cout << endl << " global message data per cluster pair: " << endl;
{
map< Pair, MessageData >::const_iterator it= alldata.messageMapPerClusterPair.begin();
map< Pair, MessageData >::const_iterator itend= alldata.messageMapPerClusterPair.end();
while ( itend != it ) {
if ( it->second.count_send.cnt ) {
cout << "\tsent " << it->first.a << " --> " << it->first.b <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_send,"[#]");
cout << " byt: ";
if ( it->second.bytes_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_send,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_send,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
if ( it->second.count_recv.cnt ) {
cout << "\trecv " << it->first.a << " <-- " << it->first.b <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_recv,"[#]");
cout << " byt: ";
if ( it->second.bytes_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_recv,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_recv,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
it++;
}
}
cout << endl << " global message data per cluster: " << endl;
{
map< uint64_t, MessageData >::const_iterator it= alldata.messageMapPerCluster.begin();
map< uint64_t, MessageData >::const_iterator itend= alldata.messageMapPerCluster.end();
while ( itend != it ) {
cout << " msg of cluster " << it->first << " -> " << endl;
if ( it->second.count_send.cnt ) {
cout << "\tsent" <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_send,"[#]");
cout << " byt: ";
if ( it->second.bytes_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_send,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_send,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
if ( it->second.count_recv.cnt ) {
cout << "\trecv" <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_recv,"[#]");
cout << " byt: ";
if ( it->second.bytes_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_recv,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_recv,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
it++;
}
}
cout << endl << " global message speed per length: " << endl;
{
map< Pair, MessageSpeedData, ltPair >::const_iterator it= alldata.messageSpeedMapPerLength.begin();
map< Pair, MessageSpeedData, ltPair >::const_iterator itend= alldata.messageSpeedMapPerLength.end();
while ( itend != it ) {
cout << " msg of speed-bin " << it->first.a << " length-bin " << it->first.b << " -> ";
if ( it->second.count.cnt ) {
cout << "\t" <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count,"[#]") << endl;
}
it++;
}
}
cout << endl << " global collective data per cluster: " << endl;
{
map< Pair, CollectiveData, ltPair >::const_iterator it= alldata.collectiveMapPerCluster.begin();
map< Pair, CollectiveData, ltPair >::const_iterator itend= alldata.collectiveMapPerCluster.end();
while ( itend != it ) {
cout << " collop of class " << it->first.a << " cluster " << it->first.b << " -> " << endl;
if ( it->second.count_send.cnt ) {
cout << "\tsent" <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_send,"[#]");
cout << " byt: ";
if ( it->second.bytes_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_send,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_send.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_send,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
if ( it->second.count_recv.cnt ) {
cout << "\trecv" <<
" cnt: " << PRINT_MIN_MAX_AVG(it->second.count_recv,"[#]");
cout << " byt: ";
if ( it->second.bytes_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.bytes_recv,"[b]");
} else {
cout << "0 [b]";
}
cout << " dur: ";
if ( it->second.duration_recv.cnt ) {
cout << PRINT_MIN_MAX_AVG(it->second.duration_recv,"[s]");
} else {
cout << "0 [s]";
}
cout << endl;
}
it++;
}
}
}
#endif /* SHOW_RESULTS */
static void show_helptext() {
cout << endl
<< " otfprofile-mpi - generate a profile of a trace in LaTeX format." << endl
<< endl
<< " Syntax: otfprofile-mpi [options] <input file name>" << endl
<< endl
<< " options:" << endl
<< " -h, --help show this help message" << endl
<< " -V show OTF version" << endl
<< " -v increase output verbosity" << endl
<< " (can be used more than once)" << endl
<< " -p show progress" << endl
<< " -f <n> max. number of filehandles available per rank" << endl
<< " (default: " << Params::DEFAULT_MAX_FILE_HANDLES << ")" << endl
<< " -b <size> set buffersize of the reader" << endl
<< " (default: " << Params::DEFAULT_BUFFER_SIZE << ")" << endl
<< " -o <prefix> specify the prefix of output file(s)" << endl
<< " (default: " << Params::DEFAULT_OUTPUT_FILE_PREFIX() << ")" << endl
<< " --stat read only summarized information, no events" << endl
#if defined(PDFTEX) && defined(HAVE_PGFPLOTS_1_4) && HAVE_PGFPLOTS_1_4
<< " --nopdf do not produce PDF output" << endl
#else /* PDFTEX && HAVE_PGFPLOTS_1_4 */
<< endl
<< " PDF creation requires the PGFPLOTS package version >1.4" << endl
<< " http://sourceforge.net/projects/pgfplots/ " << endl
#endif /* PDFTEX && HAVE_PGFPLOTS_1_4 */
<< endl;
}
void VerbosePrint( AllData& alldata, uint8_t level, bool root_only,
const char* fmt, ... ) {
if ( alldata.params.verbose_level >= level ) {
va_list ap;
va_start( ap, fmt );
/* either only rank 0 print the message */
if ( root_only ) {
if ( 0 == alldata.myRank ) {
vprintf( fmt, ap );
}
/* or all ranks print the message */
} else {
char msg[1024];
/* prepend current rank to message */
snprintf( msg, sizeof( msg ) -1, "[%u] ", alldata.myRank );
vsnprintf( msg + strlen( msg ), sizeof( msg ) -1, fmt, ap );
/* print message */
printf( "%s ", msg );
}
va_end( ap );
}
}
bool SyncError( AllData& alldata, bool& error, uint32_t root ) {
#ifdef SYNC_ERROR
if ( 1 < alldata.numRanks ) {
int buf= ( error ) ? 1 : 0;
/* either broadcast the error indicator from one rank (root)
or reduce them from all */
if ( root != (uint32_t)-1 ) {
MPI_Bcast( &buf, 1, MPI_INT, (int)root, MPI_COMM_WORLD );
error= ( 1 == buf );
} else {
int recv_buf;
MPI_Allreduce( &buf, &recv_buf, 1, MPI_INT, MPI_MAX,
MPI_COMM_WORLD );
error= ( 1 == recv_buf );
}
}
#endif /* SYNC_ERROR */
return error;
}
uint64_t Logi( uint64_t x, uint64_t b ) {
assert( b > 1 );
uint64_t c= 1;
uint64_t i= 0;
while( c <= x ) {
c*= b;
i++;
}
return i;
}

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

@ -1,30 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Robert Dietrich, Matthias Jurenz
*/
#ifndef OTFPROFILE_MPI_H
#define OTFPROFILE_MPI_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include "datastructs.h"
/* print verbose message to stdout
(if root_only is true only rank 0 will print the message) */
void VerbosePrint( AllData& alldata, uint8_t level, bool root_only,
const char* fmt, ... );
/* synchronize error indicator with all worker ranks
(either broadcast from one rank (root) or reduce from all) */
bool SyncError( AllData& alldata, bool& error, uint32_t root= (uint32_t)-1 );
/* logarithm to base b for unsigned 64-bit integer x */
uint64_t Logi( uint64_t x, uint64_t b= 2 );
#endif /* OTFPROFILE_MPI_H */

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

@ -1,649 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Robert Dietrich, Matthias Jurenz
*/
using namespace std;
#include <cassert>
#include <iostream>
#include "otfprofile-mpi.h"
#include "reduce_data.h"
/* fence between statistics parts within the buffer for consistency checking */
enum { FENCE= 0xDEADBEEF };
/* pack the local alldata into a buffer, return buffer */
static char* pack_worker_data( AllData& alldata, uint32_t sizes[10] ) {
uint64_t fence= FENCE;
/* get the sizes of all parts that need to be transmitted */
sizes[1]= alldata.functionMapGlobal.size(); /* map< uint64_t, FunctionData > functionMapGlobal; */
sizes[2]= alldata.counterMapGlobal.size(); /* map< Pair, CounterData, ltPair > counterMapGlobal; */
sizes[3]= alldata.messageMapPerClusterPair.size(); /* map< Pair, MessageData, ltPair > messageMapPerClusterPair; */
sizes[4]= alldata.messageMapPerCluster.size(); /* map< uint64_t, MessageData > messageMapPerCluster; */
sizes[5]= alldata.messageSpeedMapPerLength.size(); /* map< Pair, MessageSpeedData, ltPair > messageSpeedMapPerLength; */
sizes[6]= alldata.collectiveMapPerCluster.size(); /* map< Pair, CollectiveData, ltPair > collectiveMapPerCluster; */
sizes[7]= 0;
sizes[8]= 0;
sizes[9]= 0;
/* get bytesize multiplying all pieces */
uint32_t bytesize= 0;
int s1, s2;
MPI_Pack_size( 7, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
bytesize += s1;
MPI_Pack_size( sizes[1] * 7, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
MPI_Pack_size( sizes[1] * 6, MPI_DOUBLE, MPI_COMM_WORLD, &s2 );
bytesize += s1 + s2;
MPI_Pack_size( sizes[2] * 8, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
MPI_Pack_size( sizes[2] * 6, MPI_DOUBLE, MPI_COMM_WORLD, &s2 );
bytesize += s1 + s2;
MPI_Pack_size( sizes[3] * 20, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
MPI_Pack_size( sizes[3] * 6, MPI_DOUBLE, MPI_COMM_WORLD, &s2 );
bytesize += s1 + s2;
MPI_Pack_size( sizes[4] * 19, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
MPI_Pack_size( sizes[4] * 6, MPI_DOUBLE, MPI_COMM_WORLD, &s2 );
bytesize += s1 + s2;
MPI_Pack_size( sizes[5] * 6, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
bytesize += s1;
MPI_Pack_size( sizes[6] * 20, MPI_LONG_LONG_INT, MPI_COMM_WORLD, &s1 );
MPI_Pack_size( sizes[6] * 6, MPI_DOUBLE, MPI_COMM_WORLD, &s2 );
bytesize += s1 + s2;
/* get the buffer */
sizes[0]= bytesize;
char* buffer= alldata.guaranteePackBuffer( bytesize );
/* pack parts */
int position= 0;
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack functionMapGlobal */
{
map< uint64_t, FunctionData >::const_iterator it= alldata.functionMapGlobal.begin();
map< uint64_t, FunctionData >::const_iterator itend= alldata.functionMapGlobal.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.functionMapGlobal.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack counterMapGlobal */
{
map< Pair, CounterData, ltPair >::const_iterator it= alldata.counterMapGlobal.begin();
map< Pair, CounterData, ltPair >::const_iterator itend= alldata.counterMapGlobal.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first.a, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->first.b, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.excl_time.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.incl_time.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.counterMapGlobal.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack messageMapPerClusterPair */
{
map< Pair, MessageData, ltPair >::const_iterator it= alldata.messageMapPerClusterPair.begin();
map< Pair, MessageData, ltPair >::const_iterator itend= alldata.messageMapPerClusterPair.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first.a, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->first.b, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.messageMapPerClusterPair.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack messageMapPerCluster */
{
map< uint64_t, MessageData >::const_iterator it= alldata.messageMapPerCluster.begin();
map< uint64_t, MessageData >::const_iterator itend= alldata.messageMapPerCluster.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.messageMapPerCluster.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack messageSpeedMapPerLength */
{
map< Pair, MessageSpeedData, ltPair >::const_iterator it= alldata.messageSpeedMapPerLength.begin();
map< Pair, MessageSpeedData, ltPair >::const_iterator itend= alldata.messageSpeedMapPerLength.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first.a, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->first.b, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.messageSpeedMapPerLength.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
/* pack collectiveMapPerCluster */
{
map< Pair, CollectiveData, ltPair >::const_iterator it= alldata.collectiveMapPerCluster.begin();
map< Pair, CollectiveData, ltPair >::const_iterator itend= alldata.collectiveMapPerCluster.end();
for ( ; it != itend; ++it ) {
MPI_Pack( (void*) &it->first.a, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->first.b, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.count_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.min, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.max, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.sum, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_send.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.min, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.max, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.sum, 1, MPI_DOUBLE, buffer, bytesize, &position, MPI_COMM_WORLD );
MPI_Pack( (void*) &it->second.duration_recv.cnt, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
}
alldata.collectiveMapPerCluster.clear();
}
/* extra check that doesn't cost too much */
MPI_Pack( (void*) &fence, 1, MPI_LONG_LONG_INT, buffer, bytesize, &position, MPI_COMM_WORLD );
return buffer;
}
/* prepare alldata for unpack, return buffer of sufficient size */
static char* prepare_worker_data( AllData& alldata, uint32_t sizes[10] ) {
uint32_t bytesize= sizes[0];
return alldata.guaranteePackBuffer( bytesize );
}
/* unpack the received worker data and add it to the local alldata */
static void unpack_worker_data( AllData& alldata, uint32_t sizes[10] ) {
uint64_t fence;
/* unpack parts */
int position= 0;
char* buffer= alldata.getPackBuffer( );
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack functionMapGlobal */
for ( uint32_t i= 0; i < sizes[1]; i++ ) {
uint64_t func;
FunctionData tmp;
MPI_Unpack( buffer, sizes[0], &position, &func, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.functionMapGlobal[ func ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack counterMapGlobal */
for ( uint32_t i= 0; i < sizes[2]; i++ ) {
uint64_t a;
uint64_t b;
CounterData tmp;
MPI_Unpack( buffer, sizes[0], &position, &a, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &b, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.count.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.excl_time.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, &tmp.incl_time.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.counterMapGlobal[ Pair( a, b ) ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack messageMapPerClusterPair */
for ( uint32_t i= 0; i < sizes[3]; i++ ) {
uint64_t a;
uint64_t b;
MessageData tmp;
MPI_Unpack( buffer, sizes[0], &position, (void*) &a, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &b, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.messageMapPerClusterPair[ Pair(a,b) ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack messageMapPerCluster */
for ( uint32_t i= 0; i < sizes[4]; i++ ) {
uint64_t a;
MessageData tmp;
MPI_Unpack( buffer, sizes[0], &position, (void*) &a, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.messageMapPerCluster[ a ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack messageSpeedMapPerLength */
for ( uint32_t i= 0; i < sizes[5]; i++ ) {
uint64_t a;
uint64_t b;
MessageSpeedData tmp;
MPI_Unpack( buffer, sizes[0], &position, (void*) &a, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &b, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.messageSpeedMapPerLength[ Pair(a,b) ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
/* unpack collectiveMapPerCluster */
for ( uint32_t i= 0; i < sizes[6]; i++ ) {
uint64_t a;
uint64_t b;
CollectiveData tmp;
MPI_Unpack( buffer, sizes[0], &position, (void*) &a, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &b, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.count_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.min, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.max, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.sum, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.bytes_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_send.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.min, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.max, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.sum, 1, MPI_DOUBLE, MPI_COMM_WORLD );
MPI_Unpack( buffer, sizes[0], &position, (void*) &tmp.duration_recv.cnt, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
alldata.collectiveMapPerCluster[ Pair(a,b) ].add( tmp );
}
/* extra check that doesn't cost too much */
fence= 0;
MPI_Unpack( buffer, sizes[0], &position, &fence, 1, MPI_LONG_LONG_INT, MPI_COMM_WORLD );
assert( FENCE == fence );
}
bool ReduceData( AllData& alldata ) {
bool ret= true;
if ( 1 < alldata.numRanks ) {
VerbosePrint( alldata, 1, true, "reducing data\n" );
/* implement reduction myself because MPI and C++ STL don't play with
each other */
/* how many rounds until master has all the data? */
uint32_t num_rounds= Logi( alldata.numRanks ) -1;
uint32_t round_no= 0;
uint32_t round= 1;
while ( round < alldata.numRanks ) {
round_no++;
if ( 1 == alldata.params.verbose_level ) {
VerbosePrint( alldata, 1, true, " round %u / %u\n",
round_no, num_rounds );
}
uint32_t peer= alldata.myRank ^ round;
/* if peer rank is not there, do nothing but go on */
if ( peer >= alldata.numRanks ) {
round= round << 1;
continue;
}
/* send to smaller peer, receive from larger one */
uint32_t sizes[10];
char* buffer;
if ( alldata.myRank < peer ) {
MPI_Status status;
MPI_Recv( sizes, 10, MPI_UNSIGNED, peer, 4, MPI_COMM_WORLD,
&status );
// DEBUG
//cout << " round " << round << " recv " << peer << "--> " <<
//alldata.myRank << " with " <<
//sizes[0] << " bytes, " <<
//sizes[1] << ", " <<
//sizes[2] << ", " <<
//sizes[3] << ", " <<
//sizes[4] << "" << endl << flush;
buffer= prepare_worker_data( alldata, sizes );
VerbosePrint( alldata, 2, false,
"round %u / %u: receiving %u bytes from rank %u\n",
round_no, num_rounds, sizes[0], peer );
MPI_Recv( buffer, sizes[0], MPI_PACKED, peer, 5, MPI_COMM_WORLD,
&status );
unpack_worker_data( alldata, sizes );
} else {
buffer= pack_worker_data( alldata, sizes );
// DEBUG
//cout << " round " << round << " send " << alldata.myRank <<
//" --> " << peer << " with " <<
//sizes[0] << " bytes, " <<
//sizes[1] << ", " <<
//sizes[2] << ", " <<
//sizes[3] << ", " <<
//sizes[4] << "" << endl << flush;
VerbosePrint( alldata, 2, false,
"round %u / %u: sending %u bytes to rank %u\n",
round_no, num_rounds, sizes[0], peer );
MPI_Send( sizes, 10, MPI_UNSIGNED, peer, 4, MPI_COMM_WORLD );
MPI_Send( buffer, sizes[0], MPI_PACKED, peer, 5,
MPI_COMM_WORLD );
/* every work has to send off its data at most once,
after that, break from the collective reduction operation */
break;
}
round= round << 1;
}
alldata.freePackBuffer();
}
return ret;
}

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

@ -1,319 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Robert Dietrich, Matthias Jurenz
*/
using namespace std;
#include <cassert>
#include <iostream>
#include "summarize_data.h"
static void get_clustering( AllData& alldata ) {
uint32_t r_processes= alldata.allProcesses.size();
uint32_t r_clusters= Clustering::MAX_CLUSTERS;
set< Process, ltProcess >::iterator pos= alldata.allProcesses.begin();
for ( uint32_t c= 0;
c < Clustering::MAX_CLUSTERS && 0 < r_processes; c++ ) {
uint32_t n=
( ( r_processes / r_clusters ) * r_clusters < r_processes ) ?
( r_processes / r_clusters + 1 ) : ( r_processes / r_clusters );
for ( uint32_t i= 0; i < n; i++ ) {
bool inserted= alldata.clustering.insert( c+1, pos->process );
assert( inserted );
pos++;
r_processes--;
}
r_clusters--;
}
}
static void share_clustering( AllData& alldata ) {
MPI_Barrier( MPI_COMM_WORLD );
char* buffer;
int buffer_size= 0;
int buffer_pos= 0;
if ( 0 == alldata.myRank ) {
/* get size needed to send clustering information to workers */
int size;
/* alldata.clustering.clustersToProcesses.size() + firsts */
MPI_Pack_size( 1 + alldata.clustering.clustersToProcesses.size(),
MPI_LONG_LONG_INT, MPI_COMM_WORLD, &size );
buffer_size+= size;
/* alldata.clustering.clustersToProcesses.second.size() + second */
for ( map< uint64_t, set<uint64_t> >::const_iterator it=
alldata.clustering.clustersToProcesses.begin();
it != alldata.clustering.clustersToProcesses.end(); it++ ) {
MPI_Pack_size( 1 + it->second.size(), MPI_LONG_LONG_INT,
MPI_COMM_WORLD, &size );
buffer_size+= size;
}
}
/* broadcast buffer size */
MPI_Bcast( &buffer_size, 1, MPI_INT, 0, MPI_COMM_WORLD );
/* allocate buffer */
buffer= new char[ buffer_size ];
assert( buffer );
/* pack clustering information to buffer */
if ( 0 == alldata.myRank ) {
/* alldata.clustering.clustersToProcesses.size() */
uint64_t clust_proc_map_size=
alldata.clustering.clustersToProcesses.size();
MPI_Pack( &clust_proc_map_size, 1, MPI_LONG_LONG_INT, buffer,
buffer_size, &buffer_pos, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses */
for ( map< uint64_t, set<uint64_t> >::const_iterator it=
alldata.clustering.clustersToProcesses.begin();
it != alldata.clustering.clustersToProcesses.end(); it++ ) {
/* alldata.clustering.clustersToProcesses.first */
uint64_t cluster= it->first;
MPI_Pack( &cluster, 1, MPI_LONG_LONG_INT, buffer, buffer_size,
&buffer_pos, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses.second.size() */
uint64_t processes_size= it->second.size();
MPI_Pack( &processes_size, 1, MPI_LONG_LONG_INT, buffer, buffer_size,
&buffer_pos, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses.second */
for ( set<uint64_t>::const_iterator it2= it->second.begin();
it2 != it->second.end(); it2++ ) {
uint64_t process= *it2;
MPI_Pack( &process, 1, MPI_LONG_LONG_INT, buffer, buffer_size,
&buffer_pos, MPI_COMM_WORLD );
}
}
}
/* broadcast definitions buffer */
MPI_Bcast( buffer, buffer_size, MPI_PACKED, 0, MPI_COMM_WORLD );
/* unpack clustering information from buffer */
if ( 0 != alldata.myRank ) {
/* alldata.clustering.clustersToProcesses.size() */
uint64_t clust_proc_map_size;
MPI_Unpack( buffer, buffer_size, &buffer_pos, &clust_proc_map_size, 1,
MPI_LONG_LONG_INT, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses */
for ( uint64_t i= 0; i < clust_proc_map_size; i++ ) {
/* alldata.clustering.clustersToProcesses.first */
uint64_t cluster;
MPI_Unpack( buffer, buffer_size, &buffer_pos, &cluster, 1,
MPI_LONG_LONG_INT, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses.second.size() */
uint64_t processes_size;
MPI_Unpack( buffer, buffer_size, &buffer_pos, &processes_size, 1,
MPI_LONG_LONG_INT, MPI_COMM_WORLD );
/* alldata.clustering.clustersToProcesses.second */
for ( uint64_t j= 0; j < processes_size; j++ ) {
uint64_t process;
MPI_Unpack( buffer, buffer_size, &buffer_pos, &process, 1,
MPI_LONG_LONG_INT, MPI_COMM_WORLD );
bool inserted= alldata.clustering.insert( cluster, process );
assert( inserted );
}
}
}
delete[] buffer;
}
bool SummarizeData( AllData& alldata ) {
bool error= false;
/* rank 0 gets clustering information */
if ( 0 == alldata.myRank ) {
get_clustering( alldata );
}
/* share clustering information to workers */
if ( 1 < alldata.numRanks ) {
share_clustering( alldata );
}
/* macro to set min, max to sum before summarizing */
# define MINMAX2SUM(v) \
if( 0 != (v).cnt ) { \
(v).cnt = 1; \
(v).min= (v).max= (v).sum; \
} else { \
(v).cnt = 0; \
/* (v).min= OTF_UINT64_MAX; (v).max= 0; \
^^^ this is set already by the constructor and never touched \
if (v).cnt == 0. Therefore, it is ignored when computing min/max \
further on. */ \
}
/* summarize map ( func x rank ) to map ( func ) */
{
map< Pair, FunctionData, ltPair >::iterator it= alldata.functionMapPerRank.begin();
map< Pair, FunctionData, ltPair >::iterator itend= alldata.functionMapPerRank.end();
while ( itend != it ) {
alldata.functionMapGlobal[ it->first.a ].add( it->second );
it++;
}
alldata.functionMapPerRank.clear();
}
/* summarize map ( counter x func x rank ) to map ( counter x func ) */
{
map< Triple, CounterData, ltTriple >::iterator it= alldata.counterMapPerFunctionRank.begin();
map< Triple, CounterData, ltTriple >::iterator itend= alldata.counterMapPerFunctionRank.end();
while ( itend != it ) {
alldata.counterMapGlobal[ Pair( it->first.a, it->first.b ) ].add( it->second );
it++;
}
alldata.counterMapPerFunctionRank.clear();
}
/* will be generated from messageMapPerRankPair, is only used to generate
messageMapPerCluster */
map< uint64_t, MessageData > message_map_per_rank;
/* summarize map ( rank x rank ) to map ( cluster x cluster ) */
{
map< Pair, MessageData, ltPair >::iterator it= alldata.messageMapPerRankPair.begin();
map< Pair, MessageData, ltPair >::iterator itend= alldata.messageMapPerRankPair.end();
while ( itend != it ) {
uint64_t cluster_a= it->first.a;
uint64_t cluster_b= it->first.b;
message_map_per_rank[ cluster_a ].add( it->second );
if ( alldata.clustering.enabled ) {
cluster_a= alldata.clustering.process2cluster( it->first.a );
assert( 0 != cluster_a );
cluster_b= alldata.clustering.process2cluster( it->first.b );
assert( 0 != cluster_b );
}
MINMAX2SUM( it->second.count_send );
MINMAX2SUM( it->second.count_recv );
MINMAX2SUM( it->second.bytes_send );
MINMAX2SUM( it->second.bytes_recv );
MINMAX2SUM( it->second.duration_send );
MINMAX2SUM( it->second.duration_recv );
alldata.messageMapPerClusterPair[ Pair( cluster_a, cluster_b ) ].add( it->second );
it++;
}
alldata.messageMapPerRankPair.clear();
}
/* summarize map ( rank ) to map ( cluster ) */
{
map< uint64_t, MessageData >::iterator it= message_map_per_rank.begin();
map< uint64_t, MessageData >::iterator itend= message_map_per_rank.end();
while ( itend != it ) {
uint64_t cluster= it->first;
if ( alldata.clustering.enabled ) {
cluster= alldata.clustering.process2cluster( it->first );
assert( 0 != cluster );
}
MINMAX2SUM( it->second.count_send );
MINMAX2SUM( it->second.count_recv );
MINMAX2SUM( it->second.bytes_send );
MINMAX2SUM( it->second.bytes_recv );
MINMAX2SUM( it->second.duration_send );
MINMAX2SUM( it->second.duration_recv );
alldata.messageMapPerCluster[ cluster ].add( it->second );
it++;
}
message_map_per_rank.clear();
}
/* summarize map ( class x rank ) to map ( class x cluster ) */
{
map< Pair, CollectiveData, ltPair >::iterator it= alldata.collectiveMapPerRank.begin();
map< Pair, CollectiveData, ltPair >::iterator itend= alldata.collectiveMapPerRank.end();
while ( itend != it ) {
const uint64_t& op_class= it->first.a;
uint64_t cluster= it->first.b;
if ( alldata.clustering.enabled ) {
cluster= alldata.clustering.process2cluster( it->first.b );
assert( 0 != cluster );
}
MINMAX2SUM( it->second.count_send );
MINMAX2SUM( it->second.count_recv );
MINMAX2SUM( it->second.bytes_send );
MINMAX2SUM( it->second.bytes_recv );
MINMAX2SUM( it->second.duration_send );
MINMAX2SUM( it->second.duration_recv );
alldata.collectiveMapPerCluster[ Pair( op_class, cluster ) ].add( it->second );
it++;
}
alldata.collectiveMapPerRank.clear();
}
return !error;
}

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

@ -1,768 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#include "OTF_Platform.h"
#include "CSVParse.h"
void Glob_Maps::set_trace_count(uint32_t t_count)
{
trace_count = t_count;
}
uint32_t Glob_Maps::set_func(string func_name)
{
uint32_t id = func_id;
GlobalMaps::iterator it = funcmap.find(func_name);
if(it == funcmap.end())
{
funcmap.insert(pair<string,uint32_t> (func_name, id));
func_id++;
return id;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::set_funcgroup(string fg_name)
{
uint32_t id = funcgroup_id;
GlobalMaps::iterator it = funcgroupmap.find(fg_name);
if(it == funcgroupmap.end())
{
funcgroupmap.insert(pair<string,uint32_t> (fg_name, id));
funcgroup_id++;
return id;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::set_counter(string counter_name)
{
uint32_t id = counter_id;
GlobalMaps::iterator it = countermap.find(counter_name);
if(it == countermap.end())
{
countermap.insert(pair<string,uint32_t> (counter_name, id));
counter_id++;
return id;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::set_collop(string collop_name)
{
uint32_t id = collop_id;
GlobalMaps::iterator it = collopmap.find(collop_name);
if(it == collopmap.end())
{
collopmap.insert(pair<string,uint32_t> (collop_name, id));
collop_id++;
return id;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::get_trace_count()
{
return trace_count;
}
uint32_t Glob_Maps::get_func(string func_name)
{
GlobalMaps::iterator it = funcmap.find(func_name);
if(it == funcmap.end())
{
return 0;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::get_funcgroup(string fg_name)
{
GlobalMaps::iterator it = funcgroupmap.find(fg_name);
if(it == funcgroupmap.end())
{
return 0;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::get_counter(string counter_name)
{
GlobalMaps::iterator it = countermap.find(counter_name);
if(it == countermap.end())
{
return 0;
}
else
{
return it->second;
}
}
uint32_t Glob_Maps::get_collop(string collop_name)
{
GlobalMaps::iterator it = collopmap.find(collop_name);
if(it == collopmap.end())
{
return 0;
}
else
{
return it->second;
}
}
bool check_value(char* value, const char* place)
{
if(value == NULL)
{
cerr << "Error by reading the csv file." << endl;
cerr << "An expected value is missing, for the Token " << place << "." << endl;
return false;
}
else
{
return true;
}
}
int parse_csv(Summary_Container& sum_container, const char* file, Glob_Maps& glob_maps)
{
typedef map<uint32_t,string> LocalMaps;
LocalMaps localfuncmap;
LocalMaps localfuncgroupmap;
LocalMaps localcountermap;
LocalMaps localcollopmap;
static uint32_t trace_nr = 0;
trace_nr++;
fstream in;
in.open(file, ios::in);
if(!in)
{
cerr << "Error, can't find : " << file << endl;
return 1;
}
char buffer[255];
char* value;
uint32_t check = 0;
while(!in.eof())
{
in.getline(buffer,255);
value = strtok(buffer,";");
if(value == NULL)
{
continue;
}
if(0 == strcmp("ticks", value))
{
value = strtok(NULL,";");
if(!check_value(value, "ticks")) // read ticks
{
return 1;
}
sum_container.adddef_Ticks(trace_nr, (uint64_t) atol(value));
}
if(0 == strcmp("progtime", value))
{
value = strtok(NULL,";");
if(!check_value(value, "progtime")) // read progtime
{
return 1;
}
sum_container.set_ProgTime(trace_nr, (uint64_t) atol(value));
}
else if(0 == strcmp("proctime", value)) // read proctime
{
value = strtok(NULL,";");
if(!check_value(value, "proctime"))
{
return 1;
}
uint32_t proc_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "proctime"))
{
return 1;
}
sum_container.addvalues_ProcTime(trace_nr, proc_id, (uint64_t) atol(value));
}
else if(0 == strcmp("proc", value)) // read proc
{
value = strtok(NULL,";");
if(!check_value(value, "proc"))
{
return 1;
}
Process_Def_Key p_def_key(trace_nr, (uint32_t) atoi(value));
value = strtok(NULL,";");
if(!check_value(value, "proc"))
{
return 1;
}
sum_container.adddef_Proc(p_def_key, strdup(value));
}
else if(0 == strcmp("fg", value)) // read fg
{
value = strtok(NULL,";");
if(!check_value(value, "fg"))
{
return 1;
}
uint32_t fg_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "fg"))
{
return 1;
}
const char* name_char = strdup(value);
string name;
name.assign(name_char);
localfuncgroupmap.insert(make_pair(fg_id, name));
fg_id = glob_maps.set_funcgroup(name);
FG_Def_Key fg_def_key(trace_nr, fg_id);
sum_container.adddef_FG(fg_def_key, name_char);
}
else if(0 == strcmp("funcdef", value)) // read funcdef
{
value = strtok(NULL,";");
if(!check_value(value, "funcdef"))
{
return 1;
}
uint32_t func_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "funcdef"))
{
return 1;
}
const char* name_char = strdup(value);
string name;
name.assign(name_char);
localfuncmap.insert(make_pair(func_id, name));
func_id = glob_maps.set_func(name);
Function_Def_Key f_def_key(trace_nr, func_id);
value = strtok(NULL,";");
if(!check_value(value, "funcdef"))
{
return 1;
}
LocalMaps::iterator it = localfuncgroupmap.find((uint32_t) atoi(value));
if(it == localfuncgroupmap.end())
{
cerr << "Error by getting values for function. No function group name found"
<< ", for the given identifier. A failure in the csv file could be"
<< " the reason." << endl;
}
else
{
uint32_t fg_id = glob_maps.get_funcgroup(it->second);
if(fg_id == 0)
{
cerr << "No function group entry found."
<< "This could be a failure in the csv file." << endl;
continue;
}
Function_Def f_def(name_char, fg_id);
sum_container.adddef_Function(f_def_key, f_def);
}
}
else if(0 == strcmp("func", value)) // read func
{
value = strtok(NULL,";");
if(!check_value(value, "func"))
{
return 1;
}
uint32_t func_id = (uint32_t) atoi(value);
LocalMaps::iterator it = localfuncmap.find(func_id);
if(it == localfuncmap.end())
{
cerr << "Error by getting values for function. No function name found"
<< ", for the given identifier. A failure in the csv file could be"
<< " the reason." << endl;
continue;
}
func_id = glob_maps.get_func(it->second);
value = strtok(NULL,";");
if(!check_value(value, "func"))
{
return 1;
}
uint32_t proc_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "func"))
{
return 1;
}
uint64_t invoc = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "func"))
{
return 1;
}
uint64_t excl_time = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "func"))
{
return 1;
}
sum_container.addvalues_Function(trace_nr,func_id, proc_id, invoc,
excl_time, (uint64_t) atol(value));
}
else if(0 == strcmp("counterdef", value)) // read counterdef
{
value = strtok(NULL,";");
if(!check_value(value, "counterdef"))
{
return 1;
}
uint32_t counter_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "counterdef"))
{
return 1;
}
const char* name_char = strdup(value);
string name;
name.assign(name_char);
localcountermap.insert(pair<uint32_t,string>(counter_id, name));
counter_id = glob_maps.set_counter(name);
Counter_Def_Key c_def_key(trace_nr, counter_id);
value = strtok(NULL,";");
if(!check_value(value, "counterdef"))
{
return 1;
}
Counter_Def c_def(name_char, strdup(value));
sum_container.adddef_Counter(c_def_key,c_def);
}
else if(0 == strcmp("counter", value)) // read counter
{
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
uint32_t func_id = (uint32_t) atoi(value);
LocalMaps::iterator it = localfuncmap.find(func_id);
if(it == localfuncmap.end())
{
cerr << "Error by getting values for counter. No function name found"
<< ", for the given identifier. A failure in the csv file could be"
<< " the reason." << endl;
continue;
}
else
{
func_id = glob_maps.get_func(it->second);
}
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
uint32_t proc_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
uint32_t counter_id = (uint32_t) atoi(value);
LocalMaps::iterator it2 = localcountermap.find(counter_id);
if(it2 == localcountermap.end())
{
cerr << "Error by getting values for counter. No counter name found"
<< ", for the given identifier. A failure in the csv file could be"
<< " the reason." << endl;
continue;
}
else
{
counter_id = glob_maps.get_counter(it2->second);
}
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
uint64_t excl_value = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
uint64_t incl_value = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "counter"))
{
return 1;
}
if(0 == strcmp("VALID", value))
{
sum_container.addvalues_Counter(trace_nr, func_id, proc_id, counter_id,
excl_value, incl_value, VALID);
}
else
{
sum_container.addvalues_Counter(trace_nr, func_id, proc_id, counter_id,
excl_value, incl_value, INVALID);
}
}
else if(0 == strcmp("p2p", value)) // read p2p
{
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint32_t sender = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint32_t receiver = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint32_t bin_1 = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint32_t bin_2 = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint64_t invoc = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
uint64_t length = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "p2p"))
{
return 1;
}
sum_container.addvalues_P2P(trace_nr, sender, receiver, bin_1, bin_2, invoc,
length, (uint64_t) atol(value));
}
else if(0 == strcmp("collopdef", value)) // read collopdef
{
value = strtok(NULL,";");
if(!check_value(value, "collopdef"))
{
return 1;
}
uint32_t collop_id = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "collopdef"))
{
return 1;
}
const char* name_char = strdup(value);
string name;
name.assign(name_char);
localcollopmap.insert(pair<uint32_t,string>(collop_id, name));
collop_id = glob_maps.set_collop(name);
CollOp_Def_Key collop_def_key(trace_nr, collop_id);
value = strtok(NULL,";");
if(!check_value(value, "collopdef"))
{
return 1;
}
uint32_t type;
if(0 == strcmp("Barrier", value))
{
type = OTF_COLLECTIVE_TYPE_BARRIER;
}
else if(0 == strcmp("ONE2ALL", value))
{
type = OTF_COLLECTIVE_TYPE_ONE2ALL;
}
else if(0 == strcmp("ALL2ONE", value))
{
type = OTF_COLLECTIVE_TYPE_ALL2ONE;
}
else if(0 == strcmp("ALL2ALL", value))
{
type = OTF_COLLECTIVE_TYPE_ALL2ALL;
}
else
{
type = OTF_COLLECTIVE_TYPE_UNKNOWN;
}
CollOp_Def collop_def(name_char, type);
sum_container.adddef_CollOp(collop_def_key, collop_def);
}
else if(0 == strcmp("collop", value)) // read collop
{
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint32_t proc = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint32_t collop_id = (uint32_t) atoi(value);
LocalMaps::iterator it = localcollopmap.find(collop_id);
if(it == localcollopmap.end())
{
cerr << "Error by getting values for Collective Operations."
<< "No Collective Operation name found"
<< ", for the given identifier. A failure in the csv file could be"
<< " the reason." << endl;
continue;
}
collop_id = glob_maps.get_collop(it->second);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint64_t invoc_s = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint64_t invoc_r = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint64_t sent = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
uint64_t received = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "collop"))
{
return 1;
}
sum_container.addvalues_CollOp(trace_nr, proc, collop_id, invoc_s, invoc_r, sent,
received, (uint64_t) atol(value));
}
else if(0 == strcmp("bin1", value)) // read bin1
{
value = strtok(NULL,";");
if(!check_value(value, "bin1"))
{
return 1;
}
uint32_t bin = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "bin1"))
{
return 1;
}
uint64_t min = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "bin1"))
{
return 1;
}
sum_container.setdef_Bin1(trace_nr, bin, min, (uint64_t) atol(value));
}
else if(0 == strcmp("bin2", value)) // read bin2
{
value = strtok(NULL,";");
if(!check_value(value, "bin2"))
{
return 1;
}
uint32_t bin = (uint32_t) atoi(value);
value = strtok(NULL,";");
if(!check_value(value, "bin2"))
{
return 1;
}
uint64_t min = (uint64_t) atol(value);
value = strtok(NULL,";");
if(!check_value(value, "bin2"))
{
return 1;
}
sum_container.setdef_Bin2(trace_nr, bin, min, (uint64_t) atol(value));
}
else
{
if(check < 20)
{
++check;
}
else
{
cerr << "Error in csv_parse().Too much unknown token in csv file : "
<< file << endl;
return 1;
}
}
}
in.close();
sum_container.adddef_Trace(trace_nr, file);
glob_maps.set_trace_count(trace_nr);
return 0;
}
int Glob_Maps::special_synchronize(Summary_Container& sum_container)
{
GlobalMaps::iterator it;
it = funcmap.begin();
uint32_t differences[4] = {0,0,0,0}; // 1 := func_def ; 2:= fg_Def ; ...
while(it != funcmap.end())
{
for(uint32_t i = 1; i <= trace_count; i++)
{
Function_Def_Key f_def_key(i, it->second);
if(!sum_container.find_Function(f_def_key))
{
cerr << "Function " << it->first << " couldn\'t found in trace "
<< sum_container.get_Trace_name(i) << endl;
for(uint32_t u = 1; u <= trace_count; u++)
{
Function_Def_Key f2_def_key(u, it->second);
if(sum_container.find_Function(f2_def_key))
{
Function_Def f_def = sum_container.get_Function_Def(u, it->second);
sum_container.adddef_Function(f_def_key, f_def);
differences[0] += 1;
cerr << "Problem fixed" << endl;
break;
}
}
}
}
++it;
}
it = funcgroupmap.begin();
while(it != funcgroupmap.end())
{
for(uint32_t i = 1; i <= trace_count; i++)
{
FG_Def_Key fg_def_key(i, it->second);
if(!sum_container.find_FG(fg_def_key))
{
cerr << "Function Group " << it->first << " couldn\'t found in trace "
<< sum_container.get_Trace_name(i) << endl;
sum_container.adddef_FG(fg_def_key, strdup(it->first.c_str()));
differences[1] += 1;
cerr << "Problem fixed" << endl;
}
}
++it;
}
it = countermap.begin();
while(it != countermap.end())
{
for(uint32_t i = 1; i <= trace_count; i++)
{
Counter_Def_Key c_def_key(i, it->second);
if(!sum_container.find_Counter(c_def_key))
{
cerr << "Counter " << it->first << " couldn\'t found in trace "
<< sum_container.get_Trace_name(i) << endl;
for(uint32_t u = 1; u <= trace_count; u++)
{
Counter_Def_Key c2_def_key(u, it->second);
if(sum_container.find_Counter(c2_def_key))
{
Counter_Def c_def = sum_container.get_Counter_Def(u, it->second);
sum_container.adddef_Counter(c_def_key, c_def);
differences[2] += 1;
cerr << "Problem fixed" << endl;
break;
}
}
}
}
++it;
}
it = collopmap.begin();
while(it != collopmap.end())
{
for(uint32_t i = 1; i <= trace_count; i++)
{
CollOp_Def_Key co_def_key(i, it->second);
if(!sum_container.find_CollOp(co_def_key))
{
cerr << "Collective Operation " << it->first << " couldn\'t found in trace "
<< sum_container.get_Trace_name(i) << endl;
for(uint32_t u = 1; u <= trace_count; u++)
{
CollOp_Def_Key co2_def_key(u, it->second);
if(sum_container.find_CollOp(co2_def_key))
{
CollOp_Def co_def = sum_container.get_CollOp_Def(u, it->second);
sum_container.adddef_CollOp(co_def_key, co_def);
differences[3] += 1;
cerr << "Problem fixed" << endl;
break;
}
}
}
}
++it;
}
cout << endl;
cout << "Differences in Func_Def : " << differences[0] << endl;
cout << "Differences in Func_Group_Def : " << differences[1] << endl;
cout << "Differences in Counter_Def : " << differences[2] << endl;
cout << "Differences in CollOp_Def : " << differences[3] << endl;
return 0;
}

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

@ -1,66 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#ifndef CSVPARSER_H
#define CSVPARSER_H
#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include "OTF_inttypes.h"
#include "DataStructure.h"
using namespace std;
// to synchronize the data of the different csv files
class Glob_Maps
{
typedef map<string,uint32_t> GlobalMaps;
public:
Glob_Maps();
int special_synchronize(Summary_Container& sum_container);
void set_trace_count(uint32_t t_count);
uint32_t get_trace_count();
// the return value is the identifier
uint32_t set_func(string func_name);
uint32_t set_funcgroup(string fg_name);
uint32_t set_counter(string counter_name);
uint32_t set_collop(string collop_name);
uint32_t get_func(string func_name);
uint32_t get_funcgroup(string fg_name);
uint32_t get_counter(string counter_name);
uint32_t get_collop(string collop_name);
private:
uint32_t trace_count;
uint32_t func_id;
uint32_t funcgroup_id;
uint32_t counter_id;
uint32_t collop_id;
GlobalMaps funcmap;
GlobalMaps funcgroupmap;
GlobalMaps countermap;
GlobalMaps collopmap;
};
inline Glob_Maps::Glob_Maps()
{
trace_count = 0;
func_id = 1;
funcgroup_id = 1;
counter_id = 1;
collop_id = 1;
}
int parse_csv(Summary_Container& sum_container, const char* file, Glob_Maps& glob_maps);
#endif /* CSVPARSER_H */

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

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

@ -1,875 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#ifndef DATASTRUCTURE_H
#define DATASTRUCTURE_H
#include <fstream>
#include <map>
#include <vector>
#include <iostream>
#include "OTF_inttypes.h"
#include "otf.h"
#include "Definitions.h"
/* show wether the result is valid or invalid */
#define INVALID false
#define VALID true
using namespace std;
/*************************************** FG *****************************************/
/********** Def_Key **********/
class FG_Def_Key
{
friend bool operator<(const FG_Def_Key& c1, const FG_Def_Key& c2);
friend bool operator==(const FG_Def_Key& c1, const FG_Def_Key& c2);
public:
FG_Def_Key(uint32_t tr, uint32_t fg_id);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline FG_Def_Key::FG_Def_Key(uint32_t tr, uint32_t fg_id)
:trace(tr), ident(fg_id)
{
}
inline uint32_t FG_Def_Key::get_trace()
{
return trace;
}
inline uint32_t FG_Def_Key::get_ident()
{
return ident;
}
/*************************************** Process *****************************************/
/********** Def_Key **********/
class Process_Def_Key
{
friend bool operator<(const Process_Def_Key& c1, const Process_Def_Key& c2);
friend bool operator==(const Process_Def_Key& c1, const Process_Def_Key& c2);
public:
Process_Def_Key(uint32_t tr, uint32_t p_id);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline Process_Def_Key::Process_Def_Key(uint32_t tr, uint32_t p_id)
:trace(tr), ident(p_id)
{
}
inline uint32_t Process_Def_Key::get_trace()
{
return trace;
}
inline uint32_t Process_Def_Key::get_ident()
{
return ident;
}
/*************************************** Function *****************************************/
/********** Def_Key **********/
class Function_Def_Key
{
friend bool operator<(const Function_Def_Key& c1, const Function_Def_Key& c2);
friend bool operator==(const Function_Def_Key& c1, const Function_Def_Key& c2);
public:
Function_Def_Key(uint32_t tr, uint32_t f_id);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline Function_Def_Key::Function_Def_Key(uint32_t tr, uint32_t f_id)
:trace(tr), ident(f_id)
{
}
inline uint32_t Function_Def_Key::get_trace()
{
return trace;
}
inline uint32_t Function_Def_Key::get_ident()
{
return ident;
}
/********** Def **********/
class Function_Def
{
public:
Function_Def(const char* n, uint32_t fg);
uint32_t get_funcgroup_id();
const char* get_name();
private:
const char* name;
uint32_t funcgroup_id;
};
inline Function_Def::Function_Def(const char* n, uint32_t fg)
:name(n), funcgroup_id(fg)
{
}
inline const char* Function_Def::get_name()
{
return name;
}
inline uint32_t Function_Def::get_funcgroup_id()
{
return funcgroup_id;
}
/********** Key **********/
class Function_Key
{
friend bool operator<(const Function_Key& f_key1, const Function_Key& f_keyy2);
friend bool operator==(const Function_Key& f_key1,const Function_Key& f_key2);
public:
Function_Key(uint32_t tr, uint32_t f, uint32_t p);
Function_Key(const Function_Key& f_key);
//private: (wenn Tests erfolgreich wieder freigeben)
uint32_t trace;
uint32_t func;
uint32_t proc;
};
inline Function_Key::Function_Key(uint32_t tr, uint32_t f, uint32_t p)
:trace(tr), func(f), proc(p)
{
}
inline Function_Key::Function_Key(const Function_Key& f_key)
:trace(f_key.trace), func(f_key.func), proc(f_key.proc)
{
}
/********** Value **********/
class Function_Value
{
friend int print_Funtion();
public:
Function_Value();
Function_Value(uint64_t inv, uint64_t excl, uint64_t incl);
Function_Value(const Function_Value& f_value);
Function_Value& operator+=(const Function_Value& func_value_add);
Function_Value& operator=(const Function_Value& f_value);
uint64_t get_invoc();
uint64_t get_excl_time();
uint64_t get_incl_time();
//private:(wenn Tests erfolgreich wieder freigeben)
uint64_t invoc;
uint64_t excl_time;
uint64_t incl_time;
};
inline Function_Value::Function_Value()
{
invoc = 0;
excl_time = 0;
incl_time = 0;
}
inline Function_Value::Function_Value(uint64_t inv, uint64_t excl, uint64_t incl)
:invoc(inv), excl_time(excl), incl_time(incl)
{
}
inline Function_Value::Function_Value(const Function_Value& f_value)
:invoc(f_value.invoc), excl_time(f_value.excl_time), incl_time(f_value.incl_time)
{
}
inline uint64_t Function_Value::get_invoc()
{
return invoc;
}
inline uint64_t Function_Value::get_excl_time()
{
return excl_time;
}
inline uint64_t Function_Value::get_incl_time()
{
return incl_time;
}
/*************************************** Counter ******************************************/
/********** Def_Key **********/
class Counter_Def_Key
{
friend bool operator<(const Counter_Def_Key& c1, const Counter_Def_Key& c2);
friend bool operator==(const Counter_Def_Key& c1, const Counter_Def_Key& c2);
public:
Counter_Def_Key(uint32_t tr, uint32_t c_id);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline Counter_Def_Key::Counter_Def_Key(uint32_t tr, uint32_t c_id)
:trace(tr), ident(c_id)
{
}
inline uint32_t Counter_Def_Key::get_trace()
{
return trace;
}
inline uint32_t Counter_Def_Key::get_ident()
{
return ident;
}
/********** Def **********/
class Counter_Def
{
public:
Counter_Def(const char* n, const char* u);
const char* get_name();
const char* get_unit();
private:
const char* name;
const char* unit;
};
inline Counter_Def::Counter_Def(const char* n, const char* u)
:name(n), unit(u)
{
}
inline const char* Counter_Def::get_name()
{
return name;
}
inline const char* Counter_Def::get_unit()
{
return unit;
}
/********** Key **********/
class Counter_Key
{
friend bool operator<(const Counter_Key& c_key1, const Counter_Key& c_key2);
friend bool operator==(const Counter_Key& c_key1,const Counter_Key& c_key2);
public:
Counter_Key(uint32_t tr, uint32_t f, uint32_t p, uint32_t c);
Counter_Key(const Counter_Key& c_key);
//private:(wenn Tests erfolgreich wieder freigeben)
uint32_t trace;
uint32_t func;
uint32_t proc;
uint32_t counter;
};
inline Counter_Key::Counter_Key(uint32_t tr, uint32_t f, uint32_t p, uint32_t c)
:trace(tr), func(f), proc(p), counter(c)
{
}
inline Counter_Key::Counter_Key(const Counter_Key& c_key)
:trace(c_key.trace), func(c_key.func), proc(c_key.proc), counter(c_key.counter)
{
}
/********** Value **********/
class Counter_Value
{
public:
Counter_Value();
Counter_Value(bool val, uint64_t excl, uint64_t incl);
Counter_Value(const Counter_Value& c_value);
Counter_Value& operator+=(const Counter_Value& c_value);
Counter_Value& operator=(const Counter_Value& c_value);
bool get_valid();
uint64_t get_excl_value();
uint64_t get_incl_value();
//private:(wenn Tests erfolgreich wieder freigeben)
bool valid;
uint64_t excl_value;
uint64_t incl_value;
};
inline Counter_Value::Counter_Value()
{
valid = VALID;
excl_value = 0;
incl_value = 0;
}
inline Counter_Value::Counter_Value(bool val, uint64_t excl, uint64_t incl)
:valid(val), excl_value(excl), incl_value(incl)
{
}
inline Counter_Value::Counter_Value(const Counter_Value& c_value)
:valid(c_value.valid), excl_value(c_value.excl_value), incl_value(c_value.incl_value)
{
}
inline bool Counter_Value::get_valid()
{
return valid;
}
inline uint64_t Counter_Value::get_excl_value()
{
return excl_value;
}
inline uint64_t Counter_Value::get_incl_value()
{
return incl_value;
}
/****************************************** P2P ********************************************/
/********** Key **********/
class P2P_Key
{
friend bool operator<(const P2P_Key& p2p_key1, const P2P_Key& p2p_key2);
friend bool operator==(const P2P_Key& p2p_key1,const P2P_Key& p2p_key2);
public:
P2P_Key(uint32_t tr, uint32_t send, uint32_t rec, uint32_t b_1, uint32_t b_2);
P2P_Key(const P2P_Key& p2p_key);
//private:(wenn Tests erfolgreich wieder freigeben)
uint32_t trace;
uint32_t sender;
uint32_t receiver;
uint32_t bin_1;
uint32_t bin_2;
};
inline P2P_Key::P2P_Key(uint32_t tr, uint32_t send, uint32_t rec, uint32_t b_1, uint32_t b_2)
:trace(tr), sender(send), receiver(rec), bin_1(b_1), bin_2(b_2)
{
}
inline P2P_Key::P2P_Key(const P2P_Key& p2p_key)
:trace(p2p_key.trace), sender(p2p_key.sender), receiver(p2p_key.receiver),
bin_1(p2p_key.bin_1), bin_2(p2p_key.bin_2)
{
}
/********** Value **********/
class P2P_Value
{
public:
P2P_Value();
P2P_Value(uint64_t inv, uint64_t l, uint64_t t);
P2P_Value(const P2P_Value& p2p_value);
P2P_Value& operator+=(const P2P_Value& p2p_value);
P2P_Value& operator=(const P2P_Value& p2p_value);
uint64_t get_invoc();
uint64_t get_length();
uint64_t get_time();
//private: (wenn Tests erfolgreich wieder freigeben)
uint64_t invoc;
uint64_t length;
uint64_t time;
};
inline P2P_Value::P2P_Value()
{
invoc = 0;
length = 0;
time = 0;
}
inline P2P_Value::P2P_Value(uint64_t inv, uint64_t l, uint64_t t)
:invoc(inv), length(l), time(t)
{
}
inline P2P_Value::P2P_Value(const P2P_Value& p2p_value)
:invoc(p2p_value.invoc), length(p2p_value.length), time(p2p_value.time)
{
}
inline uint64_t P2P_Value::get_invoc()
{
return invoc;
}
inline uint64_t P2P_Value::get_length()
{
return length;
}
inline uint64_t P2P_Value::get_time()
{
return time;
}
/**************************************** CollOp ******************************************/
/********** Def_Key **********/
class CollOp_Def_Key
{
friend bool operator<(const CollOp_Def_Key& c1, const CollOp_Def_Key& c2);
friend bool operator==(const CollOp_Def_Key& c1, const CollOp_Def_Key& c2);
public:
CollOp_Def_Key(uint32_t tr, uint32_t coll_id);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline CollOp_Def_Key::CollOp_Def_Key(uint32_t tr, uint32_t coll_id)
:trace(tr), ident(coll_id)
{
}
inline uint32_t CollOp_Def_Key::get_trace()
{
return trace;
}
inline uint32_t CollOp_Def_Key::get_ident()
{
return ident;
}
/********** Def **********/
class CollOp_Def
{
public:
CollOp_Def(const char* n, uint32_t t);
const char* get_name();
uint32_t get_type();
private:
const char* name;
uint32_t type;
};
inline CollOp_Def::CollOp_Def(const char* n, uint32_t t)
:name(n), type(t)
{
}
inline const char* CollOp_Def::get_name()
{
return name;
}
inline uint32_t CollOp_Def::get_type()
{
return type;
}
/********** Key **********/
class CollOp_Key
{
friend bool operator<(const CollOp_Key& coll_key1, const CollOp_Key& coll_key2);
friend bool operator==(const CollOp_Key& co_key1,const CollOp_Key& co_key2);
public:
CollOp_Key(uint32_t tr, uint32_t p, uint32_t co);
CollOp_Key(const CollOp_Key& coll_key);
//private:(wenn Tests erfolgreich wieder freigeben)
uint32_t trace;
uint32_t proc;
uint32_t collop;
};
inline CollOp_Key::CollOp_Key(uint32_t tr, uint32_t p, uint32_t co)
:trace(tr), proc(p), collop(co)
{
}
inline CollOp_Key::CollOp_Key(const CollOp_Key& coll_key)
:trace(coll_key.trace), proc(coll_key.proc), collop(coll_key.collop)
{
}
/********** Value **********/
class CollOp_Value
{
public:
CollOp_Value();
CollOp_Value(uint64_t inv_s, uint64_t inv_r, uint64_t l_s, uint64_t l_r, uint64_t t);
CollOp_Value(const CollOp_Value& coll_value);
CollOp_Value& operator+=(const CollOp_Value& coll_value);
CollOp_Value& operator=(const CollOp_Value& co_value);
uint64_t get_invoc_send();
uint64_t get_invoc_receive();
uint64_t get_length_send();
uint64_t get_length_receive();
uint64_t get_time();
//private:(wenn Tests erfolgreich wieder freigeben)
uint64_t invoc_send;
uint64_t invoc_receive;
uint64_t length_send;
uint64_t length_receive;
uint64_t time;
};
inline CollOp_Value::CollOp_Value()
{
invoc_send = 0;
invoc_receive = 0;
length_send = 0;
length_receive = 0;
time = 0;
}
inline CollOp_Value::CollOp_Value(uint64_t inv_s, uint64_t inv_r, uint64_t l_s, uint64_t l_r,
uint64_t t)
:invoc_send(inv_s), invoc_receive(inv_r), length_send(l_s), length_receive(l_r), time(t)
{
}
inline CollOp_Value::CollOp_Value(const CollOp_Value& coll_value)
:invoc_send(coll_value.invoc_send), invoc_receive(coll_value.invoc_receive),
length_send(coll_value.length_send), length_receive(coll_value.length_receive),
time(coll_value.time)
{
}
inline uint64_t CollOp_Value::get_invoc_send()
{
return invoc_send;
}
inline uint64_t CollOp_Value::get_invoc_receive()
{
return invoc_receive;
}
inline uint64_t CollOp_Value::get_length_send()
{
return length_send;
}
inline uint64_t CollOp_Value::get_length_receive()
{
return length_receive;
}
inline uint64_t CollOp_Value::get_time()
{
return time;
}
/**************************************** Bin_1 ******************************************/
/********** Key **********/
class Bin_1_Key
{
friend bool operator<(const Bin_1_Key& c1, const Bin_1_Key& c2);
friend bool operator==(const Bin_1_Key& c1, const Bin_1_Key& c2);
public:
Bin_1_Key(uint32_t tr, uint32_t b);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline Bin_1_Key::Bin_1_Key(uint32_t tr, uint32_t b)
:trace(tr), ident(b)
{
}
inline uint32_t Bin_1_Key::get_trace()
{
return trace;
}
inline uint32_t Bin_1_Key::get_ident()
{
return ident;
}
/********** Value **********/
class Bin_1_Value
{
public:
Bin_1_Value(uint64_t min, uint64_t max);
uint64_t get_min_value();
uint64_t get_max_value();
private:
uint64_t min_value;
uint64_t max_value;
};
inline Bin_1_Value::Bin_1_Value(uint64_t min, uint64_t max)
:min_value(min), max_value(max)
{
}
inline uint64_t Bin_1_Value::get_min_value()
{
return min_value;
}
inline uint64_t Bin_1_Value::get_max_value()
{
return max_value;
}
/**************************************** Bin_2 ******************************************/
/********** Key **********/
class Bin_2_Key
{
friend bool operator<(const Bin_2_Key& c1, const Bin_2_Key& c2);
friend bool operator==(const Bin_2_Key& c1, const Bin_2_Key& c2);
public:
Bin_2_Key(uint32_t tr, uint32_t b);
uint32_t get_trace();
uint32_t get_ident();
private:
uint32_t trace;
uint32_t ident;
};
inline Bin_2_Key::Bin_2_Key(uint32_t tr, uint32_t b)
:trace(tr), ident(b)
{
}
inline uint32_t Bin_2_Key::get_trace()
{
return trace;
}
inline uint32_t Bin_2_Key::get_ident()
{
return ident;
}
/********** Value **********/
class Bin_2_Value
{
public:
Bin_2_Value(uint64_t min, uint64_t max);
uint64_t get_min_value();
uint64_t get_max_value();
//private:
uint64_t min_value;
uint64_t max_value;
};
inline Bin_2_Value::Bin_2_Value(uint64_t min, uint64_t max)
:min_value(min), max_value(max)
{
}
inline uint64_t Bin_2_Value::get_min_value()
{
return min_value;
}
inline uint64_t Bin_2_Value::get_max_value()
{
return max_value;
}
/********************************** Summary_Container *************************************/
class Summary_Container
{
/* maps with the values */
typedef map<Function_Key,Function_Value> FunctionMap;
typedef map<Counter_Key,Counter_Value> CounterMap;
typedef map<P2P_Key,uint64_t> p2pTimeMap;
typedef map<CollOp_Key,CollOp_Value> CollOpMap;
typedef map<uint32_t,const char*> TraceMap;
typedef map<Process_Def_Key,uint64_t> ProcTimeMap;
typedef map<uint32_t,uint64_t> ProgTimeMap;
/* maps with the definitions */
typedef map<Function_Def_Key,Function_Def> FuncDefMap;
typedef map<FG_Def_Key,const char*> FGDefMap;
typedef map<Process_Def_Key,const char*> ProcDefMap;
typedef map<CollOp_Def_Key,CollOp_Def> CollOpDefMap;
typedef map<Counter_Def_Key,Counter_Def> CounterDefMap;
typedef map<uint32_t,uint64_t> TicksDefMap;
typedef map<Bin_1_Key,Bin_1_Value> Bin1Map;
typedef map<Bin_2_Key,Bin_2_Value> Bin2Map;
/* trace sender receiver bin1 bin2 Value */
typedef map<uint32_t, map<uint32_t, map<uint32_t, map<uint32_t, map<uint32_t, P2P_Value> > > > > P2PMap;
public:
int adddef_Function(Function_Def_Key f_def_key, Function_Def f_def);
int adddef_Counter(Counter_Def_Key c_def_key, Counter_Def c_def);
int adddef_FG(FG_Def_Key fg_def_key, const char* name);
int adddef_Proc(Process_Def_Key p_def_key, const char* name);
int adddef_CollOp(CollOp_Def_Key coll_def_key, CollOp_Def coll_def);
int adddef_Ticks(uint32_t trace, uint64_t ticks);
int adddef_Trace(uint32_t trace, const char* name);
int adddef_Bin(uint32_t trace);
int setdef_Bin1(uint32_t trace, uint32_t bin, uint64_t min, uint64_t max);
int setdef_Bin2(uint32_t trace, uint32_t bin, uint64_t min, uint64_t max);
int set_ProgTime(uint32_t trace, uint64_t time);
int addvalues_Function(uint32_t trace, uint32_t func, uint32_t proc, uint64_t invoc,
uint64_t excl_time, uint64_t incl_time);
int resetvalues_Function(uint32_t trace, uint32_t func, uint32_t proc,
uint64_t invoc, uint64_t excl_time,
uint64_t incl_time);
int addvalues_Counter(uint32_t trace, uint32_t func, uint32_t proc, uint32_t counter,
uint64_t excl_value, uint64_t incl_value, bool valid);
int addvalues_P2P(uint32_t trace, uint32_t sender, uint32_t receiver, uint32_t bin_1,
uint32_t bin_2, uint64_t invoc, uint64_t length, uint64_t time);
int resetvalues_P2P(uint32_t trace, uint32_t sender, uint32_t receiver, uint32_t bin_1,
uint32_t bin_2, uint64_t invoc, uint64_t length, uint64_t time);
int addvalues_CollOp(uint32_t trace, uint32_t proc, uint32_t type, uint64_t invoc_send,
uint64_t invoc_receive, uint64_t length_send,
uint64_t length_receive, uint64_t time);
int resetvalues_CollOp(uint32_t trace, uint32_t proc, uint32_t collop,
uint64_t invoc_send, uint64_t invoc_receive, uint64_t length_send, uint64_t length_receive, uint64_t time);
int addvalues_ProcTime(uint32_t trace, uint32_t proc,uint64_t time);
int get_Function_Def_Key(uint32_t trace, vector<uint32_t>& f_vector);
int get_Counter_Def_Key(uint32_t trace, vector<uint32_t>& c_vector);
int get_Process_Def_Key(uint32_t trace, vector<uint32_t>& p_vector);
int get_FG_Def_Key(uint32_t trace, vector<uint32_t>& fg_vector);
int get_CollOp_Def_Key(uint32_t trace, vector<uint32_t>& collop_vector);
int get_Bin1_Def_Key(uint32_t trace, vector<uint32_t>& bin1_vector);
int get_Bin2_Def_Key(uint32_t trace, vector<uint32_t>& bin2_vector);
int get_Trace(vector<uint32_t>& trace_vector);
Function_Def get_Function_Def(uint32_t trace, uint32_t func);
Counter_Def get_Counter_Def(uint32_t trace, uint32_t counter);
const char* get_Process_Def(uint32_t trace, uint32_t proc);
const char* get_FG_Def(uint32_t trace, uint32_t fg);
const char* get_Trace_name(uint32_t trace);
CollOp_Def get_CollOp_Def(uint32_t trace, uint32_t collop);
uint32_t get_CollOpType_Def(uint32_t trace, uint32_t collop);
Function_Value get_Function(uint32_t trace, uint32_t func, uint32_t proc);
Counter_Value get_Counter(uint32_t trace, uint32_t func, uint32_t proc,
uint32_t counter);
P2P_Value get_P2P(uint32_t trace, uint32_t sender, uint32_t receiver, uint32_t bin_1,
uint32_t bin_2);
CollOp_Value get_CollOp(uint32_t trace, uint32_t proc, uint32_t collop);
CollOp_Value get_CollOpType(uint32_t trace, uint32_t proc, uint32_t type);
uint64_t get_ProgTime(uint32_t trace);
uint64_t get_ProcTime(uint32_t trace, uint32_t proc);
uint64_t get_ticks(uint32_t trace);
uint32_t get_bin_1(uint64_t length);
uint32_t get_bin_2(double speed);
int get_color_gray(double min, double max, double value,
float& red, float& green, float& blue);
int get_color_gray(uint64_t min, uint64_t max, uint64_t value,
float& red, float& green, float& blue);
int get_color(double min, double max, double value,
float& red, float& green, float& blue);
int get_color(uint64_t min, uint64_t max, uint64_t value,
float& red, float& green, float& blue);
int get_gray(double min, double max, double value,
float& red, float& green, float& blue);
int get_gray(uint64_t min, uint64_t max, uint64_t value,
float& red, float& green, float& blue);
bool find_FG(FG_Def_Key fg_def_key);
bool find_Function(Function_Def_Key f_def_key);
bool find_Counter(Counter_Def_Key c_def_key);
bool find_CollOp(CollOp_Def_Key coll_def_key);
int csv_Function(fstream& out, uint32_t trace);
int csv_P2P(fstream& out, uint32_t trace);
int csv_CollOp(fstream& out, uint32_t trace);
int csv_Data(fstream& out, uint32_t trace);
int mergeContainer(Summary_Container& container);
private:
FunctionMap function_map;
CounterMap counter_map;
P2PMap p2p_map;
p2pTimeMap p2p_time_map;
CollOpMap collop_map;
TraceMap trace_map;
ProcTimeMap proctime_map;
ProgTimeMap progtime_map;
FuncDefMap func_def_map;
FGDefMap fg_def_map;
ProcDefMap proc_def_map;
CollOpDefMap collop_def_map;
CounterDefMap counter_def_map;
TicksDefMap ticks_def_map;
Bin1Map bin_1_map;
Bin2Map bin_2_map;
};
/*
template<class T>
bool operator<(const T& c1, const T& c2)
{
if(c1.trace != c2.trace)
return (c1.trace < c2.trace);
else if(c1.ident != c2.ident)
return (c1.ident < c2.ident);
else
return false;
}
template<class T>
bool operator==(const T& c1, const T& c2)
{
if(((0 == c1.trace) || (0 == c2.trace) || (c1.trace == c2.trace)) &&
((0 == c1.ident) || (0 == c2.ident) || (c1.ident == c2.ident)))
return true;
else
return false;
}
*/
#endif /* DATASTRUCTURE_H */

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

@ -1,64 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#define _BYTE 1.0
#define KBYTE 1024.0
#define MBYTE 1048576.0
#define GBYTE 1073741824.0
#define KILO 1000.0
#define MEGA 1000000.0
#define GIGA 1000000000.0
/* scale units */
#define SECOND " sec"
#define K_SECOND " K*sec"
#define M_SECOND " M*sec"
#define G_SECOND " G*sec"
#define INVOC " \\#"
#define K_INVOC " K*\\#"
#define M_INVOC " M*\\#"
#define G_INVOC " G*\\#"
#define BYTE_SEC " Byte/s"
#define KBYTE_SEC " KByte/s"
#define MBYTE_SEC " MByte/s"
#define GBYTE_SEC " GByte/s"
#define BYTE_TEXT " Byte"
#define KBYTE_TEXT " KByte"
#define MBYTE_TEXT " MByte"
#define GBYTE_TEXT " GByte"
/* specify which global summary should be printed */
#define TEX_OFF -1
#define TEX_ALL 0
#define TEX_ALLPLOT 1
#define TEX_FUNC 2
#define TEX_P2P 3
#define TEX_COLLOP 4
/* definitions for prodtex */
#define TINY_TEX 6 //range of color (6 different colors)
#define SMALL_TEX 11 //range of color (11 different colors)
#define MIDDLE_TEX 16 //range of color (16 different colors)
#define LARGE_TEX 21 //range of color (21 different colors)
#define HUGE_TEX 26 //range of color (26 different colors)
#define P2P_AV_RAT 1 // Average Rate P2P
#define P2P_AV_DUR 2 // Average Duration P2P
#define P2P_AV_LEN 3 // Average Message Length P2P
#define P2P_SUM_DUR 4 // Sum of Duration P2P
#define P2P_SUM_LEN 5 // Sum of Message Length P2P
#define P2P_ALL 6 // All plots
#define MAXIMUM(x , y) (((x) > (y)) ? (x) : (y))
#define MINIMUM(x , y) (((x) < (y)) ? (x) : (y))
#endif /* DEFINITIONS_H */

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

@ -1,457 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#include "OTF_Platform.h"
#include "Handler.h"
#include "Summary.h"
int save_temp(global_data* gd_ptr);
/* SummaryHandler */
int handleFunctionSummary (void *firsthandlerarg, uint64_t time, uint32_t func, uint32_t proc, uint64_t invocations, uint64_t exclTime, uint64_t inclTime) {
global_data* gd_ptr = (global_data*)firsthandlerarg;
gd_ptr->sum_container.resetvalues_Function(1,func, proc, invocations, exclTime, inclTime);
return RETURN_HANDLER_OK;
}
int handleMessageSummary (void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t peer, uint32_t comm, uint32_t type, uint64_t sentNumber, uint64_t receivedNumber, uint64_t sentBytes, uint64_t receivedBytes)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
if(peer == 0) peer = (uint32_t) -1;
//int bin1 = gd_ptr->sum_container.get_bin_1(sentBytes);
gd_ptr->sum_container.resetvalues_P2P(1, process, peer, 1, 1, sentNumber, sentBytes, time);
gd_ptr->sum_container.resetvalues_P2P(1, peer, process, 1, 1, receivedNumber, receivedBytes, time);
return RETURN_HANDLER_OK;
}
int handleCollopSummary (void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t comm,
uint32_t collective, uint64_t sentNumber, uint64_t receivedNumber,
uint64_t sentBytes, uint64_t receivedBytes) {
/* message length in Summary is calculated differently compared to hanldeCollectiveOperation() */
global_data* gd_ptr = (global_data*)firsthandlerarg;
gd_ptr->sum_container.resetvalues_CollOp(1, process, collective, sentNumber, receivedNumber, sentBytes, receivedBytes, time);
return RETURN_HANDLER_OK;
}
/****************/
int handleDefCreator(void *firsthandlerarg, uint32_t stream, const char *creator) {
global_data* gd_ptr = (global_data*)firsthandlerarg;
gd_ptr->creator = creator;
return RETURN_HANDLER_OK;
}
int handleDefVersion(void *firsthandlerarg, uint32_t stream, uint8_t major, uint8_t minor, uint8_t sub, const char *string) {
global_data* gd_ptr = (global_data*)firsthandlerarg;
char ver[30];
snprintf(ver,30,"%u.%u.%u %s",major,minor,sub,string);
gd_ptr->version = ver;
return RETURN_HANDLER_OK;
}
int handleDefTimerResolution(void* firsthandlerarg, uint32_t streamid, uint64_t ticks_per_sec)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
gd_ptr->sum_container.adddef_Ticks(1, ticks_per_sec);
gd_ptr->ticks = ticks_per_sec;
return RETURN_HANDLER_OK;
}
int handleDefFunction(void* firsthandlerarg, uint32_t streamid,
uint32_t func, const char* name, uint32_t group, uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
Function_Def_Key f_def_key(1, func);
if(name == NULL)
{
Function_Def f_def("Function", group);
gd_ptr->sum_container.adddef_Function(f_def_key, f_def);
}
else
{
Function_Def f_def(strdup(name), group);
gd_ptr->sum_container.adddef_Function(f_def_key, f_def);
}
return RETURN_HANDLER_OK;
}
int handleDefFunctionGroup(void* firsthandlerarg, uint32_t streamid,
uint32_t funcg, const char* name)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
FG_Def_Key fg_def_key(1, funcg);
if(name == NULL)
{
gd_ptr->sum_container.adddef_FG(fg_def_key, "FuncGroup");
}
else
{
gd_ptr->sum_container.adddef_FG(fg_def_key, strdup(name));
}
return RETURN_HANDLER_OK;
}
int handleDefProcess(void* firsthandlerarg, uint32_t streamid,
uint32_t proc, const char* name, uint32_t parent)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
Process_Def_Key p_def_key(1, proc);
if(name == NULL)
{
gd_ptr->sum_container.adddef_Proc(p_def_key, "Process");
}
else
{
char* dup= strdup( name );
char* p= dup;
while ( '\0' != *p ) {
if ( '_' == *p ) *p= ' ';
if ( '\\' == *p ) *p= ' ';
p++;
}
gd_ptr->sum_container.adddef_Proc(p_def_key, dup );
}
Process p;
/* ignore in lite mode */
if ( ! lite ) {
/* make empty recv_map for all processes */
for(uint32_t i=1; i<= gd_ptr->num_cpu; i++) {
p.clear_recv_map(i);
}
}
gd_ptr->p_map.insert(pair<uint32_t,Process>(proc, p));
return RETURN_HANDLER_OK;
}
int handleDefProcessGroup(void *firsthandlerarg, uint32_t stream, uint32_t procGroup,
const char *name, uint32_t numberOfProcs, const uint32_t *procs)
{
global_data* gd_ptr= (global_data*)firsthandlerarg;
gd_ptr->p_group_map[procGroup] = numberOfProcs;
return RETURN_HANDLER_OK;
}
int handleDefCollectiveOperation(void* firsthandlerarg, uint32_t streamid,
uint32_t collop, const char* name, uint32_t type)
{
global_data* gd_ptr= (global_data*)firsthandlerarg;
CollOp_Def_Key collop_def_key(1, collop);
if(name == NULL)
{
CollOp_Def collop_def("CollOp", type);
gd_ptr->sum_container.adddef_CollOp(collop_def_key, collop_def);
}
else
{
CollOp_Def collop_def(strdup(name), type);
gd_ptr->sum_container.adddef_CollOp(collop_def_key, collop_def);
}
return RETURN_HANDLER_OK;
}
int handleDefCounter( void* firsthandlerarg, uint32_t streamid,
uint32_t counter, const char* name, uint32_t properties,
uint32_t countergroup, const char* unit )
{
if(properties == OTF_COUNTER_TYPE_ACC)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
Counter_Def_Key c_def_key(1, counter);
if(name == NULL)
{
Counter_Def c_def("Counter", strdup(unit));
gd_ptr->sum_container.adddef_Counter(c_def_key,c_def);
}
else
{
Counter_Def c_def(strdup(name), strdup(unit));
gd_ptr->sum_container.adddef_Counter(c_def_key,c_def);
}
}
return RETURN_HANDLER_OK;
}
int handleEnter(void* firsthandlerarg, uint64_t time, uint32_t func,
uint32_t proc, uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
if(time > gd_ptr->max_time && gd_ptr->clear_temp) {
return RETURN_HANDLER_ABORT;
}
else if(time > gd_ptr->max_time)
{
save_temp(gd_ptr);
gd_ptr->clear_temp = true;
return RETURN_HANDLER_ABORT;
}
uint64_t enter_time = time;
if(time < gd_ptr->min_time)
enter_time = gd_ptr->min_time;
ProcessMap::iterator it_p = gd_ptr->p_map.find(proc);
if(it_p == gd_ptr->p_map.end())
{
cerr << "\nprocess : " << proc
<< "\n This process wasn't defined. That could cause a failure of the program"
<< endl;
return OTF_RETURN_BREAK;
}
it_p->second.set_exclTime(func, enter_time);
it_p->second.set_proc_start(enter_time);
if(gd_ptr->prog_start > enter_time)
{
gd_ptr->prog_start = enter_time;
}
return RETURN_HANDLER_OK;
}
int handleLeave(void* firsthandlerarg, uint64_t time, uint32_t func,
uint32_t proc, uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
pair<uint32_t, uint64_t> data_exclt;
if(time > gd_ptr->max_time && gd_ptr->clear_temp) {
return RETURN_HANDLER_ABORT;
}
else if(time > gd_ptr->max_time)
{
save_temp(gd_ptr);
gd_ptr->clear_temp = true;
return RETURN_HANDLER_ABORT;
}
ProcessMap::iterator it_p = gd_ptr->p_map.find(proc);
if(it_p == gd_ptr->p_map.end()) {
cerr << "\nFailure in the otf-file.The process in the leaving event doesn't exist."
<< endl;
}
else
{
it_p->second.get_exclTime(func, proc, time, gd_ptr);
it_p->second.set_proc_end(time);
if(gd_ptr->prog_end < time) {
gd_ptr->prog_end = time;
}
}
return RETURN_HANDLER_OK;
}
int handleCounter(void* firsthandlerarg, uint64_t time, uint32_t proc,
uint32_t counter, uint64_t value)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
Counter_Def_Key c_def_key(1, counter);
if(gd_ptr->sum_container.find_Counter(c_def_key))
{
ProcessMap::iterator it_p = gd_ptr->p_map.find(proc);
if(it_p == gd_ptr->p_map.end())
cerr << "\nFailure in the otf-file.The process in the counter event doesn't exist."
<< endl;
else
it_p->second.set_counter(counter, time, value, gd_ptr);
}
return RETURN_HANDLER_OK;
}
int handleSendMsg(void* firsthandlerarg, uint64_t time, uint32_t sender,
uint32_t receiver, uint32_t communicator, uint32_t msgtype, uint32_t msglength,
uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
if(time > gd_ptr->max_time && gd_ptr->clear_temp) {
return RETURN_HANDLER_ABORT;
}
else if(time > gd_ptr->max_time)
{
save_temp(gd_ptr);
gd_ptr->clear_temp = true;
return RETURN_HANDLER_ABORT;
}
ProcessMap::iterator it = gd_ptr->p_map.find(sender);
if(it == gd_ptr->p_map.end())
cerr << "\nError in SendMsg event. Sender " << sender << " unknown." << endl;
if(time < gd_ptr->min_time)
it->second.set_mbyte_per_sec(sender, receiver, time, msgtype, INVALID, gd_ptr);
else
it->second.set_mbyte_per_sec(sender, receiver, time, msgtype, VALID, gd_ptr);
return RETURN_HANDLER_OK;
}
int handleRecvMsg(void* firsthandlerarg, uint64_t time, uint32_t receiver,
uint32_t sender, uint32_t communicator, uint32_t msgtype, uint32_t msglength,
uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
if(time > gd_ptr->max_time && gd_ptr->clear_temp) {
return RETURN_HANDLER_ABORT;
}
else if(time > gd_ptr->max_time)
{
save_temp(gd_ptr);
gd_ptr->clear_temp = true;
return RETURN_HANDLER_ABORT;
}
ProcessMap::iterator it = gd_ptr->p_map.find(receiver);
if(it == gd_ptr->p_map.end())
cerr << "\nError in RecvMsg event. Sender " << sender << " unknown." << endl;
it->second.get_mbyte_per_sec(sender, receiver, time, msglength, msgtype, gd_ptr);
return RETURN_HANDLER_OK;
}
int handleCollectiveOperation(void* firsthandlerarg, uint64_t time,
uint32_t proc, uint32_t collop, uint32_t procgroup,
uint32_t rootprocess, uint32_t sent, uint32_t received,
uint64_t duration, uint32_t scltoken)
{
global_data* gd_ptr = (global_data*)firsthandlerarg;
uint32_t type;
if(time > gd_ptr->max_time && gd_ptr->clear_temp)
return RETURN_HANDLER_ABORT;
else if(time > gd_ptr->max_time)
{
save_temp(gd_ptr);
gd_ptr->clear_temp = true;
return RETURN_HANDLER_ABORT;
}
else if(time < gd_ptr->min_time)
return RETURN_HANDLER_OK;
ProcessMap::iterator it_p = gd_ptr->p_map.find(proc);
if((type = gd_ptr->sum_container.get_CollOpType_Def(1, collop)) != 0)
{
if(proc == rootprocess)
it_p->second.set_data_collective(proc, collop, type, true, procgroup, sent, received, duration,
gd_ptr);
else
it_p->second.set_data_collective(proc, collop, type, false, procgroup, sent, received, duration,
gd_ptr);
}
else
{
cerr << "\nCollOp : " << collop << " started on Process " << proc << " wasn't defined."
<< " That's a failure in the otf-file." << endl;
}
return RETURN_HANDLER_OK;
}
int set_time_sum_container(global_data* gd_ptr)
{
uint64_t time = 0;
uint64_t prog_time = 0;
ProcessMap::iterator it_p = gd_ptr->p_map.begin();
while(it_p != gd_ptr->p_map.end())
{
if(it_p->second.get_proc_end() < it_p->second.get_proc_start())
{
time = 0;
cerr << "Error, proc_start is greater than proc_end." << endl;
}
else
{
time = it_p->second.get_proc_end() - it_p->second.get_proc_start();
}
gd_ptr->sum_container.addvalues_ProcTime(1, it_p->first, time);
++it_p;
}
if(gd_ptr->prog_end < gd_ptr->prog_start)
{
cerr << "Error, prog_start is greater than prog_end." << endl;
}
else
{
prog_time = gd_ptr->prog_end - gd_ptr->prog_start;
}
gd_ptr->sum_container.set_ProgTime(1, prog_time);
return 0;
}
int mergeProgTime(global_data* gd, global_data* data) {
if(gd->prog_start > data->prog_start) {
gd->prog_start = data->prog_start;
}
if(gd->prog_end < data->prog_end) {
gd->prog_end = data->prog_end;
}
uint64_t time = gd->prog_end - gd->prog_start;
gd->sum_container.set_ProgTime(1, time);
return 0;
}
/* this function clears the stack for the exclusive time in each object of the class Process */
int save_temp(global_data* gd_ptr)
{
ProcessMap::iterator it_p = gd_ptr->p_map.begin();
uint32_t f_id;
while(it_p != gd_ptr->p_map.end())
{
if(it_p->second.get_stack_status())
++it_p;
else
{
while(!it_p->second.get_stack_status())
{
f_id = it_p->second.get_stack_top_func_id();
it_p->second.get_exclTime(f_id, it_p->first, gd_ptr->max_time, gd_ptr);
}
++it_p;
}
}
return 0;
}

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

@ -1,80 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2011.
Authors: Andreas Knuepfer, Denis Huenich, Johannes Spazier
*/
#ifndef HANDLER_H
#define HANDLER_H
#include "OTF_inttypes.h"
#include "Summary.h"
#define RETURN_HANDLER_OK 0
#define RETURN_HANDLER_ABORT 1
using namespace std;
/* SummaryHandler */
int handleFunctionSummary (void *firsthandlerarg, uint64_t time, uint32_t function, uint32_t process, uint64_t invocations, uint64_t exclTime, uint64_t inclTime);
int handleMessageSummary (void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t peer, uint32_t comm, uint32_t type, uint64_t sentNumber, uint64_t receivedNumber, uint64_t sentBytes, uint64_t receivedBytes);
int handleCollopSummary (void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t comm, uint32_t collective,
uint64_t sentNumber, uint64_t receivedNumber, uint64_t sentBytes, uint64_t receivedBytes);
/*********************/
int handleDefCreator(void *firsthandlerarg, uint32_t stream, const char *creator);
int handleDefVersion(void *firsthandlerarg, uint32_t stream, uint8_t major, uint8_t minor, uint8_t sub, const char *string);
int handleDefTimerResolution(void* firsthandlerarg, uint32_t streamid, uint64_t ticks_per_sec);
int handleDefFunction(void* firsthandlerarg, uint32_t streamid,
uint32_t func, const char* name, uint32_t group, uint32_t scltoken);
int handleDefFunctionGroup(void* firsthandlerarg, uint32_t streamid,
uint32_t funcg, const char* name);
int handleDefProcess(void* firsthandlerarg, uint32_t streamid,
uint32_t proc, const char* name, uint32_t parent);
int handleDefProcessGroup(void *firsthandlerarg, uint32_t stream,
uint32_t procGroup, const char *name, uint32_t numberOfProcs,
const uint32_t *procs);
int handleDefCollectiveOperation(void* firsthandlerarg, uint32_t streamid,
uint32_t collop, const char* name, uint32_t type);
int handleDefCounter(void* firsthandlerarg, uint32_t streamid,
uint32_t counter, const char* name, uint32_t properties,
uint32_t countergroup, const char* unit);
int handleEnter(void* firsthandlerarg, uint64_t time, uint32_t func,
uint32_t proc, uint32_t scltoken);
int handleLeave(void* firsthandlerarg, uint64_t time, uint32_t func,
uint32_t proc, uint32_t scltoken);
int handleCounter(void* firsthandlerarg, uint64_t time, uint32_t proc,
uint32_t counter, uint64_t value);
int handleRecvMsg(void* firsthandlerarg, uint64_t time, uint32_t receiver,
uint32_t sender, uint32_t communicator, uint32_t msgtype, uint32_t msglength,
uint32_t scltoken);
int handleSendMsg(void* firsthandlerarg, uint64_t time, uint32_t sender,
uint32_t receiver, uint32_t communicator, uint32_t msgtype, uint32_t msglength,
uint32_t scltoken);
int handleCollectiveOperation(void* firsthandlerarg, uint64_t time,
uint32_t proc, uint32_t collop, uint32_t procgroup,
uint32_t rootprocess, uint32_t sent, uint32_t received,
uint64_t duration, uint32_t scltoken);
int set_time_sum_container(global_data* gd_ptr);
int mergeProgTime(global_data* gd, global_data* data);
#endif /* HANDLER_H */

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

@ -1,28 +1,18 @@
INCLUDES = -I$(top_builddir)/otflib -I$(top_srcdir)/otflib
if AMHAVEMPI
SUBDIRS = . mpi
endif
if AMBUILDBINARIES
bin_PROGRAMS = \
otfprofile
bin_PROGRAMS = otfprofile
endif
if AMHAVEOMP
otfprofile_CXXFLAGS = $(OPENMP_CXXFLAGS)
otfprofile_LDFLAGS = $(OPENMP_CXXFLAGS)
endif
OTFPROFILESRCDIR = $(srcdir)
include $(srcdir)/Makefile.common
otfprofile_LDADD = $(top_builddir)/otflib/libotf.la $(MATHLIB)
otfprofile_DEPENDENCIES = $(top_builddir)/otflib/libotf.la
otfprofile_SOURCES = \
CSVParse.h \
DataStructure.h \
Definitions.h \
Handler.h \
Prodtex.h \
Summary.h \
otfprofile.cpp \
CSVParse.cpp \
DataStructure.cpp \
Handler.cpp \
Prodtex.cpp \
Summary.cpp
INCLUDES = $(COMMONINCLUDES)
otfprofile_CXXFLAGS = $(COMMONCXXFLAGS)
otfprofile_LDADD = $(COMMONLDADD)
otfprofile_DEPENDENCIES = $(COMMONDEPENDENCIES)
otfprofile_SOURCES = $(COMMONSOURCES)

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

@ -0,0 +1,27 @@
COMMONINCLUDES = \
-I$(OTFPROFILESRCDIR) \
-I$(top_builddir)/otflib -I$(top_srcdir)/otflib \
-I$(top_builddir)/otfauxlib -I$(top_srcdir)/otfauxlib
COMMONCXXFLAGS =
COMMONLDADD = $(top_builddir)/otflib/libotf.la $(MATHLIB)
COMMONDEPENDENCIES = $(top_builddir)/otflib/libotf.la
COMMONSOURCES = \
$(OTFPROFILESRCDIR)/clustering.h \
$(OTFPROFILESRCDIR)/collect_data.h \
$(OTFPROFILESRCDIR)/comparison.h \
$(OTFPROFILESRCDIR)/create_csv.h \
$(OTFPROFILESRCDIR)/create_latex.h \
$(OTFPROFILESRCDIR)/datastructs.h \
$(OTFPROFILESRCDIR)/otfprofile.h \
$(OTFPROFILESRCDIR)/summarize_data.h \
$(OTFPROFILESRCDIR)/clustering.cpp \
$(OTFPROFILESRCDIR)/collect_data.cpp \
$(OTFPROFILESRCDIR)/comparison_clinkage.cpp \
$(OTFPROFILESRCDIR)/comparison_kmeans.cpp \
$(OTFPROFILESRCDIR)/create_csv.cpp \
$(OTFPROFILESRCDIR)/create_latex.cpp \
$(OTFPROFILESRCDIR)/otfprofile.cpp \
$(OTFPROFILESRCDIR)/summarize_data.cpp \
$(OTFPROFILESRCDIR)/summarize_data.h

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