1
1

Added important changes and bugfixes respectively from VT-trunk (backport)

This commit was SVN r19410.
Этот коммит содержится в:
Matthias Jurenz 2008-08-26 11:41:23 +00:00
родитель 063837a413
Коммит 80473b1725
146 изменённых файлов: 1602 добавлений и 1050 удалений

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

@ -213,3 +213,15 @@
- added configure option '--[enable|disable]-binaries' to control
building of binaries (useful for multi-lib installations)
5.4.6
- updated version of internal OTF to 1.3.11 (see extlib/otf/ChangeLog)
- added support for Cray CNL
- added support for automatic instrumentation by using Pathscale
compiler (version 3.1 or higher required)
- fixed a bug in vtfilter where the tool dies when a counter appears
outside of function
- fixed faulty shell comparison in configure which may cause an infinite
loop
- bugfix: added configure check for I/O functions functions 'fseeko()'
(this function is not available on NEC SX platforms)
- enhancement to OPARI (see tools/opari/ChangeLog:14,15)

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

@ -8,7 +8,7 @@
major=5
minor=4
release=5
release=6
# greek is used for alpha or beta release tags. If it is non-empty,
# it will be appended to the version number. It does not have to be

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

@ -67,8 +67,9 @@ AC_DEFUN([ACVT_COMPINST],
force_compinst="no"
build_compinst_gnu="no"
build_compinst_intel="no"
build_compinst_pathscale="no"
build_compinst_pgi="no"
build_compinst_phat="no"
build_compinst_sun="no"
build_compinst_xl="no"
build_compinst_ftrace="no"
compinst_list=
@ -78,7 +79,7 @@ AC_DEFUN([ACVT_COMPINST],
AC_ARG_ENABLE(compinst,
AC_HELP_STRING([--enable-compinst=COMPINSTLIST],
[enable support for compiler instrumentation (gnu,intel,pgi,phat,xl,ftrace), default: automatically by configure]),
[enable support for compiler instrumentation (gnu,intel,pathscale,pgi,sun,xl,ftrace), default: automatically by configure]),
[AS_IF([test x"$enableval" = "xno"], [check_compinst="no"], [enable_compinst="$enableval"])])
AS_IF([test x"$check_compinst" = "xyes"],
@ -105,15 +106,20 @@ AC_DEFUN([ACVT_COMPINST],
AS_IF([test x"$first" = "xyes"],
[compinst_default="intel"])
;;
pathscale)
build_compinst_pathscale="yes"
AS_IF([test x"$first" = "xyes"],
[compinst_default="pathscale"])
;;
pgi)
build_compinst_pgi="yes"
AS_IF([test x"$first" = "xyes"],
[compinst_default="pgi"])
;;
phat)
build_compinst_phat="yes"
sun)
build_compinst_sun="yes"
AS_IF([test x"$first" = "xyes"],
[compinst_default="phat"])
[compinst_default="sun"])
;;
xl)
build_compinst_xl="yes"
@ -150,6 +156,17 @@ AC_DEFUN([ACVT_COMPINST],
AC_MSG_RESULT([intel])
])
;;
pathcc* | scpathcc*)
compver=`$CC -dumpversion`
compver_major=`echo $compver | cut -d '.' -f 1`
compver_minor=`echo $compver | cut -d '.' -f 2`
AS_IF([test $compver_major -ge 3 -a $compver_minor -ge 1],
[
build_compinst_intel="yes"
compinst_default="pathscale"
AC_MSG_RESULT([pathscale])
])
;;
pgcc*)
build_compinst_pgi="yes"
compinst_default="pgi"
@ -161,16 +178,16 @@ AC_DEFUN([ACVT_COMPINST],
AC_MSG_RESULT([xl])
;;
suncc*)
build_compinst_phat="yes"
compinst_default="phat"
AC_MSG_RESULT([phat])
build_compinst_sun="yes"
compinst_default="sun"
AC_MSG_RESULT([sun])
;;
cc*)
AS_IF([test x"$PLATFORM" = "xsun"],
[
build_compinst_phat="yes"
compinst_default="phat"
AC_MSG_RESULT([phat])
build_compinst_sun="yes"
compinst_default="sun"
AC_MSG_RESULT([sun])
])
AS_IF([test x"$PLATFORM" = "xnecsx"],
[
@ -193,7 +210,7 @@ AC_DEFUN([ACVT_COMPINST],
compinst_list=$compinst_default
])
AS_IF([test x"$build_compinst_gnu" = "xyes" -o x"$build_compinst_intel" = "xyes"],
AS_IF([test x"$build_compinst_gnu" = "xyes" -o x"$build_compinst_intel" = "xyes" -o x"$build_compinst_pathscale" = "xyes"],
[
ACVT_BFD
AS_IF([test x"$bfd_error" = "xno"],
@ -312,7 +329,7 @@ AC_DEFUN([ACVT_CONF_EXPAND_VARS],
while :
do
$2=`eval echo $var`
AS_IF([test $$2 == $var], [break], [var=$$2])
AS_IF([test x"$$2" = "x$var"], [break], [var=$$2])
done
])
@ -639,6 +656,7 @@ AC_DEFUN([ACVT_IOWRAP],
AC_CHECK_FUNCS([ \
creat64 \
fopen64 \
fseeko \
fseeko64 \
lseek64 \
fsetpos64 \
@ -1387,7 +1405,7 @@ AC_DEFUN([ACVT_OTF],
otf_conf_args="$otf_conf_args --without-zlib"
])
otf_conf_args="$otf_conf_args --prefix=\"$prefix\" --exec-prefix=\"$exec_prefix\" --bindir=\"$bindir\" --libdir=\"$libdir\" --includedir=\"$includedir\" --datarootdir=\"$datarootdir\" --datadir=\"$datadir\" --docdir=\"$docdir\" $OTFFLAGS --cache-file=\"/dev/null\" --srcdir=\"$otf_srcdir\""
otf_conf_args="$otf_conf_args --prefix=\"$prefix\" --exec-prefix=\"$exec_prefix\" --bindir=\"$bindir\" --libdir=\"$libdir\" --includedir=\"$includedir\" --docdir=\"$docdir/otf\" $OTFFLAGS --cache-file=\"/dev/null\" --srcdir=\"$otf_srcdir\""
AC_MSG_NOTICE([running $SHELL $otf_conf_cmd $otf_conf_args])
eval "$SHELL '$otf_conf_cmd' $otf_conf_args"
@ -1529,7 +1547,7 @@ AC_DEFUN([ACVT_PLATFORM],
AC_MSG_CHECKING([for platform])
AC_ARG_WITH(platform,
AC_HELP_STRING([--with-platform], [configure for given platform (altix,ibm,linux,macos,sun,origin,crayx1,generic), default: automatically by configure]),
AC_HELP_STRING([--with-platform], [configure for given platform (altix,ibm,linux,macos,sun,origin,crayxt,generic), default: automatically by configure]),
[
PLATFORM=$withval
AC_MSG_RESULT([skipped (--with-platform=$withval)])
@ -1542,7 +1560,7 @@ AC_DEFUN([ACVT_PLATFORM],
[AS_IF([test "$host_cpu" = "powerpc64" -a -d /bgl/BlueLight],
[PLATFORM=bgl],
[AS_IF([test "$host_cpu" = "x86_64" -a -d /opt/xt-boot],
[PLATFORM=crayxt3],
[PLATFORM=crayxt],
[PLATFORM=linux])])])
;;
sunos* | solaris*)
@ -1649,10 +1667,23 @@ AC_DEFUN([ACVT_PLATFORM],
AC_DEFINE([TIMER], [TIMER_GETTIMEOFDAY], [Use timer (see below)])
AC_MSG_NOTICE([selected timer: TIMER_GETTIMEOFDAY])
;;
crayxt3)
AC_DEFINE([TIMER_DCLOCK], [1], [dclock])
AC_DEFINE([TIMER], [TIMER_DCLOCK], [Use timer (see below)])
AC_MSG_NOTICE([selected timer: TIMER_DCLOCK])
crayxt)
use_timer=TIMER_CYCLE_COUNTER
AC_TRY_COMPILE([],
[
#ifndef __LIBCATAMOUNT__
# error "__LIBCATAMOUNT__ not defined"
#endif
],
[AC_CHECK_HEADERS([catamount/dclock.h],
[AC_CHECK_HEADERS([catamount/data.h], [use_timer=TIMER_DCLOCK])])])
AC_DEFINE([TIMER_GETTIMEOFDAY], [1], [Use `gettimeofday' function])
AC_DEFINE([TIMER_CLOCK_GETTIME], [2], [Use `clock_gettime' function])
AC_DEFINE([TIMER_DCLOCK], [3], [Use `dclock' function])
AC_DEFINE([TIMER_CYCLE_COUNTER], [4], [Cycle counter (e.g. TSC)])
AC_DEFINE_UNQUOTED([TIMER], [$use_timer], [Use timer (see below)])
AC_MSG_NOTICE([selected timer: $use_timer])
;;
origin)
AC_DEFINE([TIMER_CLOCK_GETTIME], [1], [Use `clock_gettime' function])

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

@ -6,6 +6,12 @@
/* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT
/* Define to 1 if you have the <catamount/data.h> header file. */
#undef HAVE_CATAMOUNT_DATA_H
/* Define to 1 if you have the <catamount/dclock.h> header file. */
#undef HAVE_CATAMOUNT_DCLOCK_H
/* Define to 1 if you have the `creat64' function. */
#undef HAVE_CREAT64
@ -15,6 +21,9 @@
/* Define to 1 if you have the `fopen64' function. */
#undef HAVE_FOPEN64
/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
/* Define to 1 if you have the `fseeko64' function. */
#undef HAVE_FSEEKO64
@ -138,7 +147,7 @@
/* Cycle counter (e.g. TSC) */
#undef TIMER_CYCLE_COUNTER
/* dclock */
/* Use `dclock' function */
#undef TIMER_DCLOCK
/* gethrtime */

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

@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(VampirTrace, 5.4.5, service@vampir.eu)
AM_INIT_AUTOMAKE(VampirTrace, 5.4.5)
AC_INIT(VampirTrace, 5.4.6, service@vampir.eu)
AM_INIT_AUTOMAKE(VampirTrace, 5.4.6)
AC_CONFIG_SRCDIR(config.h.in)
AM_CONFIG_HEADER(config.h)
@ -27,7 +27,7 @@ AC_CANONICAL_HOST
AS_IF([test x"$prefix" = "xNONE"], [prefix="$ac_default_prefix"])
AS_IF([test x"$exec_prefix" = "xNONE"], [exec_prefix="$prefix"])
AS_IF([test x"$datarootdir" = x -o "$datarootdir" = "\${prefix}/share"],
[datarootdir="\${prefix}/share/\${PACKAGE_TARNAME}"])
[datarootdir="\${prefix}/share/vampirtrace"])
AS_IF([test x"$docdir" = x -o "$docdir" = "\${datarootdir}/doc/\${PACKAGE_TARNAME}"],
[docdir="\${datarootdir}/doc"])

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

@ -58,7 +58,7 @@ TD.eqno { } /* equation-number cells */
<P>
<P>
<B><FONT SIZE="+4">VampirTrace 5.4 User Manual</FONT></B>
<B><FONT SIZE="+4">VampirTrace 5.4.6 User Manual</FONT></B>
<BR>
<BR>
<BR>
@ -1950,10 +1950,10 @@ give the path for OTF, default: <TT>/usr/local/</TT>
<P>
</DD>
<DT><STRONG><TT>-with-otf-extra-opts=OTFEXTRAOPTS</TT></STRONG></DT>
<DT><STRONG><TT>-with-otf-flags=FLAGS</TT></STRONG></DT>
<DD>&nbsp;
<BR>
extra options for OTF configuration
pass FLAGS to the OTF distribution configuration
(only for internal OTF version)
<P>

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

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

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

@ -1,4 +1,4 @@
1.0.x
1.0
- initial version
1.1.1
@ -27,14 +27,14 @@
- have UnknownRecord report handle incomplete records or additional bytes at
the end of a file.
1.2.0
1.2
- introduce transparent zlib compression
1.2.1
- added progress functions using read bytes instead of timestamps
1.2.2
- important bugfix: definitionstream 0 was ignored since version 1.2.0
- important bugfix: definitionstream 0 was ignored since version 1.2
1.2.3
- bugfix: provided copy handlers returned wrong value
@ -139,7 +139,7 @@
currently there is no way to "repair" the buffer/stream after an unsorted
time stamp has been issued.
1.3.0
1.3
- integrated libtool for shared and static linkage to otf
- removed the possibility to include zlib symbols into otf
- fixed warning which appeared when not using zlib
@ -208,3 +208,9 @@
- added configure option '--[enable|disable]-binaries' to control
building of binaries (useful for multi-lib installations)
1.3.11
- build/install tool 'otfdump' by default
- install documentation
- bugfix: removed included system headers inside 'extern "C" {}'
- bugfix: added configure check for functions 'fseeko()' and 'ftello()'
(these functions are not available on NEC SX platforms)

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

@ -1,15 +1,14 @@
if AMHAVEPYTHONSWIG
SUBDIRS = \
otflib \
otflib_py \
tools
OTFLIB_PY = otflib_py
else
OTFLIB_PY =
endif
SUBDIRS = \
otflib \
tools
endif
$(OTFLIB_PY) \
tools \
docu
EXTRA_DIST= \
docu/api/specification.pdf \
docu/tools/otftools.pdf \
docu/doxygen.conf \
otf_vc05.sln

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

@ -306,7 +306,7 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
py_version=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print join(get_config_vars('VERSION'))" 2> /dev/null`
if test "$py_version" == "[None]" -o -z "$py_version"; then
if test "$py_version" = "[None]" -o -z "$py_version"; then
if test -n "$PYTHON_VERSION"; then
py_version=$PYTHON_VERSION
else
@ -320,7 +320,7 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
print '-L' + get_python_lib(0,1), \
'-lpython';" 2> /dev/null`$py_version
fi
if test ! "$PYTHON_LDFLAGS" == "$py_version"; then
if test ! "$PYTHON_LDFLAGS" = "$py_version"; then
AC_MSG_RESULT([$PYTHON_LDFLAGS])
else
AC_MSG_RESULT([no])

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

@ -3,9 +3,9 @@
AC_PREREQ(2.57)
AC_INIT(OTF, 1.3.10, andreas.knuepfer@tu-dresden.de )
AC_INIT(OTF, 1.3.11, andreas.knuepfer@tu-dresden.de )
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(OTF, 1.3.10)
AM_INIT_AUTOMAKE(OTF, 1.3.11)
AC_CONFIG_SRCDIR([config.h.in])
AM_CONFIG_HEADER(config.h)
@ -52,7 +52,7 @@ AC_SUBST([have_stdint_h])
AC_SUBST([have_inttypes_h])
# Checks for library functions.
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([fseeko ftello strdup])
# Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST ### do not use this if you want to do C++ programs because it might define 'const'
@ -74,19 +74,19 @@ sizeof_long=$ac_cv_sizeof_long
AC_SUBST([sizeof_long])
AC_CONFIG_FILES([Makefile
tools/Makefile
tools/otfdump/Makefile
tools/otfmerge/Makefile
tools/vtf2otf/Makefile
tools/otf2vtf/Makefile
tools/otfaux/Makefile
otflib/Makefile
otflib/OTF_inttypes_unix.h
otflib_py/Makefile
otflib/OTF_inttypes.h
tools/Makefile
tools/otfaux/Makefile
tools/otfcompress/Makefile
tools/otfconfig/Makefile
tools/otfdump/Makefile
tools/otfmerge/Makefile
tools/otf2vtf/Makefile
tools/vtf2otf/Makefile
docu/Makefile
])
# tools/otfdump/Makefile
## workaround for stupid warning caused by newer autoconf versions
AC_DEFUN([AC_DATAROOTDIR_CHECKED])

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

@ -0,0 +1,14 @@
otfdoc_DATA = \
$(top_srcdir)/ChangeLog \
LICENSE \
api/specification.pdf \
tools/otftools.pdf
otfdocdir = $(docdir)
LICENSE: $(top_srcdir)/COPYING
cp $(top_srcdir)/COPYING LICENSE
EXTRA_DIST = \
$(otfdoc_DATA) \
doxygen.conf

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

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

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

@ -11,6 +11,7 @@ include_HEADERS = otf.h \
OTF_FileManager.h \
OTF_Filenames.h \
OTF_HandlerArray.h \
OTF_inttypes.h \
OTF_MasterControl.h \
OTF_RBuffer.h \
OTF_RStream.h \
@ -19,11 +20,12 @@ include_HEADERS = otf.h \
OTF_WStream.h \
OTF_Writer.h
nodist_include_HEADERS = OTF_inttypes.h
nodist_include_HEADERS = OTF_inttypes_unix.h
noinst_HEADERS = OTF_Keywords.h \
OTF_Parse.h \
OTF_Platform.h
OTF_Platform.h \
OTF_Platform_unix.h
lib_LTLIBRARIES = libotf.la
@ -45,6 +47,8 @@ libotf_la_SOURCES = \
OTF_inttypes.c
EXTRA_DIST = \
OTF_Platform_win.h \
OTF_inttypes_win.h \
libotf_vs05.vcproj

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

@ -3,9 +3,7 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"

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

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

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

@ -12,10 +12,7 @@ included AFTER this macro definitions */
#define _LARGEFILE64_SOURCE
#define _LARGE_FILES
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include "config.h"
#include "OTF_Platform.h"

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "config.h"
#include "OTF_Platform.h"

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"
#include "OTF_HandlerArray.h"

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

@ -632,7 +632,7 @@ int OTF_Handler_Counter( void* userData,
* @param time Time when collective operation was entered by member.
* @param process Process identifier i.e. collective member.
* @param collective Collective identifier as defined with
* OTF_Handler_eDefCollectiveOperation().
* OTF_Handler_DefCollectiveOperation().
* @param procGroup Group of processes participating in this collective.
* @param rootProc Root process if != 0.
* @param sent Data volume sent by member or 0.
@ -943,15 +943,15 @@ int OTF_Handler_FunctionGroupSummary( void* userData,
*
* \ingroup handler
*/
int OTF_Handler_MessageSummary( void* userData,
uint64_t time,
uint32_t process,
int OTF_Handler_MessageSummary( 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,
uint32_t type,
uint64_t sentNumber,
uint64_t receivedNumber,
uint64_t sentBytes,
uint64_t receivedBytes );

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#include "OTF_Platform.h"
#include "OTF_MasterControl.h"

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

@ -28,9 +28,9 @@
*
*
* \code
* #include <otf.h>
* #include <stdio.h>
* #include <assert.h>
* #include "otf.h"
*
* int main( int argc, char** argv ) {
* \endcode

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"
#include "OTF_Parse.h"
@ -296,7 +295,7 @@ int OTF_Reader_parseEventRecord( OTF_RBuffer* buffer,
break;
case OTF_KEYWORD_F_LEAVE /* 'U' */ :
case OTF_KEYWORD_F_LEAVE /* 'L' */ :
if ( OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_S_LEAVE ) ||
OTF_RBuffer_testKeyword( buffer, OTF_KEYWORD_L_LEAVE ) ) {
@ -387,7 +386,6 @@ int OTF_Reader_parseEventRecord( OTF_RBuffer* buffer,
int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers, uint32_t streamid ) {
/* check prefix */
if ( OTF_RBuffer_testPrefix( buffer, OTF_KEYWORD_S_DEF_PREFIX ) ||
OTF_RBuffer_testPrefix( buffer, OTF_KEYWORD_L_DEF_PREFIX ) ) {
@ -553,7 +551,6 @@ int OTF_Reader_parseDefRecord( OTF_RBuffer* buffer,
int OTF_Reader_parseStatisticsRecord( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers ) {
/* check prefix */
if ( OTF_RBuffer_testPrefix( buffer, OTF_KEYWORD_S_SUM_PREFIX ) ||
OTF_RBuffer_testPrefix( buffer, OTF_KEYWORD_L_SUM_PREFIX ) ) {
@ -626,7 +623,7 @@ int OTF_Reader_parseStatisticsRecord( OTF_RBuffer* buffer,
case OTF_KEYWORD_F_SUMCOMMENT /* 'C' */ :
if ( OTF_RBuffer_testKeyword( buffer,
if ( OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_S_SUMCOMMENT ) ||
OTF_RBuffer_testKeyword( buffer,
OTF_KEYWORD_L_SUMCOMMENT ) ) {

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

@ -8,7 +8,49 @@
#include <stdlib.h>
#include <string.h>
char *OTF_strdup(const char *s) {
#if defined(_WIN32) /* windows */
# include <Windows.h>
int gettimeofday(struct timeval* tv, void* dummytimezone) {
union {
long long ns100;
FILETIME ft;
} now;
GetSystemTimeAsFileTime (&now.ft);
tv->tv_usec = (long) ((now.ns100 / 10LL) % 1000000LL);
tv->tv_sec = (long) ((now.ns100 - 116444736000000000LL) / 10000000LL);
return 0;
}
#endif /* _WIN32 */
char* OTF_basename(char* path) {
char *ret;
#if defined(_WIN32)
const char* s = "\\";
#else
const char* s = "/";
#endif
if( path == NULL || strlen( path ) == 0 ) {
ret = OTF_strdup( "." );
} else if( path[strlen(path)-1] == *s ) {
ret = OTF_strdup( s );
} else {
char* tmp;
if( ( tmp = strrchr( path, *s ) ) != NULL )
ret = OTF_strdup( tmp+1 );
else
ret = OTF_strdup( path );
}
return ret;
}
char* OTF_strdup(const char* s) {
char *c;
if( s == NULL || ( c = ( char* )malloc( strlen(s)+1 ) ) == NULL )

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

@ -19,70 +19,38 @@
#ifndef OTF_PLATFORM_H
#define OTF_PLATFORM_H
#if defined(_WIN32) /* windows */
# include "OTF_Platform_win.h"
#else /* unix */
# include "OTF_Platform_unix.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* if you know (for sure) of more compilers supporting __FUNCTION__,
then add them here */
#if defined __GNUC__ /* gnu */
#elif defined _MSC_VER /* ms vs */
#elif defined __xlC__ /* ibm xlc */
#if defined(__GNUC__) /* gnu */
#elif defined(_MSC_VER) /* ms vs */
#elif defined(__xlC__) /* ibm xlc */
#else
/* set __FUNCTION__ to a dummy for compilers not supporting this macro */
#define __FUNCTION__ "<unknown function>"
# define __FUNCTION__ "<unknown function>"
#endif
#ifndef __FILE__
#define __FILE__ "<unknown file>"
# define __FILE__ "<unknown file>"
#endif
#ifndef __LINE__
#define __LINE__ 0
# define __LINE__ 0
#endif
#if defined __linux
#define OTF_fseek fseeko
#define OTF_ftell ftello
#define OTF_snprintf snprintf
#elif defined WIN32 /* windows */
#if defined _MSC_VER /* vs */
#define HAVE_IO_H
#define OTF_ftell (uint64_t) _ftelli64
#define OTF_fseek(f,off,orig) _fseeki64(f,(__int64)off,orig)
#define OTF_snprintf _snprintf
#pragma warning (disable : 4996) /* disable insecurity/deprication warnings */
#else
#error "You are using an unsupported compiler on windows."
#endif
#else /* don't know what to put here */
#define OTF_fseek fseek
#define OTF_ftell ftell
#define OTF_snprintf snprintf
#endif
char *OTF_strdup( const char*s );
char *OTF_basename( char* path );
char *OTF_strdup( const char* s );
#ifdef __cplusplus
}

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

@ -0,0 +1,35 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_Platform_unix.h
*
* @brief Deals with platform dependend issues.
*
* \ingroup internal
*/
#ifndef OTF_PLATFORM_UNIX_H
#define OTF_PLATFORM_UNIX_H
#include "config.h"
#if defined(HAVE_FSEEKO) && HAVE_FSEEKO
# define OTF_fseek fseeko
#else /* HAVE_FSEEKO */
# define OTF_fseek fseek
#endif /* HAVE_FSEEKO */
#if defined(HAVE_FTELLO) && HAVE_FTELLO
# define OTF_ftell ftello
#else /* HAVE_FTELLO */
# define OTF_ftell ftell
#endif /* HAVE_FTELLO */
#define OTF_snprintf snprintf
#endif /* OTF_PLATFORM_UNIX_H */

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

@ -0,0 +1,45 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_Platform_win.h
*
* @brief Deals with platform dependend issues.
*
* \ingroup internal
*/
#ifndef OTF_PLATFORM_WIN_H
#define OTF_PLATFORM_WIN_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#if defined(_MSC_VER) /* visual studio */
# define HAVE_IO_H
# define OTF_ftell (uint64_t) _ftelli64
# define OTF_fseek(f,off,orig) _fseeki64(f,(__int64)off,orig)
# define OTF_snprintf _snprintf
# pragma warning (disable : 4996) /* disable insecurity/deprication warnings */
int gettimeofday(struct timeval* tv, void* dummytimezone);
#else
# error "You are using an unsupported compiler on windows."
#endif /* _MSC_VER */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* OTF_PLATFORM_WIN_H */

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>

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

@ -3,9 +3,7 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"

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

@ -34,9 +34,9 @@ case. */
*
* Common includes
* \code
* #include <otf.h>
* #include <stdio.h>
* #include <assert.h>
* #include "otf.h"
* \endcode
*
*

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
@ -921,7 +920,6 @@ int OTF_Heap_checksorted( OTF_Heap* heap ) {
int OTF_Reader_init( OTF_Reader* reader ) {
reader->namestub= NULL;
reader->n= 0;

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

@ -40,9 +40,9 @@ extern "C" {
* \section reader_example1 A simple Example
*
* \code
* #include <otf.h>
* #include <stdio.h>
* #include <assert.h>
* #include "otf.h"
* \endcode
*
* Define handlers/callbacls for the records you want to read.
@ -121,9 +121,9 @@ extern "C" {
*
* Same as before
* \code
* #include <otf.h>
* #include <stdio.h>
* #include <assert.h>
* #include "otf.h"
* \endcode
*
* Create a structure, which holds information needed in every handler.

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"
#include "OTF_Definitions.h"

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

@ -26,8 +26,8 @@
* \section wstream_example A short Example
*
* \code
* #include <otf.h>
* #include <assert.h>
* #include "otf.h"
*
* int main( int argc, char** argv ) {
* \endcode

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "OTF_Platform.h"
#include "OTF_Definitions.h"

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

@ -22,8 +22,8 @@
* \section writer_example A simple Example
*
* \code
* #include <otf.h>
* #include <assert.h>
* #include "otf.h"
*
* int main( int argc, char** argv ) {
* \endcode
@ -1091,7 +1091,7 @@ int OTF_Writer_writeFunctionGroupSummary( OTF_Writer* writer,
* @param process Process where messages originated.
* @param peer Process where the message is sent to
* @param comm Communicator of message summary
* @param tag Message type/tag.
* @param tag Message type/tag.
* @param number_sent The number of messages sent.
* @param number_recved The number of messages received.
* @param bytes_sent The number of bytes sent via messages of the given

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

@ -0,0 +1,55 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_inttypes.h
*
* @brief Deals with all data type related issues.
*
* \ingroup misc
*/
#ifndef OTF_INTTYPES_H
#define OTF_INTTYPES_H
#if defined(_WIN32) /* windows */
# include "OTF_inttypes_win.h"
#else /* unix */
# include "OTF_inttypes_unix.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** Converts unsigned integers of 8, 16, 32 or 64 bit length into OTF counter values. */
uint64_t OTF_Unsigned2Counter( uint64_t value );
/** Converts OTF counter values to unsigned integers of 8, 16, 32 or 64 bit length. */
uint64_t OTF_Counter2Unsigned( uint64_t value );
/** Converts signed integers of 8, 16, 32 or 64 bit length to OTF counter values. */
uint64_t OTF_Signed2Counter( int64_t value );
/** Converts OTF counter values to signed integers of 8, 16, 32 or 64 bit length. */
int64_t OTF_Counter2Signed( uint64_t value );
/** Converts single precision floating point variables to OTF counter values. */
uint64_t OTF_Float2Counter( float value );
/** Converts OTF counter values to single precision floating point values. */
float OTF_Counter2Float( uint64_t value );
/** Converts double precision floating point values to OTF counter values. */
uint64_t OTF_Double2Counter( double value );
/** Converts OTF counter values to double precision floating point values. */
double OTF_Counter2Double( uint64_t value );
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* OTF_INTTYPES_H */

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

@ -1,107 +0,0 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_inttypes.h
*
* @brief Deals with all data type related issues.
*
* \ingroup misc
*/
#ifndef OTF_INTTYPES_H
#define OTF_INTTYPES_H
#define OTF_HAVE_STDINT_H @have_stdint_h@
#define OTF_HAVE_INTTYPES_H @have_inttypes_h@
#define OTF_SIZEOF_LONG @sizeof_long@
#if (defined WIN32) /* windows */
#if (defined _MSC_VER) /* it's visual studio */
#if( _MSC_VER >= 1310 ) /* vs2003 and newer */
/* needed by otf */
typedef unsigned char uint8_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
/* not needed by otf */
typedef signed char int8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
#endif
#endif
#else /* unix, ... */
# if OTF_HAVE_STDINT_H
# include <stdint.h>
# elif OTF_HAVE_INTTYPES_H
# include <inttypes.h>
# else /* OTF_HAVE_STDINT_H || OTF_HAVE_INTTYPES_H */
typedef signed char int8_t;
typedef signed short int int16_t;
typedef signed int int32_t;
# if OTF_SIZEOF_LONG == 8
typedef signed long int int64_t;
# else /* OTF_SIZEOF_LONG */
typedef signed long long int int64_t;
# endif /* OTF_SIZEOF_LONG */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
# if OTF_SIZEOF_LONG == 8
typedef unsigned long int uint64_t;
# else /* OTF_SIZEOF_LONG */
typedef unsigned long long int uint64_t;
# endif /* OTF_SIZEOF_LONG */
# endif /* OTF_HAVE_INTTYPES_H || OTF_HAVE_STDINT_H */
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** Converts unsigned integers of 8, 16, 32 or 64 bit length into OTF counter values. */
uint64_t OTF_Unsigned2Counter( uint64_t value );
/** Converts OTF counter values to unsigned integers of 8, 16, 32 or 64 bit length. */
uint64_t OTF_Counter2Unsigned( uint64_t value );
/** Converts signed integers of 8, 16, 32 or 64 bit length to OTF counter values. */
uint64_t OTF_Signed2Counter( int64_t value );
/** Converts OTF counter values to signed integers of 8, 16, 32 or 64 bit length. */
int64_t OTF_Counter2Signed( uint64_t value );
/** Converts single precision floating point variables to OTF counter values. */
uint64_t OTF_Float2Counter( float value );
/** Converts OTF counter values to single precision floating point values. */
float OTF_Counter2Float( uint64_t value );
/** Converts double precision floating point values to OTF counter values. */
uint64_t OTF_Double2Counter( double value );
/** Converts OTF counter values to double precision floating point values. */
double OTF_Counter2Double( uint64_t value );
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* OTF_INTTYPES_H */

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

@ -0,0 +1,53 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_inttypes_unix.h
*
* @brief Deals with all data type related issues.
*
* \ingroup misc
*/
#ifndef OTF_INTTYPES_UNIX_H
#define OTF_INTTYPES_UNIX_H
#define OTF_HAVE_STDINT_H @have_stdint_h@
#define OTF_HAVE_INTTYPES_H @have_inttypes_h@
#define OTF_SIZEOF_LONG @sizeof_long@
#ifdef __sgi
# undef OTF_HAVE_STDINT_H
# define OTF_HAVE_STDINT_H 0
#endif
#if OTF_HAVE_STDINT_H
# include <stdint.h>
#elif OTF_HAVE_INTTYPES_H
# include <inttypes.h>
#else /* OTF_HAVE_STDINT_H || OTF_HAVE_INTTYPES_H */
typedef signed char int8_t;
typedef signed short int int16_t;
typedef signed int int32_t;
# if OTF_SIZEOF_LONG == 8
typedef signed long int int64_t;
# else /* OTF_SIZEOF_LONG */
typedef signed long long int int64_t;
# endif /* OTF_SIZEOF_LONG */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
# if OTF_SIZEOF_LONG == 8
typedef unsigned long int uint64_t;
# else /* OTF_SIZEOF_LONG */
typedef unsigned long long int uint64_t;
# endif /* OTF_SIZEOF_LONG */
#endif /* OTF_HAVE_INTTYPES_H || OTF_HAVE_STDINT_H */
#endif /* OTF_INTTYPES_UNIX_H */

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

@ -0,0 +1,30 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
/**
* @file OTF_inttypes_win.h
*
* @brief Deals with all data type related issues.
*
* \ingroup misc
*/
#ifndef OTF_INTTYPES_WIN_H
#define OTF_INTTYPES_WIN_H
/* needed by otf */
typedef unsigned char uint8_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
/* not needed by otf */
typedef signed char int8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
#endif /* OTF_INTTYPES_WIN_H */

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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="libotf"
ProjectGUID="{6B9B49C9-75CD-400D-B736-5EACA04D0A82}"
RootNamespace="libotf"
@ -119,6 +119,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="zlib.lib"
/>
<Tool
Name="VCALinkTool"
@ -177,6 +178,10 @@
RelativePath=".\OTF_inttypes.h"
>
</File>
<File
RelativePath=".\OTF_inttypes_win.h"
>
</File>
<File
RelativePath=".\OTF_Keywords.h"
>
@ -193,6 +198,10 @@
RelativePath=".\OTF_Platform.h"
>
</File>
<File
RelativePath=".\OTF_Platform_win.h"
>
</File>
<File
RelativePath=".\OTF_RBuffer.h"
>
@ -261,6 +270,10 @@
RelativePath=".\OTF_Parse.c"
>
</File>
<File
RelativePath=".\OTF_Platform.c"
>
</File>
<File
RelativePath=".\OTF_RBuffer.c"
>

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

@ -1,12 +1,11 @@
TMP1 = otfmerge otfaux otfconfig otfdump
TMP1 = otfaux otfconfig otfdump otfmerge
if AMHAVEVTF3
TMP2 = vtf2otf otf2vtf
TMP2 = otf2vtf vtf2otf
else
TMP2=
endif
if AMHAVEZLIB
TMP3 = otfcompress
else

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

@ -8,9 +8,9 @@
#include <stdlib.h>
#include <assert.h>
#include <otf.h>
#include "otf.h"
#include <vtf3.h>
#include "vtf3.h"
#include "Treehash.h"

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

@ -6,9 +6,8 @@
#ifndef OTFTOVTF3_HANDLER_H
#define OTFTOVTF3_HANDLER_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "config.h"
#include "OTF_inttypes.h"

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

@ -1,389 +1,389 @@
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <vtf3.h>
#include "Treehash.h"
/* *** macros ****************************************/
#define HASH_SIZE 65536
#ifndef sun
#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; \
}
#else /* sun */
/* stupid stupid gcc2.95 on sun */
uint32_t hash_get_key( uint32_t key ) {
key += ~(key << 15);
key ^= (key >> 10);
key += (key << 3);
key ^= (key >> 6);
key += ~(key << 11);
key ^= (key >> 16);
key &= HASH_SIZE - 1;
return key;
}
#define HASH_GET_KEY(key) key= hash_get_key(key)
#endif /* sun */
/* *** variables ****************************************/
hashtabT* p_hashtab= NULL;
void treehash_init( nodeT **pp_root, hashtabT **pp_hashtab )
{
int i;
uint32_t hashkey;
/* init the tree */
(*pp_root) = (nodeT *) malloc( sizeof( nodeT ) );
(*pp_root)->process = 0;
(*pp_root)->processi = 0;
(*pp_root)->name = 0;
(*pp_root)->childrensize = 0;
(*pp_root)->p_children = 0;
(*pp_root)->stack = NULL;
(*pp_root)->stackc = 0;
(*pp_root)->stacks = 0;
/* init the hashtab */
(*pp_hashtab) = (hashtabT *) malloc ( sizeof( hashtabT ) * HASH_SIZE );
/* zero init the whole hashtable */
for( i = 0; i < HASH_SIZE; i++ )
{
(*pp_hashtab)[i].p_node = 0;
(*pp_hashtab)[i].entryvecsize = 0;
(*pp_hashtab)[i].p_entryvec = 0;
}
/* insert root to the hashtable */
hashkey = 0;
HASH_GET_KEY( hashkey );
(*pp_hashtab)[hashkey].p_node = (*pp_root);
(*pp_hashtab)[hashkey].entryvecsize = 0;
(*pp_hashtab)[hashkey].p_entryvec = 0;
}
int treehash_addnode( hashtabT *p_hashtab, uint32_t process, const char* name, uint32_t parent )
{
nodeT *p_newnode;
nodeT *p_parentnode;
uint32_t hashkey;
/* -- get and fill the new node -- */
p_newnode = (nodeT *) malloc( sizeof( nodeT ) );
p_newnode->process = process;
p_newnode->processi = 0;
if ( name )
p_newnode->name = OTF_strdup( name );
else
p_newnode->name = 0;
p_newnode->childrensize = 0;
p_newnode->p_children = 0;
p_newnode->stack = NULL;
p_newnode->stackc = 0;
p_newnode->stacks = 0;
/* -- search parent node and connect the parent node to the new node -- */
p_parentnode = treehash_searchnode( p_hashtab, parent );
if( p_parentnode->childrensize == 0 )
{
p_parentnode->p_children = (nodeT **) malloc( sizeof( nodeT *) );
}
else
{
p_parentnode->p_children = (nodeT **) realloc( p_parentnode->p_children,
sizeof( nodeT *) * p_parentnode->childrensize + 1 );
}
p_parentnode->p_children[p_parentnode->childrensize] = p_newnode;
p_parentnode->childrensize++;
/* -- insert the new node to the hashtable -- */
hashkey = process;
HASH_GET_KEY( hashkey );
if (p_hashtab[hashkey].p_node == 0)
{ /* if hashkey is not used */
p_hashtab[hashkey].p_node = p_newnode;
}
else
{ /* if hashkey is used */
int i;
if (p_hashtab[hashkey].p_entryvec == 0)
{ /* if entryvec == 0 take malloc, and copy first item into it */
p_hashtab[hashkey].p_entryvec =
( entryvecT * )malloc( sizeof( entryvecT ) * 2);
/* no memory left */
if (p_hashtab[hashkey].p_entryvec == 0)
return -1;
/* insert first node of the hash */
p_hashtab[hashkey].p_entryvec[0].p_node = p_hashtab[hashkey].p_node;
p_hashtab[hashkey].entryvecsize = 1;
}
else
{ /* if entryvec != 0 take realloc */
p_hashtab[hashkey].p_entryvec = ( entryvecT * )
realloc( p_hashtab[hashkey].p_entryvec, sizeof( entryvecT ) *
(p_hashtab[hashkey].entryvecsize + 1) );
if (p_hashtab[hashkey].p_entryvec == 0)
return -1;
}
/* search right position for the new node and make space for newnode*/
for( i = p_hashtab[hashkey].entryvecsize - 1; i >= 0 &&
p_hashtab[hashkey].p_entryvec[i].p_node->process > process; i-- )
{
p_hashtab[hashkey].p_entryvec[i+1]
= p_hashtab[hashkey].p_entryvec[i];
}
/* insert newnode */
p_hashtab[hashkey].p_entryvec[i+1].p_node = p_newnode;
p_hashtab[hashkey].entryvecsize++;
}
return 0;
}
nodeT *treehash_searchnode ( hashtabT *p_hashtab, uint32_t process )
{
uint32_t hashkey = process;
HASH_GET_KEY( hashkey );
if ( 0 == p_hashtab[hashkey].p_node )
return 0;
if ( p_hashtab[hashkey].p_node->process == process )
return p_hashtab[hashkey].p_node;
else if ( !p_hashtab[hashkey].p_entryvec )
return 0;
else
{ /* search the vector of the hashkey */
return treehash_searchvec(p_hashtab[hashkey].p_entryvec,
p_hashtab[hashkey].entryvecsize, process );
}
}
nodeT *treehash_searchvec ( entryvecT* vec, int vecsize, uint32_t process )
{
int l;
int r;
entryvecT *a;
a = vec;
l = 0;
r = vecsize - 1;
while ( r >= l )
{
int32_t m = ( l + r ) / 2;
if ( process == a[m].p_node->process )
{
return a[m].p_node;
}
if ( process < a[m].p_node->process )
r = m - 1;
else
l = m + 1;
}
return 0;
}
int treehash_createindices ( int index, nodeT *p_node )
{
int i;
p_node->processi = index;
index++;
for( i = 0; i < p_node->childrensize; i++ )
index = treehash_createindices ( index,
p_node->p_children[i] );
return index;
}
void treehash_deleteall ( hashtabT *p_hashtab )
{
int i;
int a;
for( i = 0; i < HASH_SIZE; i++ )
{
treehash_deletenode ( p_hashtab[i].p_node );
if ( p_hashtab[i].p_entryvec )
p_hashtab[i].p_entryvec[0].p_node = 0;
if ( p_hashtab[i].p_entryvec )
{
for( a = 0; a < p_hashtab[i].entryvecsize; a++ )
{
treehash_deletenode ( p_hashtab[i].p_entryvec[a].p_node );
}
free( p_hashtab[i].p_entryvec );
p_hashtab[i].p_entryvec = 0;
}
}
}
void treehash_deletenode ( nodeT *p_node )
{
if ( p_node )
{
if ( p_node->name )
{
free( p_node->name );
p_node->name = 0;
}
if ( p_node->p_children )
{
free( p_node-> p_children );
p_node-> p_children = 0;
}
if( p_node->stack != NULL ) {
free(p_node->stack);
p_node->stack = NULL;
p_node->stackc = 0;
p_node->stacks = 0;
}
free ( p_node );
p_node = 0;
}
}
static void FileIOEndQueue_pop( FileIOEndRecord** queue );
FileIOEndRecord* FileIOEndQueue_init() {
return NULL;
}
void FileIOEndQueue_check( FileIOEndRecord** queue, uint64_t time, void* fha ) {
if( NULL == (*queue) ) return;
while( NULL != (*queue) && (*queue)->time < time ) {
VTF3_WriteFileioend( ((fcbT*) fha)->fcb, (*queue)->time,
(*queue)->process, (*queue)->iotype, (*queue)->fileid,
(*queue)->bytes, (*queue)->source );
FileIOEndQueue_pop( queue );
}
}
void FileIOEndQueue_finish( FileIOEndRecord** queue ) {
while( NULL != (*queue) ) {
FileIOEndQueue_pop( queue );
}
}
void FileIOEndQueue_pop( FileIOEndRecord** queue ) {
FileIOEndRecord* tmp;
if( (*queue) != NULL ) {
if( (*queue)->next != NULL ) {
tmp= (*queue)->next;
free( *queue );
} else {
tmp= NULL;
free( *queue );
}
*queue= tmp;
}
}
void FileIOEndQueue_push( FileIOEndRecord** queue, FileIOEndRecord* append ) {
FileIOEndRecord* tmp;
FileIOEndRecord* last;
tmp= (*queue);
last= NULL;
while( NULL != tmp ) {
if( append->time < tmp->time ) break;
last= tmp;
tmp= tmp->next;
}
if( NULL != last ) {
append->next= tmp;
last->next= append;
} else {
append->next= tmp;
*queue= append;
}
}
/*
This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008.
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "vtf3.h"
#include "Treehash.h"
/* *** macros ****************************************/
#define HASH_SIZE 65536
#ifndef sun
#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; \
}
#else /* sun */
/* stupid stupid gcc2.95 on sun */
uint32_t hash_get_key( uint32_t key ) {
key += ~(key << 15);
key ^= (key >> 10);
key += (key << 3);
key ^= (key >> 6);
key += ~(key << 11);
key ^= (key >> 16);
key &= HASH_SIZE - 1;
return key;
}
#define HASH_GET_KEY(key) key= hash_get_key(key)
#endif /* sun */
/* *** variables ****************************************/
hashtabT* p_hashtab= NULL;
void treehash_init( nodeT **pp_root, hashtabT **pp_hashtab )
{
int i;
uint32_t hashkey;
/* init the tree */
(*pp_root) = (nodeT *) malloc( sizeof( nodeT ) );
(*pp_root)->process = 0;
(*pp_root)->processi = 0;
(*pp_root)->name = 0;
(*pp_root)->childrensize = 0;
(*pp_root)->p_children = 0;
(*pp_root)->stack = NULL;
(*pp_root)->stackc = 0;
(*pp_root)->stacks = 0;
/* init the hashtab */
(*pp_hashtab) = (hashtabT *) malloc ( sizeof( hashtabT ) * HASH_SIZE );
/* zero init the whole hashtable */
for( i = 0; i < HASH_SIZE; i++ )
{
(*pp_hashtab)[i].p_node = 0;
(*pp_hashtab)[i].entryvecsize = 0;
(*pp_hashtab)[i].p_entryvec = 0;
}
/* insert root to the hashtable */
hashkey = 0;
HASH_GET_KEY( hashkey );
(*pp_hashtab)[hashkey].p_node = (*pp_root);
(*pp_hashtab)[hashkey].entryvecsize = 0;
(*pp_hashtab)[hashkey].p_entryvec = 0;
}
int treehash_addnode( hashtabT *p_hashtab, uint32_t process, const char* name, uint32_t parent )
{
nodeT *p_newnode;
nodeT *p_parentnode;
uint32_t hashkey;
/* -- get and fill the new node -- */
p_newnode = (nodeT *) malloc( sizeof( nodeT ) );
p_newnode->process = process;
p_newnode->processi = 0;
if ( name )
p_newnode->name = OTF_strdup( name );
else
p_newnode->name = 0;
p_newnode->childrensize = 0;
p_newnode->p_children = 0;
p_newnode->stack = NULL;
p_newnode->stackc = 0;
p_newnode->stacks = 0;
/* -- search parent node and connect the parent node to the new node -- */
p_parentnode = treehash_searchnode( p_hashtab, parent );
if( p_parentnode->childrensize == 0 )
{
p_parentnode->p_children = (nodeT **) malloc( sizeof( nodeT *) );
}
else
{
p_parentnode->p_children = (nodeT **) realloc( p_parentnode->p_children,
sizeof( nodeT *) * p_parentnode->childrensize + 1 );
}
p_parentnode->p_children[p_parentnode->childrensize] = p_newnode;
p_parentnode->childrensize++;
/* -- insert the new node to the hashtable -- */
hashkey = process;
HASH_GET_KEY( hashkey );
if (p_hashtab[hashkey].p_node == 0)
{ /* if hashkey is not used */
p_hashtab[hashkey].p_node = p_newnode;
}
else
{ /* if hashkey is used */
int i;
if (p_hashtab[hashkey].p_entryvec == 0)
{ /* if entryvec == 0 take malloc, and copy first item into it */
p_hashtab[hashkey].p_entryvec =
( entryvecT * )malloc( sizeof( entryvecT ) * 2);
/* no memory left */
if (p_hashtab[hashkey].p_entryvec == 0)
return -1;
/* insert first node of the hash */
p_hashtab[hashkey].p_entryvec[0].p_node = p_hashtab[hashkey].p_node;
p_hashtab[hashkey].entryvecsize = 1;
}
else
{ /* if entryvec != 0 take realloc */
p_hashtab[hashkey].p_entryvec = ( entryvecT * )
realloc( p_hashtab[hashkey].p_entryvec, sizeof( entryvecT ) *
(p_hashtab[hashkey].entryvecsize + 1) );
if (p_hashtab[hashkey].p_entryvec == 0)
return -1;
}
/* search right position for the new node and make space for newnode*/
for( i = p_hashtab[hashkey].entryvecsize - 1; i >= 0 &&
p_hashtab[hashkey].p_entryvec[i].p_node->process > process; i-- )
{
p_hashtab[hashkey].p_entryvec[i+1]
= p_hashtab[hashkey].p_entryvec[i];
}
/* insert newnode */
p_hashtab[hashkey].p_entryvec[i+1].p_node = p_newnode;
p_hashtab[hashkey].entryvecsize++;
}
return 0;
}
nodeT *treehash_searchnode ( hashtabT *p_hashtab, uint32_t process )
{
uint32_t hashkey = process;
HASH_GET_KEY( hashkey );
if ( 0 == p_hashtab[hashkey].p_node )
return 0;
if ( p_hashtab[hashkey].p_node->process == process )
return p_hashtab[hashkey].p_node;
else if ( !p_hashtab[hashkey].p_entryvec )
return 0;
else
{ /* search the vector of the hashkey */
return treehash_searchvec(p_hashtab[hashkey].p_entryvec,
p_hashtab[hashkey].entryvecsize, process );
}
}
nodeT *treehash_searchvec ( entryvecT* vec, int vecsize, uint32_t process )
{
int l;
int r;
entryvecT *a;
a = vec;
l = 0;
r = vecsize - 1;
while ( r >= l )
{
int32_t m = ( l + r ) / 2;
if ( process == a[m].p_node->process )
{
return a[m].p_node;
}
if ( process < a[m].p_node->process )
r = m - 1;
else
l = m + 1;
}
return 0;
}
int treehash_createindices ( int index, nodeT *p_node )
{
int i;
p_node->processi = index;
index++;
for( i = 0; i < p_node->childrensize; i++ )
index = treehash_createindices ( index,
p_node->p_children[i] );
return index;
}
void treehash_deleteall ( hashtabT *p_hashtab )
{
int i;
int a;
for( i = 0; i < HASH_SIZE; i++ )
{
treehash_deletenode ( p_hashtab[i].p_node );
if ( p_hashtab[i].p_entryvec )
p_hashtab[i].p_entryvec[0].p_node = 0;
if ( p_hashtab[i].p_entryvec )
{
for( a = 0; a < p_hashtab[i].entryvecsize; a++ )
{
treehash_deletenode ( p_hashtab[i].p_entryvec[a].p_node );
}
free( p_hashtab[i].p_entryvec );
p_hashtab[i].p_entryvec = 0;
}
}
}
void treehash_deletenode ( nodeT *p_node )
{
if ( p_node )
{
if ( p_node->name )
{
free( p_node->name );
p_node->name = 0;
}
if ( p_node->p_children )
{
free( p_node-> p_children );
p_node-> p_children = 0;
}
if( p_node->stack != NULL ) {
free(p_node->stack);
p_node->stack = NULL;
p_node->stackc = 0;
p_node->stacks = 0;
}
free ( p_node );
p_node = 0;
}
}
static void FileIOEndQueue_pop( FileIOEndRecord** queue );
FileIOEndRecord* FileIOEndQueue_init() {
return NULL;
}
void FileIOEndQueue_check( FileIOEndRecord** queue, uint64_t time, void* fha ) {
if( NULL == (*queue) ) return;
while( NULL != (*queue) && (*queue)->time < time ) {
VTF3_WriteFileioend( ((fcbT*) fha)->fcb, (*queue)->time,
(*queue)->process, (*queue)->iotype, (*queue)->fileid,
(*queue)->bytes, (*queue)->source );
FileIOEndQueue_pop( queue );
}
}
void FileIOEndQueue_finish( FileIOEndRecord** queue ) {
while( NULL != (*queue) ) {
FileIOEndQueue_pop( queue );
}
}
void FileIOEndQueue_pop( FileIOEndRecord** queue ) {
FileIOEndRecord* tmp;
if( (*queue) != NULL ) {
if( (*queue)->next != NULL ) {
tmp= (*queue)->next;
free( *queue );
} else {
tmp= NULL;
free( *queue );
}
*queue= tmp;
}
}
void FileIOEndQueue_push( FileIOEndRecord** queue, FileIOEndRecord* append ) {
FileIOEndRecord* tmp;
FileIOEndRecord* last;
tmp= (*queue);
last= NULL;
while( NULL != tmp ) {
if( append->time < tmp->time ) break;
last= tmp;
tmp= tmp->next;
}
if( NULL != last ) {
append->next= tmp;
last->next= append;
} else {
append->next= tmp;
*queue= append;
}
}

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

@ -6,13 +6,11 @@
#ifndef OTFTOVTF3_TREEHASH_H
#define OTFTOVTF3_TREEHASH_H
#include "config.h"
#include <assert.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "OTF_inttypes.h"
#include "OTF_Platform.h"

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

@ -10,11 +10,11 @@
#include <string.h>
#include <stdio.h>
#include <otf.h>
#include "OTF_Platform.h"
#include "otf.h"
#ifdef HAVE_VTF3
#include <vtf3.h>
#include "vtf3.h"
#endif /* HAVE_VTF3 */
#include "Handler.h"

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

@ -6,18 +6,14 @@
#ifndef CONTROL_H
#define CONTROL_H
#include "config.h"
#include <set>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "OTF_inttypes.h"
#include "otf.h"
#include "State.h"
#include "otf.h"
struct Control {

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

@ -193,7 +193,7 @@ int handleEventComment( void* firsthandlerarg, uint64_t time,
int handleCollectiveOperation( void* firsthandlerarg, uint64_t time,
uint32_t process, uint32_t functionToken, uint32_t communicator,
uint32_t process, uint32_t collective, uint32_t communicator,
uint32_t rootprocess, uint32_t sent, uint32_t received,
uint64_t duration, uint32_t scltoken ) {

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

@ -6,10 +6,7 @@
#ifndef OTFTOVTF3_HANDLER_H
#define OTFTOVTF3_HANDLER_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include "OTF_inttypes.h"

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

@ -66,6 +66,7 @@ void ProcessState::sendMessage( uint64_t time, uint32_t receiver,
sstatistics.bytes_sent+= msglength;
sstatistics.number_sent++;
sstack.push_back( Send( time, receiver, procGroup, tag, source ) );
@ -603,6 +604,7 @@ void ProcessState::writeStatistics( OTF_Writer* writer, uint64_t time,
}
/* write the message summary if any message was sent */
if ( sstatistics.number_sent > 0 || sstatistics.number_recvd > 0) {
OTF_Writer_writeMessageSummary( writer, time /* current time */,

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

@ -6,17 +6,14 @@
#ifndef STATE_H
#define STATE_H
#include "config.h"
#include <vector>
#include <deque>
#include <map>
#include <list>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "OTF_inttypes.h"
#include "otf.h"
@ -24,7 +21,6 @@
/* *** function stuff *** ********************************* */
struct FunctionCall {
@ -194,7 +190,7 @@ public:
void sendMessage( uint64_t time, uint32_t receiver, uint32_t procGroup,
uint32_t tag, uint32_t msglength, uint32_t source );
void recvMessage( uint32_t msglength );
void matchMessage( uint32_t receiver, uint32_t procGroup, uint32_t tag );
@ -223,10 +219,8 @@ public:
void writeOpenFiles( OTF_Writer* writer, uint64_t time, uint32_t processid ) const;
};
/* *** State *** **************************************** */
/** state of a whole trace */
class State {
@ -238,7 +232,7 @@ class State {
/* maps the files to its filegroupid */
std::map< uint32_t, uint32_t> filegroups;
bool usefunctiongroups;
bool usefilegroups;
bool doSnapshots;
@ -265,7 +259,7 @@ public:
void sendMessage( uint64_t time, uint32_t sender, uint32_t receiver,
uint32_t procGroup, uint32_t tag, uint32_t length, uint32_t source );
void recvMessage( uint32_t sender, uint32_t receiver, uint32_t procGroup,
uint32_t tag, uint32_t msglength );
@ -284,6 +278,5 @@ public:
void writeStatistics( OTF_Writer* writer, uint64_t time );
};
#endif /* STATE_H */

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

@ -3,10 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include "config.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <set>
#include <iostream>
@ -71,7 +69,6 @@ void checkExistingFile( const char* tmpfilename, bool forceoverwrite, bool delet
int main ( int argc, const char** argv ) {
char* filename = NULL;
int buffersize= 1024;
@ -459,11 +456,11 @@ int main ( int argc, const char** argv ) {
OTF_HandlerArray_setFirstHandlerArg( handlers, (void*) control,
OTF_ENDPROCESS_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) handleCollectiveOperation,
OTF_COLLOP_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, (void*) control,
OTF_COLLOP_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) handleCollectiveOperation,
OTF_COLLOP_RECORD );
OTF_HandlerArray_setFirstHandlerArg( handlers, (void*) control,
OTF_COLLOP_RECORD );
OTF_HandlerArray_setHandler( handlers,
(OTF_FunctionPointer*) handleEventComment,

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "config.h"
#define _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE

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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="otfcompress"
ProjectGUID="{B6BBC220-1492-4BEA-A299-9D062133ABAA}"
RootNamespace="otfcompress"
@ -138,7 +138,6 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="zlib.lib"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"

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

@ -5,11 +5,6 @@ bin_PROGRAMS = \
otfconfig
endif
otfconfig_LDADD = $(top_builddir)/otflib/libotf.la
if ! AMDEPZLIB
otfconfig_LDADD += $(ZLIB_LIB_LINE)
endif
otfconfig_SOURCES = \
otfconfig.c

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

@ -3,9 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "config.h"
#include "OTF_inttypes.h"

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

@ -7,7 +7,6 @@
#include "Handler.h"
int handleDefinitionComment( void* userData, uint32_t stream,
const char* comment ) {

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

@ -6,16 +6,13 @@
#ifndef OTFTOVTF3_HANDLER_H
#define OTFTOVTF3_HANDLER_H
#include "config.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "OTF_inttypes.h"
#include "otf.h"
typedef struct {
@ -30,8 +27,6 @@ typedef struct {
} Control;
/* *** Definition handler *** ************************************* */

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

@ -1,7 +1,7 @@
INCLUDES = -I$(top_builddir)/otflib -I$(top_srcdir)/otflib
if AMBUILDBINARIES
noinst_PROGRAMS = \
bin_PROGRAMS = \
otfdump
endif

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

@ -11,8 +11,8 @@
#include <stdio.h>
#include <vector>
using namespace std;
using namespace std;
#if SIZEOF_LONG == 4
# define ATOL8 atoll

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

@ -6,10 +6,8 @@
#ifndef HANDLER_H
#define HANDLER_H
#include "config.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "OTF_inttypes.h"
#include "OTF_Writer.h"

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

@ -3,10 +3,8 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include "config.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h>
#include <stdlib.h>

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

@ -138,7 +138,6 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="zlib.lib"
LinkIncremental="1"
AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="false"

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

@ -3,20 +3,18 @@
Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
*/
#include "config.h"
#include <stdio.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "OTF_inttypes.h"
#include "OTF_Platform.h"
#include <otf.h>
#include "otf.h"
#ifdef HAVE_VTF3
#include <vtf3.h>
#include "vtf3.h"
#endif /* HAVE_VTF3 */
#include "Handler.h"

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

@ -6,15 +6,12 @@
#ifndef HASH_H
#define HASH_H
#define HASHSIZE 1024
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "config.h"
#include "OTF_inttypes.h"
#define HASHSIZE 1024
struct struct_SubEntry {

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

@ -5,6 +5,7 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

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

@ -5,6 +5,7 @@
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@ -12,10 +13,10 @@
#include <unistd.h>
#include "OTF_Platform.h"
#include <otf.h>
#include "otf.h"
#ifdef HAVE_VTF3
#include <vtf3.h>
#include "vtf3.h"
#endif /* HAVE_VTF3 */
#include "Handler.h"
@ -40,7 +41,7 @@ static const char* Helptext[] = {
" -n <n> output stream count \n",
" -b <n> size of the writer buffer \n",
" -z <n> use zlib compression \n",
" -io compute io events. This is neccessary for getting \n",
" -io compute io events. This is necessary for getting \n",
" correct durations in IO-operations. Result of this \n",
" step is a file with extra information. This file \n",
" is used for creating correct duration-information in \n",

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

@ -92,9 +92,9 @@ ReadDataFile()
"compiler", "compiler_flags", "linker_flags", "libs", "includedir",
"libdir", "opari_bin", "opari_tab_compiler", "opari_tab_compiler_flags",
"pmpilib", "fmpilib", "dynattlib", "compiler_iflags_gnu",
"compiler_iflags_intel", "compiler_iflags_pgi", "compiler_iflags_phat",
"compiler_iflags_xl", "compiler_iflags_ftrace", "inst_avail",
"inst_default"
"compiler_iflags_intel", "compiler_iflags_pathscale", "compiler_iflags_pgi",
"compiler_iflags_sun", "compiler_iflags_xl", "compiler_iflags_ftrace",
"inst_avail", "inst_default"
};
std::string data_file = DATADIR"/" + ExeName + "-wrapper-data.txt";
@ -223,13 +223,17 @@ ReadDataFile()
{
Properties.iflags_intel = value;
}
else if( key.compare( "compiler_iflags_pathscale" ) == 0 )
{
Properties.iflags_pathscale = value;
}
else if( key.compare( "compiler_iflags_pgi" ) == 0 )
{
Properties.iflags_pgi = value;
}
else if( key.compare( "compiler_iflags_phat" ) == 0 )
else if( key.compare( "compiler_iflags_sun" ) == 0 )
{
Properties.iflags_phat = value;
Properties.iflags_sun = value;
}
else if( key.compare( "compiler_iflags_xl" ) == 0 )
{
@ -260,10 +264,12 @@ ReadDataFile()
Properties.inst_avail |= INST_TYPE_GNU;
else if( strcmp( token, "intel" ) == 0 )
Properties.inst_avail |= INST_TYPE_INTEL;
else if( strcmp( token, "pathscale" ) == 0 )
Properties.inst_avail |= INST_TYPE_PATHSCALE;
else if( strcmp( token, "pgi" ) == 0 )
Properties.inst_avail |= INST_TYPE_PGI;
else if( strcmp( token, "phat" ) == 0 )
Properties.inst_avail |= INST_TYPE_PHAT;
else if( strcmp( token, "sun" ) == 0 )
Properties.inst_avail |= INST_TYPE_SUN;
else if( strcmp( token, "xl" ) == 0 )
Properties.inst_avail |= INST_TYPE_XL;
else if( strcmp( token, "ftrace" ) == 0 )
@ -292,10 +298,12 @@ ReadDataFile()
error = !theWrapper->setInstType( INST_TYPE_GNU );
else if( strcmp( value.c_str(), "intel" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_INTEL );
else if( strcmp( value.c_str(), "pathscale" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_PATHSCALE );
else if( strcmp( value.c_str(), "pgi" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_PGI );
else if( strcmp( value.c_str(), "phat" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_PHAT );
else if( strcmp( value.c_str(), "sun" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_SUN );
else if( strcmp( value.c_str(), "xl" ) == 0 )
error = !theWrapper->setInstType( INST_TYPE_XL );
else if( strcmp( value.c_str(), "ftrace" ) == 0 )
@ -387,10 +395,12 @@ ReadEnvironmentVars()
error = !theWrapper->setInstType( INST_TYPE_GNU );
else if( senv.compare("intel") == 0 )
error = !theWrapper->setInstType( INST_TYPE_INTEL );
else if( senv.compare("pathscale") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PATHSCALE );
else if( senv.compare("pgi") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PGI );
else if( senv.compare("phat") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PHAT );
else if( senv.compare("sun") == 0 )
error = !theWrapper->setInstType( INST_TYPE_SUN );
else if( senv.compare("xl") == 0 )
error = !theWrapper->setInstType( INST_TYPE_XL );
else if( senv.compare("ftrace") == 0 )
@ -497,10 +507,12 @@ ParseCommandLine( int argc, char ** argv )
error = !theWrapper->setInstType( INST_TYPE_GNU );
else if( arg.compare("intel") == 0 )
error = !theWrapper->setInstType( INST_TYPE_INTEL );
else if( arg.compare("pathscale") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PATHSCALE );
else if( arg.compare("pgi") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PGI );
else if( arg.compare("phat") == 0 )
error = !theWrapper->setInstType( INST_TYPE_PHAT );
else if( arg.compare("sun") == 0 )
error = !theWrapper->setInstType( INST_TYPE_SUN );
else if( arg.compare("xl") == 0 )
error = !theWrapper->setInstType( INST_TYPE_XL );
else if( arg.compare("ftrace") == 0 )
@ -839,9 +851,11 @@ Wrapper::showUsageText()
<< std::endl
<< " intel ... Intel (version >= 10.x) ..."
<< std::endl
<< " pathscale ... Pathscale (version >= 3.1) ..."
<< std::endl
<< " pgi ... Portland Group (PGI) ..."
<< std::endl
<< " phat ... SUN Fortran 90 ..."
<< " sun ... SUN Fortran 90 ..."
<< std::endl
<< " xl ... IBM ..."
<< std::endl
@ -859,10 +873,12 @@ Wrapper::showUsageText()
std::cout << "gnu";
else if( std::string(DEFAULT_COMPINST).compare( "intel" ) == 0 )
std::cout << "intel";
else if( std::string(DEFAULT_COMPINST).compare( "pathscale" ) == 0 )
std::cout << "pathscale";
else if( std::string(DEFAULT_COMPINST).compare( "pgi" ) == 0 )
std::cout << "pgi";
else if( std::string(DEFAULT_COMPINST).compare( "phat" ) == 0 )
std::cout << "phat";
else if( std::string(DEFAULT_COMPINST).compare( "sun" ) == 0 )
std::cout << "sun";
else if( std::string(DEFAULT_COMPINST).compare( "xl" ) == 0 )
std::cout << "xl";
else if( std::string(DEFAULT_COMPINST).compare( "ftrace" ) == 0 )
@ -1018,11 +1034,14 @@ Wrapper::showInfo()
case INST_TYPE_INTEL:
std::cout << "intel" << std::endl;
break;
case INST_TYPE_PATHSCALE:
std::cout << "pathscale" << std::endl;
break;
case INST_TYPE_PGI:
std::cout << "pgi" << std::endl;
break;
case INST_TYPE_PHAT:
std::cout << "phat" << std::endl;
case INST_TYPE_SUN:
std::cout << "sun" << std::endl;
break;
case INST_TYPE_XL:
std::cout << "xl" << std::endl;
@ -1051,10 +1070,12 @@ Wrapper::showInfo()
std::cout << " gnu";
if( isInstAvail( INST_TYPE_INTEL ) )
std::cout << " intel";
if( isInstAvail( INST_TYPE_PATHSCALE ) )
std::cout << " pathscale";
if( isInstAvail( INST_TYPE_PGI ) )
std::cout << " pgi";
if( isInstAvail( INST_TYPE_PHAT ) )
std::cout << " phat";
if( isInstAvail( INST_TYPE_SUN ) )
std::cout << " sun";
if( isInstAvail( INST_TYPE_XL ) )
std::cout << " xl";
if( isInstAvail( INST_TYPE_FTRACE ) )
@ -1353,8 +1374,8 @@ Wrapper::run()
target.c_str() ) == -1 )
{
std::cerr << ExeName << ": error: could not rename "
<< Properties.vec_opari_mfiles_obj[i].c_str()
<< " to " << target.c_str() << std::endl
<< Properties.vec_opari_mfiles_obj[i]
<< " to " << target << std::endl
<< strerror(errno) << std::endl;
}
}
@ -1392,11 +1413,14 @@ Wrapper::setInstType( const InstTypeT type )
case INST_TYPE_INTEL:
Properties.comp_iflags = Properties.iflags_intel;
break;
case INST_TYPE_PATHSCALE:
Properties.comp_iflags = Properties.iflags_pathscale;
break;
case INST_TYPE_PGI:
Properties.comp_iflags = Properties.iflags_pgi;
break;
case INST_TYPE_PHAT:
Properties.comp_iflags = Properties.iflags_phat;
case INST_TYPE_SUN:
Properties.comp_iflags = Properties.iflags_sun;
break;
case INST_TYPE_XL:
Properties.comp_iflags = Properties.iflags_xl;

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

@ -20,15 +20,16 @@
typedef enum
{
INST_TYPE_GNU = 0x1, // auto. instrumentation by GNU comp.
INST_TYPE_INTEL = 0x2, // ^ Intel version >=10
INST_TYPE_PGI = 0x4, // ^ PGI
INST_TYPE_PHAT = 0x8, // ^ SUN
INST_TYPE_XL = 0x10, // ^ IBM (xlc, xlC,...)
INST_TYPE_FTRACE = 0x20, // ^ NEC SX
INST_TYPE_MANUAL = 0x40, // manual instr. by VT API
INST_TYPE_POMP = 0x80, // semi auto. instr. by POMP directives
INST_TYPE_DYNINST = 0x100 // binary instrumentation by Dyninst
INST_TYPE_GNU = 0x1, // auto. instrumentation by GNU comp.
INST_TYPE_INTEL = 0x2, // ^ Intel version >=10
INST_TYPE_PATHSCALE = 0x4, // ^ Pathscale version >=3.1
INST_TYPE_PGI = 0x8, // ^ PGI
INST_TYPE_SUN = 0x10, // ^ SUN
INST_TYPE_XL = 0x20, // ^ IBM (xlc, xlC,...)
INST_TYPE_FTRACE = 0x40, // ^ NEC SX
INST_TYPE_MANUAL = 0x80, // manual instr. by VT API
INST_TYPE_POMP = 0x100, // semi auto. instr. by POMP directives
INST_TYPE_DYNINST = 0x200 // binary instrumentation by Dyninst
} InstTypeT;
struct ProperiesS
@ -40,8 +41,8 @@ struct ProperiesS
opari_cmd(""), opari_args(""), opari_tab_comp_cmd(""),
opari_tab_comp_flags(""),
pmpilib(""), fmpilib(""), dynattlib(""),
iflags_gnu(""), iflags_intel(""), iflags_pgi(""),
iflags_phat(""), iflags_xl(""), iflags_ftrace(""),
iflags_gnu(""), iflags_intel(""), iflags_pathscale(""), iflags_pgi(""),
iflags_sun(""), iflags_xl(""), iflags_ftrace(""),
inst_type(INST_TYPE_MANUAL), inst_avail(0),
beverbose(false), componly(false), uses_mpi(false), uses_omp(false),
showme(false), showme_compile(false), showme_link(false) {}
@ -80,8 +81,9 @@ struct ProperiesS
std::string iflags_gnu;
std::string iflags_intel;
std::string iflags_pathscale;
std::string iflags_pgi;
std::string iflags_phat;
std::string iflags_sun;
std::string iflags_xl;
std::string iflags_ftrace;

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

@ -16,8 +16,9 @@ fmpilib=
dynattlib=@VTDYNATTLIB@
compiler_iflags_gnu=-g -finstrument-functions
compiler_iflags_intel=-g -finstrument-functions
compiler_iflags_pathscale=-g -finstrument-functions
compiler_iflags_pgi=-Mprof=func
compiler_iflags_phat=
compiler_iflags_sun=
compiler_iflags_xl=-qdebug=function_trace
compiler_iflags_ftrace=-ftrace
inst_avail=@VT_WRAPPER_AVAIL_INST@

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

@ -16,8 +16,9 @@ fmpilib=
dynattlib=@VTDYNATTLIB@
compiler_iflags_gnu=-g -finstrument-functions
compiler_iflags_intel=-g -finstrument-functions
compiler_iflags_pathscale=-g -finstrument-functions
compiler_iflags_pgi=-Mprof=func
compiler_iflags_phat=
compiler_iflags_sun=
compiler_iflags_xl=-qdebug=function_trace
compiler_iflags_ftrace=-ftrace
inst_avail=@VT_WRAPPER_AVAIL_INST@

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

@ -16,8 +16,9 @@ fmpilib=@FMPILIB@
dynattlib=@VTDYNATTLIB@
compiler_iflags_gnu=-g -finstrument-functions
compiler_iflags_intel=-g -finstrument-functions
compiler_iflags_pathscale=-g -finstrument-functions
compiler_iflags_pgi=-Mprof=func
compiler_iflags_phat=-O -Qoption f90comp -phat
compiler_iflags_sun=-O -Qoption f90comp -phat
compiler_iflags_xl=-qdebug=function_trace
compiler_iflags_ftrace=-ftrace
inst_avail=@VT_WRAPPER_AVAIL_INST@

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

@ -16,8 +16,9 @@ fmpilib=@FMPILIB@
dynattlib=@VTDYNATTLIB@
compiler_iflags_gnu=-g -finstrument-functions
compiler_iflags_intel=-g -finstrument-functions
compiler_iflags_pathscale=-g -finstrument-functions
compiler_iflags_pgi=-Mprof=func
compiler_iflags_phat=-O -Qoption f90comp -phat
compiler_iflags_sun=-O -Qoption f90comp -phat
compiler_iflags_xl=-qdebug=function_trace
compiler_iflags_ftrace=-ftrace
inst_avail=@VT_WRAPPER_AVAIL_INST@

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

@ -1,7 +1,7 @@
Copyright (c) 1998-2005, Forschungszentrum Juelich GmbH, Federal
Copyright (c) 1998-2008, Forschungszentrum Juelich GmbH, Federal
Republic of Germany
Copyright (c) 2003-2005, University of Tennessee, Knoxville, United
Copyright (c) 2003-2008, University of Tennessee, Knoxville, United
States of America
All rights reserved.

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

@ -1,3 +1,22 @@
15. Improved C/C++ parsing
added support for bonded line-continuation in OpenMP directives.
For example
#pragma omp parallel\
private(i)
is now correctly instrumented. Prior a space or tabulator between
the last word and the line-continuation '\' was necessary.
14. Improved Fortran parsing
instrument parallel fortran end do loops without OpenMP end do loop pragma.
Works for correctly nested do loops with
a) f90 END DO's
b) f77 labeled continue statements
The special case for b) where multiple loops use the same continue
statement as end do has restrictions: OPARI can only handle these cases
which do NOT require adding extra continue statements.
13. !!!INCOMPATIBLE CHANGE!!!
POMP interface routines renamed from pomp_type_event to
POMP_Type_event. Necessary to allow porting to machines

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

@ -1,3 +1,22 @@
15. Improved C/C++ parsing
added support for bonded line-continuation in OpenMP directives.
For example
#pragma omp parallel\
private(i)
is now correctly instrumented. Prior a space or tabulator between
the last word and the line-continuation '\' was necessary.
14. Improved Fortran parsing
instrument parallel fortran end do loops without OpenMP end do loop pragma.
Works for correctly nested do loops with
a) f90 END DO's
b) f77 labeled continue statements
The special case for b) where multiple loops use the same continue
statement as end do has restrictions: OPARI can only handle these cases
which do NOT require adding extra continue statements.
13. !!!INCOMPATIBLE CHANGE!!!
POMP interface routines renamed from pomp_type_event to
POMP_Type_event. Necessary to allow porting to machines

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

@ -1,7 +1,7 @@
Copyright (c) 1998-2005, Forschungszentrum Juelich GmbH, Federal
Copyright (c) 1998-2008, Forschungszentrum Juelich GmbH, Federal
Republic of Germany
Copyright (c) 2003-2005, University of Tennessee, Knoxville, United
Copyright (c) 2003-2008, University of Tennessee, Knoxville, United
States of America
All rights reserved.

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

@ -1,12 +1,17 @@
oparidoc_DATA = \
ChangeLog \
lacsi01.pdf \
lacsi01.ps.gz \
LICENSE \
opari-logo-100.gif \
Readme.html
Readme.html \
ChangeLog \
LICENSE
oparidocdir = $(docdir)/opari
ChangeLog: $(top_srcdir)/tools/opari/ChangeLog
cp $(top_srcdir)/tools/opari/ChangeLog ChangeLog
LICENSE: $(top_srcdir)/COPYING
cp $(top_srcdir)/tools/opari/COPYING LICENSE
EXTRA_DIST = $(oparidoc_DATA)

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

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

Двоичные данные
ompi/contrib/vt/vt/tools/opari/doc/lacsi01.ps.gz

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

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

@ -100,6 +100,7 @@ DEF_FPOMP_FUNC(void POMP_Parallel_end_f(int* id)) {
POMP_Parallel_end_f, (int* id), (id))
DEF_FPOMP_FUNC(void POMP_Parallel_fork_f(int* id)) {
if ( !pomp_initialized ) POMP_Init();
if ( pomp_tracing ) POMP_Parallel_fork(pomp_rd_table[*id]);
} VT_GENERATE_F77_BINDINGS(pomp_parallel_fork, POMP_PARALLEL_FORK,
POMP_Parallel_fork_f, (int* id), (id))

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

@ -14,6 +14,7 @@
* Global variables
*/
int pomp_initialized = 0;
int pomp_tracing = 0;
/*
@ -167,6 +168,7 @@ void POMP_Parallel_end(struct ompregdescr* r) {
}
void POMP_Parallel_fork(struct ompregdescr* r) {
if ( !pomp_initialized ) POMP_Init();
if ( pomp_tracing ) {
fprintf(stderr, "%3d: fork parallel\n", omp_get_thread_num());
}

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

@ -79,6 +79,7 @@ extern void POMP_Unset_nest_lock(omp_nest_lock_t *s);
extern int POMP_Test_nest_lock(omp_nest_lock_t *s);
#endif
extern int pomp_initialized;
extern int pomp_tracing;
#ifdef __cplusplus

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/
@ -49,10 +49,18 @@ namespace {
unsigned s = preStmt.size();
bool inComment = false;
// "remove" comments
for (unsigned i=0; i<s; ++i) {
string::size_type pos = 0;
string& line = preStmt[i];
// shift bonded line-continuation '\' one position to right
if ( line[line.size()-1] == '\\'
&& line.size() >= 2 && line[line.size()-2] != ' '
&& line[line.size()-2] != '\t' ) {
line.insert(line.size()-1, " ");
}
// "remove" comments
while ( pos < line.size() ) {
if ( inComment ) {
// look for comment end

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/
@ -12,6 +12,8 @@
using std::cerr;
#include <vector>
using std::vector;
#include <stack>
using std::stack;
#include <cctype>
using std::tolower;
using std::toupper;
@ -33,6 +35,22 @@
#include "opari.h"
#include "handler.h"
enum Loop_type { TYPE_NO_OMP = 0x00,
TYPE_OMP_LOOP = 0x01,
TYPE_OMP_PARLOOP = 0x02};
typedef struct {
Loop_type is_omp;
string label;
} LoopDescriptionT;
enum Line_type { NORMAL_LINE = 0x00,
PRAGMA_PARSTART = 0x01, PRAGMA_PAREND = 0x02,
PRAGMA_LOOPSTART = 0x03, PRAGMA_LOOPEND = 0x04,
PRAGMA_PARLOOPSTART = 0x05, PRAGMA_PARLOOPEND = 0x06,
UNKNOWN_LINE = 0x07, PRAGMA_UNKNOWN = 0x08};
namespace {
void look_for(const string& lowline, const char* word,
vector<string::size_type>& positions) {
@ -89,6 +107,150 @@ namespace {
return false;
}
bool is_loop_start(string& lowline, string& line, string& label ) {
string::size_type pstart = string::npos;
string::size_type pos = string::npos;
string::size_type poslab = string::npos;
label="";
if (! (line.size()) ) return false;
// is there a 'do '
pstart = lowline.find("do ");
if(pstart==string::npos) return false;
pos = lowline.find_first_not_of(" \t");
if(pos!=pstart) {
// there is a DO_construct_name
poslab = lowline.find_first_of(":",pos);
if(poslab==string::npos) return false;
label=line.substr(pos,poslab-pos);
// skip white space
pos = lowline.find_first_not_of(" \t",poslab+1);
}
//check again, if pos now start of do, otherwise not a correct do statement
pstart = lowline.find("do ",pos);
if(pstart!=pos) return false;
pos = lowline.find_first_not_of(" \t",pos+2);
if(isdigit(lowline[pos])) {
// there is a stmtlabel
poslab=pos;
pos = lowline.find_first_not_of("0123456789",pos);
label=line.substr(poslab,pos-poslab);
}
return true;
}
bool is_loop_end(string& lowline, string& line, string toplabel) {
string::size_type pos,poslab;
string label;
if (! (line.size()) ) return false;
pos = lowline.find_first_not_of(" \t");
// is it a nonblock DO loop?
poslab=toplabel.find_first_not_of("0123456789");
if((toplabel.size()>0) && (poslab==string::npos)) {
// search for nonblock Do loop
poslab = pos;
pos = lowline.find_first_not_of("0123456789",pos);
// is there a label in this line?
if(poslab==pos) return false;
label=line.substr(poslab,pos-poslab);
// is it the label of the top loop
if (toplabel==label) return true;
else return false;
} else {
// search for block Do loop
pos = lowline.find("end",pos);
if(pos==string::npos) return false;
pos = lowline.find("do",pos+3);
if(pos==string::npos) return false;
// search for label
if(toplabel.size()) {
// skip white space
poslab = lowline.find_first_not_of(" \t",pos+2);
pos = lowline.find_first_of(" \t",poslab);
if(poslab==pos) return false;
label=line.substr(poslab,pos-poslab);
// is it the label of the top loop
if (toplabel==label) return true;
else return false;
} else {
return true; // end do without label
}
}
}
// check type of OMP statement
Line_type check_pragma(OMPragma* pragma) {
int save_pline,save_ppos;
Line_type linetype=PRAGMA_UNKNOWN;
save_pline=pragma->pline;
save_ppos=pragma->ppos;
pragma->find_name();
pragma->pline=save_pline; // reset parse position
pragma->ppos=save_ppos;
if(pragma->name.find("do")!=string::npos) {
linetype=PRAGMA_LOOPSTART;
if(pragma->name == "enddo") linetype=PRAGMA_LOOPEND;
else if(pragma->name == "paralleldo") linetype=PRAGMA_PARLOOPSTART;
else if(pragma->name == "endparalleldo") linetype=PRAGMA_PARLOOPEND;
} else {
if(pragma->name == "parallel") linetype=PRAGMA_PARSTART;
else if(pragma->name == "endparallel") linetype=PRAGMA_PAREND;
}
return(linetype);
}
void test_and_insert_ompenddo(ostream& os, Line_type typeOfLastLine, Loop_type& waitforOMPEndDo,
const string& infile, int& lineno, int ppos, int pomp, bool a) {
OMPragma* newPragma;
int c;
string pragma;
// OMP end do found?
if(waitforOMPEndDo==TYPE_OMP_LOOP) {
waitforOMPEndDo=TYPE_NO_OMP;
if(typeOfLastLine!=PRAGMA_LOOPEND) {
// generate end do
pragma="";
for(c=0;c<ppos;c++) pragma+=" ";
pragma+="!$omp end do ";
newPragma = new OMPragmaF(infile, lineno, ppos+6, pragma, pomp, a);
process_pragma(newPragma, os);
// lineno++;
}
} else if(waitforOMPEndDo==TYPE_OMP_PARLOOP) {
waitforOMPEndDo=TYPE_NO_OMP;
if(typeOfLastLine!=PRAGMA_PARLOOPEND) {
// generate end parallel do or complete pragma
pragma="";
for(c=0;c<ppos;c++) pragma+=" ";
pragma+="!$omp end parallel do ";
newPragma = new OMPragmaF(infile, lineno, ppos+6, pragma, pomp, a);
process_pragma(newPragma, os);
}
}
}
void del_strings_and_comments(string& lowline, char& inString) {
// zero out string constants and free form comments
for (unsigned i=0; i<lowline.size(); ++i) {
@ -161,6 +323,16 @@ void process_fortran(istream& is, const char* infile, ostream& os,
string::size_type pstart = string::npos;
string::size_type lstart = string::npos;
// for endloop instrumentation
stack<LoopDescriptionT> loopstack;
LoopDescriptionT toploop;
bool fix_form = false;
int pragma_indent=0;
Line_type typeOfLastLine=UNKNOWN_LINE;
Loop_type waitforOMPEndDo = TYPE_NO_OMP;
string label = "";
toploop.is_omp=TYPE_NO_OMP; toploop.label ="<none>";
while ( getline(is, line) ) {
/* workaround for bogus getline implementations */
if ( line.size() == 1 && line[0] == '\0' ) break;
@ -180,7 +352,7 @@ void process_fortran(istream& is, const char* infile, ostream& os,
# endif
} else if ( line.size() &&
(lowline[0] == '!' || lowline[0] == 'c' || lowline[0] == '*') && (
(lowline[0] == '!' || lowline[0] == 'c' || lowline[0] == '*') && (
(lowline[1] == '$' &&
(
(lowline[2] == 'p' && lowline[3] == 'o' &&
@ -190,7 +362,10 @@ void process_fortran(istream& is, const char* infile, ostream& os,
lowline[3] == 'm' && lowline[4] == 'p')) )
||
(lowline[1] == 'p' && lowline[2] == 'o' &&
lowline[3] == 'm' && lowline[4] == 'p' && lowline[5] == '$')
lowline[3] == 'm' && lowline[4] == 'p' && lowline[5] == '$') ) && (
! (lowline[0] == '!' && lowline[lowline.find_last_not_of(" \t")] == '&')) && (
! (lowline[0] == '!' && needPragma)
)) {
int pomp = ((lowline[1] == 'p') || (lowline[2] == 'p'));
@ -200,9 +375,15 @@ void process_fortran(istream& is, const char* infile, ostream& os,
*/
if ( lowline[5+pomp]==' ' || lowline[5+pomp]=='\t'
|| lowline[5+pomp]=='0' ) {
fix_form = true;
pragma_indent = 0;
// new directive
if ( currPragma ) {
// if necessary process last complete directive
typeOfLastLine = check_pragma(currPragma);
test_and_insert_ompenddo(os, typeOfLastLine, waitforOMPEndDo,
infile, currPragma->lineno, pragma_indent,
pomp, addSharedDecl);
process_pragma(currPragma, os);
currPragma = 0;
}
@ -228,6 +409,8 @@ void process_fortran(istream& is, const char* infile, ostream& os,
) {
int pomp = ((lowline[pstart+1] == 'p') || (lowline[pstart+2] == 'p'));
fix_form = false;
pragma_indent = pstart;
/*
* free form omp directive
@ -250,10 +433,14 @@ void process_fortran(istream& is, const char* infile, ostream& os,
} else {
// complete
needPragma = false;
typeOfLastLine = check_pragma(currPragma);
test_and_insert_ompenddo(os, typeOfLastLine, waitforOMPEndDo,
infile, currPragma->lineno, pragma_indent,
0, addSharedDecl);
process_pragma(currPragma, os);
currPragma = 0;
}
} else {
/*
* normal line
@ -264,25 +451,87 @@ void process_fortran(istream& is, const char* infile, ostream& os,
cleanup_and_exit();
} else if ( currPragma ) {
// if necessary process last complete directive
typeOfLastLine = check_pragma(currPragma);
test_and_insert_ompenddo(os, typeOfLastLine, waitforOMPEndDo, infile,
currPragma->lineno, pragma_indent, 0,
addSharedDecl);
process_pragma(currPragma, os);
currPragma = 0;
}
if ( is_comment_line(lowline, line) ) {
// normal line: comment but no OMP pragma
os << line << '\n';
# ifdef EBUG
cerr << setw(3) << lineno << ":C : " << line << '\n';
# endif
} else if ( line.size() == 0 ||
lowline.find_first_not_of(" \t") == string::npos ) {
// empty line
os << line << '\n';
# ifdef EBUG
cerr << setw(3) << lineno << ":E : " << line << '\n';
# endif
} else {
// really normal line
del_strings_and_comments(lowline, inString);
if ( instrument_locks() ) {
replace_openmp_api_calls(lowline, line);
}
test_and_insert_ompenddo(os, typeOfLastLine, waitforOMPEndDo,
infile, lineno, pragma_indent, 0,
addSharedDecl);
os << line << '\n';
extra_handler(lineno, os);
# ifdef EBUG
cerr << setw(3) << lineno << ": : " << line << '\n';
# endif
// search for loop start statement
if ( is_loop_start(lowline, line, label ) ) {
if(typeOfLastLine==PRAGMA_LOOPSTART)
toploop.is_omp=TYPE_OMP_LOOP;
else if(typeOfLastLine==PRAGMA_PARLOOPSTART)
toploop.is_omp=TYPE_OMP_PARLOOP;
else
toploop.is_omp=TYPE_NO_OMP;
toploop.label = label;
loopstack.push(toploop);
# ifdef EBUG
cerr << setw(3) << lineno << ":L" << (toploop.is_omp?"O":" ")
<< ": " << line << " (" << label << ")\n";
# endif
// search for loop end statement
} else if ( (!loopstack.empty()) &&
is_loop_end(lowline, line, toploop.label) ) {
# ifdef EBUG
cerr << setw(3) << lineno << ":l" << (waitforOMPEndDo?"O":" ")
<< ": " << line << "\n";
# endif
waitforOMPEndDo = toploop.is_omp;
loopstack.pop();
if (!loopstack.empty()) { toploop = loopstack.top(); }
else { toploop.is_omp = TYPE_NO_OMP; toploop.label = "<none>"; }
// more than one loop ending on same statement (only numerical labels)
while ( (toploop.label.find_first_of("0123456789") != string::npos)
&& (is_loop_end(lowline, line, toploop.label) )
) {
waitforOMPEndDo = toploop.is_omp;
loopstack.pop();
if (!loopstack.empty()) { toploop = loopstack.top(); }
else { toploop.is_omp = TYPE_NO_OMP; toploop.label = "<none>"; }
}
} else {
// normal line
# ifdef EBUG
cerr << setw(3) << lineno << ": : " << line << '\n';
# endif
}
typeOfLastLine=NORMAL_LINE;
}
}
}

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

@ -1,9 +1,9 @@
/****************************************************************************
** SCALASCA http://www.scalasca.org/ **
** KOJAK http://www.fz-juelich.de/zam/kojak/ **
** KOJAK http://www.fz-juelich.de/jsc/kojak/ **
*****************************************************************************
** Copyright (c) 1998-2007 **
** Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik **
** Copyright (c) 1998-2008 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/

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

@ -10,9 +10,7 @@
* See the file COPYRIGHT in the package base directory for details
**/
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "config.h"
#include <iostream>
#include <fstream>
@ -27,14 +25,14 @@
#include <unistd.h>
#include <sys/types.h>
#include <BPatch.h>
#include <BPatch_function.h>
#include <BPatch_image.h>
#include <BPatch_module.h>
#include <BPatch_process.h>
#include <BPatch_snippet.h>
#include <BPatch_statement.h>
#include <BPatch_Vector.h>
#include "BPatch.h"
#include "BPatch_function.h"
#include "BPatch_image.h"
#include "BPatch_module.h"
#include "BPatch_process.h"
#include "BPatch_snippet.h"
#include "BPatch_statement.h"
#include "BPatch_Vector.h"
#include "vt_dyn.h"

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