1
1

merging VampirTrace-5.4.4.3 into the main branch

This commit was SVN r17417.
Этот коммит содержится в:
Matthias Jurenz 2008-02-11 11:47:29 +00:00
родитель cf801edfe5
Коммит ecd5d4e634
8 изменённых файлов: 329 добавлений и 48 удалений

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

@ -193,6 +193,7 @@
- fixed a portability bug: use own implementation of function
'strdup()'
- removed variadic macros (they were introduced in C99)
- fixed potential race condition by using OpenMP + LIBC's I/O tracing
- fixed a bug for determining the timer-resolution for ITC
- added check if we can link '-lz' in order to pass either '-lotf -lz'
or just '-lotf' as OTF link option

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

@ -1357,6 +1357,11 @@ AC_DEFUN([ACVT_OTF],
otf_conf_cmd="$otf_srcdir/configure"
otf_conf_args=
AS_IF([test x"$cross_compiling" = "xyes"],
[
AS_IF([test ! -z $build], [otf_conf_args="$otf_conf_args --build=$build"])
AS_IF([test ! -z $host], [otf_conf_args="$otf_conf_args --host=$host"])
])
AS_IF([test x"$have_zlib" = "xyes"],
[
AS_IF([test x"$force_zlib" = "xyes"],
@ -1371,11 +1376,6 @@ AC_DEFUN([ACVT_OTF],
[
otf_conf_args=--without-zlib
])
AS_IF([test x"$cross_compiling" = "xyes"],
[
AS_IF([test ! -z $build], [otf_conf_args="$otf_conf_args --build=$build"])
AS_IF([test ! -z $host], [otf_conf_args="$otf_conf_args --host=$host"])
])
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\""
@ -1781,7 +1781,7 @@ AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]
ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
ax_openmp_flags="-mp -fopenmp -openmp -xopenmp -omp -qsmp=omp none"
if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
fi

270
ompi/contrib/vt/vt/configure поставляемый
Просмотреть файл

@ -5403,10 +5403,6 @@ fi
CXXFLAGS_FOR_BUILD=$CXXFLAGS
fi
if test x"$CXXCPP_FOR_BUILD" = x; then
CXXCPP_FOR_BUILD=$CXXCPP
fi
if test x"$CPPFLAGS_FOR_BUILD" = x; then
CPPFLAGS_FOR_BUILD=$CPPFLAGS
fi
@ -5430,7 +5426,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
sav_CXX=$CXX; sav_CXXFLAGS=$CXXFLAGS; sav_CXXCPP=$CXXCPP
sav_CPPFLAGS=$CPPFLAGS; sav_LDFLAGS=$LDFLAGS; sav_LIBS=$LIBS
CXX=$CXX_FOR_BUILD; CXXFLAGS=$CXXFLAGS_FOR_BUILD; CXXCPP=$CXXCPP_FOR_BUILD
CXX=$CXX_FOR_BUILD; CXXFLAGS=$CXXFLAGS_FOR_BUILD
CPPFLAGS=$CPPFLAGS_FOR_BUILD; LDFLAGS=$LDFLAGS_FOR_BUILD; LIBS=$LIBS_FOR_BUILD
{ echo "$as_me:$LINENO: checking whether the C++ compiler for build system works" >&5
echo $ECHO_N "checking whether the C++ compiler for build system works... $ECHO_C" >&6; }
@ -5482,6 +5478,242 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test x"$CXXCPP_FOR_BUILD" = x; then
unset CXXCPP
unset ac_cv_prog_CXXCPP # clear cache variable for CXXCPP
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
if test -z "$CXXCPP"; then
if test "${ac_cv_prog_CXXCPP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Double quotes because CXXCPP needs to be expanded
for CXXCPP in "$CXX -E" "/lib/cpp"
do
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
}; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
break
fi
done
ac_cv_prog_CXXCPP=$CXXCPP
fi
CXXCPP=$ac_cv_prog_CXXCPP
else
ac_cv_prog_CXXCPP=$CXXCPP
fi
{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
echo "${ECHO_T}$CXXCPP" >&6; }
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
}; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
}; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
{ { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CXXCPP_FOR_BUILD=$CXXCPP
fi
CXX=$sav_CXX; CXXFLAGS=$sav_CXXFLAGS; CXXCPP=$sav_CXXCPP
CPPFLAGS=$sav_CPPFLAGS; LDFLAGS=$sav_LDFLAGS; LIBS=$sav_LIBS
ac_ext=c
@ -8717,6 +8949,19 @@ fi
otf_conf_cmd="$otf_srcdir/configure"
otf_conf_args=
if test x"$cross_compiling" = "xyes"; then
if test ! -z $build; then
otf_conf_args="$otf_conf_args --build=$build"
fi
if test ! -z $host; then
otf_conf_args="$otf_conf_args --host=$host"
fi
fi
if test x"$have_zlib" = "xyes"; then
if test x"$force_zlib" = "xyes"; then
@ -8740,19 +8985,6 @@ else
otf_conf_args=--without-zlib
fi
if test x"$cross_compiling" = "xyes"; then
if test ! -z $build; then
otf_conf_args="$otf_conf_args --build=$build"
fi
if test ! -z $host; then
otf_conf_args="$otf_conf_args --host=$host"
fi
fi
@ -12928,7 +13160,7 @@ else
ax_cv_c_openmp=unknown
# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
ax_openmp_flags="-mp -fopenmp -openmp -xopenmp -omp -qsmp=omp none"
if test "x$OPENMP_CFLAGS" != x; then
ax_openmp_flags="$OPENMP_CFLAGS $ax_openmp_flags"
fi

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

@ -72,7 +72,6 @@ In cross compile mode, it's recommended to build the compiler wrappers and OPARI
cxx_for_build_given="yes"
])
AS_IF([test x"$CXXFLAGS_FOR_BUILD" = x], [CXXFLAGS_FOR_BUILD=$CXXFLAGS])
AS_IF([test x"$CXXCPP_FOR_BUILD" = x], [CXXCPP_FOR_BUILD=$CXXCPP])
AS_IF([test x"$CPPFLAGS_FOR_BUILD" = x], [CPPFLAGS_FOR_BUILD=$CPPFLAGS])
AS_IF([test x"$LDFLAGS_FOR_BUILD" = x], [LDFLAGS_FOR_BUILD=$LDFLAGS])
AS_IF([test x"$LIBS_FOR_BUILD" = x], [LIBS_FOR_BUILD=$LIBS])
@ -82,13 +81,22 @@ In cross compile mode, it's recommended to build the compiler wrappers and OPARI
AC_LANG([C++])
sav_CXX=$CXX; sav_CXXFLAGS=$CXXFLAGS; sav_CXXCPP=$CXXCPP
sav_CPPFLAGS=$CPPFLAGS; sav_LDFLAGS=$LDFLAGS; sav_LIBS=$LIBS
CXX=$CXX_FOR_BUILD; CXXFLAGS=$CXXFLAGS_FOR_BUILD; CXXCPP=$CXXCPP_FOR_BUILD
CXX=$CXX_FOR_BUILD; CXXFLAGS=$CXXFLAGS_FOR_BUILD
CPPFLAGS=$CPPFLAGS_FOR_BUILD; LDFLAGS=$LDFLAGS_FOR_BUILD; LIBS=$LIBS_FOR_BUILD
AC_MSG_CHECKING([whether the C++ compiler for build system works])
AC_TRY_LINK([], [],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([C++ compiler for build system cannot create executables
See \`config.log' for more details.])])
AS_IF([test x"$CXXCPP_FOR_BUILD" = x],
[
unset CXXCPP
unset ac_cv_prog_CXXCPP # clear cache variable for CXXCPP
AC_PROG_CXXCPP
CXXCPP_FOR_BUILD=$CXXCPP
])
CXX=$sav_CXX; CXXFLAGS=$sav_CXXFLAGS; CXXCPP=$sav_CXXCPP
CPPFLAGS=$sav_CPPFLAGS; LDFLAGS=$sav_LDFLAGS; LIBS=$sav_LIBS
AC_LANG([C])

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

@ -29,6 +29,14 @@ struct Process {
};
struct FiltHandlerArgument {
FiltHandlerArgument() {}
FiltHandlerArgument(const FiltHandlerArgument& src)
: nm2tok(src.nm2tok), t2p(src.t2p),
wstream(src.wstream), mc(src.mc)
{
}
std::map<std::string, uint32_t> nm2tok; /* created during definition reading*/
std::map<uint32_t, Process > t2p;
OTF_WStream* wstream;

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

@ -396,7 +396,8 @@ int main( int argc, char** argv ) {
#ifdef VT_OMP
#pragma omp parallel for firstprivate(mc,nfiles,minbytes,maxbytes) \
shared(fha,curbytes,readrecords,lastprogressupdate,progress_counter,erroroccured)
shared(fha,curbytes,readrecords,lastprogressupdate,progress_counter,erroroccured) \
private(retev,retst,retsn)
#endif
for( int streamindex = 0; streamindex < maxstreams; ++streamindex )
{
@ -802,7 +803,8 @@ int main( int argc, char** argv ) {
#ifdef VT_OMP
#pragma omp parallel for firstprivate(fha,nfiles,compression,minbytes,maxbytes) \
shared(curbytes,readrecords,lastprogressupdate,progress_counter)
shared(curbytes,readrecords,lastprogressupdate,progress_counter) \
private(retev,retst,retsn)
#endif
for( int streamindex = 0; streamindex < maxstreams; ++streamindex )
{
@ -1176,8 +1178,8 @@ static map<uint32_t,uint64_t> readFilterFile( const string& filename, const map<
ulimit= ATOL8(line.substr(a+4, line.size()-a-4).c_str());
line= line.substr(0, a);
sline = new char[line.length()+1];
strcpy( sline, line.c_str() );
sline = new char[line.length()+1];
strcpy( sline,line.c_str() );
char* token = strtok(sline, ";");
while( token ) {
@ -1224,7 +1226,7 @@ void updateProgressDisplay( uint32_t i, uint64_t max, uint64_t cur ) {
/* static char animation[]= {"-", "\\", "|", "/" }; */
static char* animation[]= { (char*)"", (char*)"." };
static const char* animation[]= { "", "." };
/* printf( "%llu / %llu \n", cur, max ); */

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

@ -32,6 +32,9 @@ int max_open_files = 0;
vampir_file_t *fd_to_vampirid = NULL;
/*
* store_vampir_file_id() must be run in a critical section if OpenMP is used!
*/
static void store_vampir_file_id(int fd, uint32_t file_id,
uint32_t file_group_id)
{
@ -45,14 +48,7 @@ static void store_vampir_file_id(int fd, uint32_t file_id,
#endif
file_ptr->vampir_file_id = file_id;
file_ptr->vampir_file_group_id = file_group_id;
# if defined (VT_OMPI) || defined (VT_OMP)
# pragma omp critical (vt_iofile_1)
{
# endif
file_ptr->handle_id = global_handle_counter++;
# if defined (VT_OMPI) || defined (VT_OMP)
}
# endif
file_ptr->handle_id = global_handle_counter++;
}
vampir_file_t *get_vampir_file(int fd)
@ -81,7 +77,7 @@ int get_total_open_files(int max_open_files)
{
#if defined (VT_OMPI) || defined (VT_OMP)
/* alloc numthreads * max_open_files entries */
return (max_open_files * omp_get_thread_num());
return (max_open_files * omp_get_max_threads());
#else
return max_open_files;
#endif
@ -95,7 +91,14 @@ void vt_iofile_open(const char* fname, int fd)
/* fprintf( stderr, "opening file: %s\n", fname); */
gid=(fd<3) ? file_group_id_stdio : file_group_id_rest;
#if defined (VT_OMPI) || defined (VT_OMP)
# pragma omp critical
{
#endif
fid = vt_def_fileio(fname, gid);
store_vampir_file_id(fd, fid, gid);
#if defined (VT_OMPI) || defined (VT_OMP)
}
#endif
}

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

@ -196,9 +196,23 @@ void vt_check_thrd_id(uint32_t tid);
void vt_open()
{
int i_am_the_initer = 0;
/* check for double initialization error */
if ( vt_open_called ) return;
vt_open_called = 1;
#if (defined (VT_OMPI) || defined (VT_OMP))
# pragma omp critical
{
#endif
if ( !vt_open_called ) {
vt_open_called = 1;
i_am_the_initer = 1;
}
#if (defined (VT_OMPI) || defined (VT_OMP))
}
#endif
if (vt_open_called && !i_am_the_initer)
return;
/* initialization specific to this platform */
vt_pform_init();
@ -368,13 +382,26 @@ void vt_open()
void vt_close()
{
int i, nf;
int i_am_the_closer = 0;
/* catch vt_close called from child processes through atexit */
if ( init_pid != getpid() ) return;
/* check for double finalization error */
if ( vt_close_called ) return;
vt_close_called = 1;
#if (defined (VT_OMPI) || defined (VT_OMP))
# pragma omp critical
{
#endif
if ( !vt_close_called ) {
vt_close_called = 1;
i_am_the_closer = 1;
}
#if (defined (VT_OMPI) || defined (VT_OMP))
}
#endif
if (vt_close_called && !i_am_the_closer)
return;
vt_is_alive = 0;
@ -418,7 +445,7 @@ void vt_close()
#endif
/* copy per-process trace from local directory to
current working directory */
global directory */
for(i=0; i<(int)VTThrd_get_num_thrds(); i++)
vt_cpy_to_gdir(i);
@ -433,7 +460,7 @@ void vt_close()
/*- Rank 0: unify trace files -*/
if (my_trace == 0 && vt_env_do_unify())
{
int len = strlen(vt_env_gdir()) + strlen(vt_env_fprefix()) + 16;
int len = strlen(vt_env_gdir()) + strlen(vt_env_fprefix()) + 32;
char* filename;
char* cmd;
@ -721,7 +748,7 @@ static void vt_cpy_to_gdir(uint32_t tid)
suffix = strchr(tmp_name+strlen(tmp_prefix)+1, '.');
local_name = (char*)calloc(strlen(vt_env_gdir()) +
strlen(vt_env_fprefix()) + 16, sizeof(char));
strlen(vt_env_fprefix()) + 32, sizeof(char));
/* build local file name */
sprintf(local_name, "%s/%s.%x%s",