1
1

- added environment variable VT_METRICS_SEP to specify a string which separate the counter names in VT_METRICS

- set configure variable 'inside_openmpi' to "no", if hidden argument '--with-openmpi-inside' not given
- added functions 'MPI_Group_range_<incl|excl>' to Fortran MPI wrappers
- updated default configure options for NECSX, BlueGene/L+P
- repaired tools/opari/doc/lacsi01.pdf
- fixed several Coverity warnings

This commit was SVN r22476.
Этот коммит содержится в:
Matthias Jurenz 2010-01-25 16:08:56 +00:00
родитель d2031ff2d8
Коммит 34281f0fa2
33 изменённых файлов: 513 добавлений и 364 удалений

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

@ -1,12 +1,15 @@
5.8.1openmpi 5.8.1openmpi
- updated version of internal OTF to 1.6.5openmpi - updated version of internal OTF to 1.6.5openmpi
(see extlib/otf/ChangeLog) (see extlib/otf/ChangeLog)
- added functions 'MPI_Group_range_<incl|excl>' to Fortran MPI wrappers
- added environment variable VT_METRICS_SEP to specify a string which separate
the counter names in VT_METRICS
- fixed build error: do not add objects from the static version of the - fixed build error: do not add objects from the static version of the
BFD library to the shared VT libraries, because the BFD objects might BFD library to the shared VT libraries, because the BFD objects might
be built without position independent code (PIC) be built without position independent code (PIC)
5.8openmpi 5.8openmpi
- updated version of internal OTF to 1.6.4openmpi - updated version of internal OTF to 1.6.4stingray
(see extlib/otf/ChangeLog) (see extlib/otf/ChangeLog)
- added support for tracing calls to arbitrary third party libraries - added support for tracing calls to arbitrary third party libraries
The new tool 'vtlibwrapgen' can be used to generate a wrapper library. The new tool 'vtlibwrapgen' can be used to generate a wrapper library.
@ -14,6 +17,7 @@
filter directives filter directives
- added support for automatic instrumentation with PGI 9 compiler using - added support for automatic instrumentation with PGI 9 compiler using
its new compiler flag '-Minstrument' its new compiler flag '-Minstrument'
- added MPI-parallel trace unifier (vtunify-mpi)
- disabled simultaneous support for multiple compiler instrumentation - disabled simultaneous support for multiple compiler instrumentation
types in one VampirTrace installation types in one VampirTrace installation
(all known compiler instrumentation types for the compiler wrappers (all known compiler instrumentation types for the compiler wrappers

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

@ -3,6 +3,7 @@ CXX="blrts_xlC"
F77="blrts_xlf90" F77="blrts_xlf90"
FC="blrts_xlf90" FC="blrts_xlf90"
MPICC="mpixlc" MPICC="mpixlc"
MPICXX="mpixlcxx"
CC_FOR_BUILD="xlc_r" CC_FOR_BUILD="xlc_r"
CXX_FOR_BUILD="xlC_r" CXX_FOR_BUILD="xlC_r"
enable_shared="no" enable_shared="no"

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

@ -3,6 +3,7 @@ CXX="bgxlC_r"
F77="bgxlf_r" F77="bgxlf_r"
FC="bgxlf95_r" FC="bgxlf95_r"
MPICC="mpixlc_r" MPICC="mpixlc_r"
MPICXX="mpixlcxx_r"
CC_FOR_BUILD="xlc_r" CC_FOR_BUILD="xlc_r"
CXX_FOR_BUILD="xlC_r" CXX_FOR_BUILD="xlC_r"
enable_shared="no" enable_shared="no"

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

@ -5,6 +5,7 @@ F77="sxf90"
FC="sxf90" FC="sxf90"
CCAS="sxas" CCAS="sxas"
MPICC="sxmpicc" MPICC="sxmpicc"
MPICXX="sxmpic++"
MPIF77="sxmpif90" MPIF77="sxmpif90"
CC_FOR_BUILD="cc" CC_FOR_BUILD="cc"
CXX_FOR_BUILD="c++" CXX_FOR_BUILD="c++"

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

@ -11,7 +11,7 @@ AC_DEFUN([ACVT_BFD],
BFDLIB= BFDLIB=
AC_ARG_WITH(bfd, AC_ARG_WITH(bfd,
AC_HELP_STRING([--with-bfd], [use BFD to get symbol information of an executable instrumented with GNU, Intel, or Pathscale compiler, default: yes]), AC_HELP_STRING([--with-bfd], [use BFD to get symbol information of an executable instrumented with GNU, Intel, PGI9, or Pathscale compiler, default: yes]),
[AS_IF([test x"$withval" = "xyes"], [force_bfd="yes"], [check_bfd="no"])]) [AS_IF([test x"$withval" = "xyes"], [force_bfd="yes"], [check_bfd="no"])])
AC_ARG_WITH(bfd-dir, AC_ARG_WITH(bfd-dir,

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

@ -1,8 +1,6 @@
# This file lists all calls, which should not be generated # This file lists all calls, which should not be generated
# automatically by mk_fortran_wrapper.sh # automatically by mk_fortran_wrapper.sh
MPI_Group_range_excl
MPI_Group_range_incl
MPI_Init MPI_Init
MPI_Initialized MPI_Initialized
MPI_Init_thread MPI_Init_thread

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

@ -110,7 +110,7 @@ cat <<End-of-File >$tmp.awk
if (type[i-2] == "char*") { if (type[i-2] == "char*") {
strings[stringcnt++] = para[i-2] strings[stringcnt++] = para[i-2]
printf "%s %s", type[i-2], para[i-2] printf "%s %s", type[i-2], para[i-2]
} else if (index(type[i-2], "*") != 0) { } else if (index(type[i-2], "*") != 0 || index(para[i-2], "[") != 0) {
printf "%s %s", converttype(type[i-2]), para[i-2] printf "%s %s", converttype(type[i-2]), para[i-2]
} else { } else {
printf "%s* %s", converttype(type[i-2]), para[i-2] printf "%s* %s", converttype(type[i-2]), para[i-2]
@ -155,8 +155,6 @@ cat <<End-of-File >$tmp.awk
printf " *ierr = %s(", mpicall printf " *ierr = %s(", mpicall
for (i=3; i<=NF; i++) { for (i=3; i<=NF; i++) {
if (i > 3) printf ", " if (i > 3) printf ", "
#remove arrays declarations from parameter:
gsub("[[].*[]]","",para[i-2])
# If the original type already needed a pointer, pass as is, # If the original type already needed a pointer, pass as is,
# otherwise dereference the parameter # otherwise dereference the parameter
printf "%s", get_converted_name(para[i-2],type[i-2]) printf "%s", get_converted_name(para[i-2],type[i-2])
@ -179,7 +177,7 @@ cat <<End-of-File >$tmp.awk
} else { } else {
for (i=3; i<=NF; i++) { for (i=3; i<=NF; i++) {
if (i > 3) printf ", " if (i > 3) printf ", "
if (index(type[i-2], "*") != 0) if (index(type[i-2], "*") != 0 || index(para[i-2], "[") != 0)
printf "%s %s", converttype(type[i-2]), para[i-2] printf "%s %s", converttype(type[i-2]), para[i-2]
else else
printf "%s* %s", converttype(type[i-2]), para[i-2] printf "%s* %s", converttype(type[i-2]), para[i-2]
@ -763,10 +761,13 @@ function get_converted_name(para,type) {
if (type == "char*") return para "C" if (type == "char*") return para "C"
pointer="" pointer=""
if (index(type, "*") == 0) if (index(type, "*") == 0 && index(para, "[") == 0)
pointer="*" pointer="*"
#Find out wheter we have to pass address operator "&" #remove arrays declarations from parameter:
gsub("[[].*[]]","",para)
#find out wheter we have to pass address operator "&"
address="" address=""
if ((index(para,"_CLASS_SINGLE_") != 0) && (index(type,"MPI_Status") == 0) ) if ((index(para,"_CLASS_SINGLE_") != 0) && (index(type,"MPI_Status") == 0) )
address="&" address="&"

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

@ -12,7 +12,9 @@ AM_CONFIG_HEADER(config.h)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Check whether we are inside Open MPI package # Check whether we are inside Open MPI package
AC_ARG_WITH(openmpi-inside, [], [inside_openmpi="yes"]) inside_openmpi="no"
AC_ARG_WITH(openmpi-inside, [],
[AS_IF([test x"$withval" != "xno"], [inside_openmpi="yes"])])
ACVT_CONF_INIT ACVT_CONF_INIT

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

@ -52,8 +52,7 @@ DIV.navigation { }
SPAN.textbf { font-weight: bold } SPAN.textbf { font-weight: bold }
SPAN.arabic { } SPAN.arabic { }
SPAN.textit { font-style: italic } SPAN.textit { font-style: italic }
body {font-family: sans-serif;}
BODY {font-family: sans-serif;}
</STYLE> </STYLE>
</HEAD> </HEAD>
@ -62,7 +61,7 @@ BODY {font-family: sans-serif;}
<P> <P>
<P> <P>
<B><BIG CLASS="XHUGE">VampirTrace 5.8 User Manual</BIG></B> <B><BIG CLASS="XHUGE">VampirTrace 5.8.1 User Manual</BIG></B>
<BR> <BR>
<BR> <BR>
<BR> <BR>
@ -289,18 +288,18 @@ OpenMP events, and performance counters.
<P> <P>
After a successful tracing run, VampirTrace writes all collected data to a After a successful tracing run, VampirTrace writes all collected data to a
trace file in the Open Trace Format (OTF)<A NAME="tex2html3" trace file in the Open Trace Format (OTF)<A NAME="tex2html3"
HREF="#foot1148"><SUP>[+]</SUP></A>. HREF="#foot1149"><SUP>[+]</SUP></A>.
As a result, the information is available for post-mortem analysis and As a result, the information is available for post-mortem analysis and
visualization by various tools. visualization by various tools.
Most notably, VampirTrace provides the input data for the Vampir analysis Most notably, VampirTrace provides the input data for the Vampir analysis
and visualization tool<A NAME="tex2html5" and visualization tool<A NAME="tex2html5"
HREF="#foot1149"><SUP>[+]</SUP></A>. HREF="#foot1150"><SUP>[+]</SUP></A>.
<P> <P>
VampirTrace is included in OpenMPI&nbsp;1.3 and later versions. VampirTrace is included in OpenMPI&nbsp;1.3 and later versions.
If not disabled explicitly, VampirTrace is built automatically when installing If not disabled explicitly, VampirTrace is built automatically when installing
OpenMPI<A NAME="tex2html7" OpenMPI<A NAME="tex2html7"
HREF="#foot1150"><SUP>[+]</SUP></A>. HREF="#foot1151"><SUP>[+]</SUP></A>.
<P> <P>
Trace files can quickly become very large, especially with automatic instrumentation. Trace files can quickly become very large, especially with automatic instrumentation.
@ -1048,7 +1047,7 @@ Binary Instrumentation Using Dyninst
The option <TT>-vt:inst dyninst</TT> is used with the compiler wrapper to The option <TT>-vt:inst dyninst</TT> is used with the compiler wrapper to
instrument the application during runtime (binary instrumentation), by using instrument the application during runtime (binary instrumentation), by using
Dyninst<A NAME="tex2html10" Dyninst<A NAME="tex2html10"
HREF="#foot1174"><SUP>[+]</SUP></A>. HREF="#foot1175"><SUP>[+]</SUP></A>.
Recompiling is not necessary for this kind of instrumentation, Recompiling is not necessary for this kind of instrumentation,
but relinking: but relinking:
@ -1310,7 +1309,7 @@ of a VampirTrace instrumented executable:
<TD ALIGN="LEFT">1</TD> <TD ALIGN="LEFT">1</TD>
</TR> </TR>
<TR><TD ALIGN="LEFT"><TT>VT_MAX_THREADS</TT></TD> <TR><TD ALIGN="LEFT"><TT>VT_MAX_THREADS</TT></TD>
<TD ALIGN="LEFT">Maximum number of threads (<SPAN CLASS="MATH"><A NAME="tex2html_wrap_inline2599" <TD ALIGN="LEFT">Maximum number of threads (<SPAN CLASS="MATH"><A NAME="tex2html_wrap_inline2602"
HREF="img3.png">[IMAGE png]</A></SPAN>) per process that VampirTrace reserves resources for.</TD> HREF="img3.png">[IMAGE png]</A></SPAN>) per process that VampirTrace reserves resources for.</TD>
<TD ALIGN="LEFT">65536</TD> <TD ALIGN="LEFT">65536</TD>
</TR> </TR>
@ -1430,11 +1429,15 @@ of a VampirTrace instrumented executable:
</TR> </TR>
<TR><TD ALIGN="LEFT"><TT>VT_METRICS</TT></TD> <TR><TD ALIGN="LEFT"><TT>VT_METRICS</TT></TD>
<TD ALIGN="LEFT">Specify counter metrics to be recorded with trace events as a <TD ALIGN="LEFT">Specify counter metrics to be recorded with trace events as a
colon-separated list of names. colon/VT_METRICS_SEP-separated list of names.
<BR> <BR>
&rArr; Section&nbsp;<A HREF="#hw_perf_counters">[*]</A></TD> &rArr; Section&nbsp;<A HREF="#hw_perf_counters">[*]</A></TD>
<TD ALIGN="LEFT">-</TD> <TD ALIGN="LEFT">-</TD>
</TR> </TR>
<TR><TD ALIGN="LEFT"><TT>VT_METRICS_SEP</TT></TD>
<TD ALIGN="LEFT">Separator string between counter specifications in VT_METRICS.</TD>
<TD ALIGN="LEFT">:</TD>
</TR>
<TR><TD ALIGN="LEFT"><TT>VT_RUSAGE</TT></TD> <TR><TD ALIGN="LEFT"><TT>VT_RUSAGE</TT></TD>
<TD ALIGN="LEFT">Colon-separated list of resource usage counters which shall be recorded. <TD ALIGN="LEFT">Colon-separated list of resource usage counters which shall be recorded.
<BR> <BR>
@ -1684,7 +1687,7 @@ for the enhanced timer synchronization:
<UL> <UL>
<LI>CLAPACK<A NAME="tex2html12" <LI>CLAPACK<A NAME="tex2html12"
HREF="#foot1184"><SUP>[+]</SUP></A> HREF="#foot1185"><SUP>[+]</SUP></A>
</LI> </LI>
<LI>AMD ACML <LI>AMD ACML
</LI> </LI>
@ -2619,7 +2622,7 @@ default: automatically by configure
enable support for Dyninst instrumentation, enable support for Dyninst instrumentation,
default: enable if found by configure default: enable if found by configure
<SPAN CLASS="textbf">Note:</SPAN> Requires Dyninst<A NAME="tex2html17" <SPAN CLASS="textbf">Note:</SPAN> Requires Dyninst<A NAME="tex2html17"
HREF="#foot1200"><SUP>[+]</SUP></A> version 5.1 or higher! HREF="#foot1201"><SUP>[+]</SUP></A> version 5.1 or higher!
<P> <P>
</DD> </DD>
@ -4090,39 +4093,39 @@ into the official VampirTrace package.
<P> <P>
<BR><HR><H4>Footnotes</H4> <BR><HR><H4>Footnotes</H4>
<DL> <DL>
<DT><A NAME="foot1148">... (OTF)</A><A <DT><A NAME="foot1149">... (OTF)</A><A
HREF="UserManual.html#tex2html3"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html3"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html4" <DD><TT><A NAME="tex2html4"
HREF="http://www.tu-dresden.de/zih/otf">http://www.tu-dresden.de/zih/otf</A></TT> HREF="http://www.tu-dresden.de/zih/otf">http://www.tu-dresden.de/zih/otf</A></TT>
</DD> </DD>
<DT><A NAME="foot1149">... tool </A><A <DT><A NAME="foot1150">... tool </A><A
HREF="UserManual.html#tex2html5"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html5"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html6" <DD><TT><A NAME="tex2html6"
HREF="http://www.vampir.eu">http://www.vampir.eu</A></TT> HREF="http://www.vampir.eu">http://www.vampir.eu</A></TT>
</DD> </DD>
<DT><A NAME="foot1150">... <DT><A NAME="foot1151">...
Open MPI </A><A Open MPI </A><A
HREF="UserManual.html#tex2html7"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html7"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html8" <DD><TT><A NAME="tex2html8"
HREF="http://www.open-mpi.org/faq/?category=vampirtrace">http://www.open-mpi.org/faq/?category=vampirtrace</A></TT> HREF="http://www.open-mpi.org/faq/?category=vampirtrace">http://www.open-mpi.org/faq/?category=vampirtrace</A></TT>
</DD> </DD>
<DT><A NAME="foot1174">... <DT><A NAME="foot1175">...
Dyninst </A><A Dyninst </A><A
HREF="UserManual.html#tex2html10"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html10"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html11" <DD><TT><A NAME="tex2html11"
HREF="http://www.dyninst.org">http://www.dyninst.org</A></TT> HREF="http://www.dyninst.org">http://www.dyninst.org</A></TT>
</DD> </DD>
<DT><A NAME="foot1184">... CLAPACK</A><A <DT><A NAME="foot1185">... CLAPACK</A><A
HREF="UserManual.html#tex2html12"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html12"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html13" <DD><TT><A NAME="tex2html13"
HREF="www.netlib.org/clapack">www.netlib.org/clapack</A></TT> HREF="www.netlib.org/clapack">www.netlib.org/clapack</A></TT>
</DD> </DD>
<DT><A NAME="foot1200">... Dyninst </A><A <DT><A NAME="foot1201">... Dyninst </A><A
HREF="UserManual.html#tex2html17"><SUP>[+]</SUP></A></DT> HREF="UserManual.html#tex2html17"><SUP>[+]</SUP></A></DT>
<DD><TT><A NAME="tex2html18" <DD><TT><A NAME="tex2html18"
HREF="http://www.dyninst.org">http://www.dyninst.org</A></TT> HREF="http://www.dyninst.org">http://www.dyninst.org</A></TT>

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

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

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

@ -16,10 +16,11 @@
/* *** some macros *** ****************************************** */ /* *** some macros *** ****************************************** */
#define PARSE_ERROR( buffer ) \ #define PARSE_ERROR( buffer ) { \
char* record_str = OTF_RBuffer_printRecord( buffer ); \
OTF_fprintf( stderr, "parse error in %s() %s:%u : %s", \ OTF_fprintf( stderr, "parse error in %s() %s:%u : %s", \
__FUNCTION__, __FILE__, __LINE__, OTF_RBuffer_printRecord( buffer ) ); __FUNCTION__, __FILE__, __LINE__, record_str ); \
free( record_str ); }
/* *** local headers *** **************************************************** */ /* *** local headers *** **************************************************** */

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

@ -1070,8 +1070,10 @@ int OTF_Reader_finish( OTF_Reader* reader ) {
reader->markerHeap= NULL; reader->markerHeap= NULL;
} }
if ( NULL != reader->mc ) {
OTF_MasterControl_close( reader->mc ); OTF_MasterControl_close( reader->mc );
reader->mc = NULL; reader->mc = NULL;
}
return ret; return ret;
} }

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

@ -23,15 +23,15 @@ static void set_handles_level_3( OTF_HandlerArray *handles,
static void set_handles_level_4( OTF_HandlerArray *handles, static void set_handles_level_4( OTF_HandlerArray *handles,
definitionInfoT *info ); definitionInfoT *info );
static void show_info_level_1( definitionInfoT info ); static void show_info_level_1( definitionInfoT *info );
static void show_info_level_2( definitionInfoT info ); static void show_info_level_2( definitionInfoT *info );
static void show_info_level_3( definitionInfoT info ); static void show_info_level_3( definitionInfoT *info );
static void show_info_level_4( definitionInfoT info ); static void show_info_level_4( definitionInfoT *info );
static void free_data_level_1( definitionInfoT info ); static void free_data_level_1( definitionInfoT *info );
static void free_data_level_2( definitionInfoT info ); static void free_data_level_2( definitionInfoT *info );
static void free_data_level_3( definitionInfoT info ); static void free_data_level_3( definitionInfoT *info );
static void free_data_level_4( definitionInfoT info ); static void free_data_level_4( definitionInfoT *info );
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@ -183,12 +183,12 @@ int main(int argc, char **argv)
/*printing the results and cleanup*/ /*printing the results and cleanup*/
if( 0 < infoLevel ) if( 0 < infoLevel )
{ {
show_info_level_1( info ); show_info_level_1( &info );
free_data_level_1( info ); free_data_level_1( &info );
if( 1 < infoLevel ) if( 1 < infoLevel )
{ {
show_info_level_2( info ); show_info_level_2( &info );
free_data_level_2( info ); free_data_level_2( &info );
} }
} }
checkVal = OTF_HandlerArray_close( handles ); checkVal = OTF_HandlerArray_close( handles );
@ -260,12 +260,12 @@ int main(int argc, char **argv)
otfinfo_assert( checkVal != OTF_READ_ERROR ); otfinfo_assert( checkVal != OTF_READ_ERROR );
} }
/*printing the results and cleanup*/ /*printing the results and cleanup*/
show_info_level_3( info ); show_info_level_3( &info );
free_data_level_3( info ); free_data_level_3( &info );
if( 3 < infoLevel ) if( 3 < infoLevel )
{ {
show_info_level_4( info ); show_info_level_4( &info );
free_data_level_4( info ); free_data_level_4( &info );
} }
checkVal = OTF_HandlerArray_close( handles ); checkVal = OTF_HandlerArray_close( handles );
otfinfo_assert( checkVal ); otfinfo_assert( checkVal );
@ -323,11 +323,11 @@ static void set_handles_level_1( OTF_HandlerArray *handles,
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFINITIONCOMMENT_RECORD ); OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFINITIONCOMMENT_RECORD );
} }
static void show_info_level_1( definitionInfoT info ) static void show_info_level_1( definitionInfoT *info )
{ {
uint32_t i = 0, index = 0; uint32_t i = 0, index = 0;
double resolution = info.timerResolution; double resolution = info->timerResolution;
double fileSize = info.traceFileSize; double fileSize = info->traceFileSize;
char* unitTimer; char* unitTimer;
char* unitFileSize; char* unitFileSize;
@ -366,38 +366,38 @@ static void show_info_level_1( definitionInfoT info )
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| general information \n" ); printf( "| general information \n" );
printf( "+----------------------+--------------------------------------------------------\n" ); printf( "+----------------------+--------------------------------------------------------\n" );
printf( "| tracefile name | %s\n", info.filePrefix ); printf( "| tracefile name | %s\n", info->filePrefix );
printf( "| creator of the trace | %s\n", info.creatorName ); printf( "| creator of the trace | %s\n", info->creatorName );
printf( "| used OTF version | %i.%i.%i %s\n", info.otfVersionMajor, printf( "| used OTF version | %i.%i.%i %s\n", info->otfVersionMajor,
info.otfVersionMinor, info.otfVersionSub, info.otfVersionString ); info->otfVersionMinor, info->otfVersionSub, info->otfVersionString );
printf( "| event files size | %.2f %s\n", fileSize,unitFileSize ); printf( "| event files size | %.2f %s\n", fileSize,unitFileSize );
printf( "| process definitions | %llu\n", printf( "| process definitions | %llu\n",
(unsigned long long)info.counterProcessDefinition ); (unsigned long long)info->counterProcessDefinition );
printf( "| timer resolution | %.2f %s\n",resolution,unitTimer ); printf( "| timer resolution | %.2f %s\n",resolution,unitTimer );
printf( "+----------------------+--------------------------------------------------------\n" ); printf( "+----------------------+--------------------------------------------------------\n" );
index = info.counterDefinitionComment; index = info->counterDefinitionComment;
printf( "| definition comments\n" ); printf( "| definition comments\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < index; i++ ) for( i = 0; i < index; i++ )
{ {
printf( "| %s\n", info.definitionComments[i] ); printf( "| %s\n", info->definitionComments[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
} }
static void free_data_level_1( definitionInfoT info ) static void free_data_level_1( definitionInfoT *info )
{ {
uint32_t i, index; uint32_t i, index;
free( info.creatorName ); free( info->creatorName );
index = info.counterDefinitionComment; index = info->counterDefinitionComment;
for( i = 0; i < index; i++ ) for( i = 0; i < index; i++ )
{ {
free( info.definitionComments[i] ); free( info->definitionComments[i] );
} }
free( info.definitionComments ); free( info->definitionComments );
free( info.otfVersionString ); free( info->otfVersionString );
} }
static void set_handles_level_2( OTF_HandlerArray *handles, definitionInfoT *info ) static void set_handles_level_2( OTF_HandlerArray *handles, definitionInfoT *info )
@ -453,7 +453,7 @@ static void set_handles_level_2( OTF_HandlerArray *handles, definitionInfoT *inf
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFSCLFILE_RECORD ); OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFSCLFILE_RECORD );
} }
static void show_info_level_2( definitionInfoT info ) static void show_info_level_2( definitionInfoT *info )
{ {
int index,i; int index,i;
@ -464,41 +464,41 @@ static void show_info_level_2( definitionInfoT info )
printf( "| trace content\n" ); printf( "| trace content\n" );
printf( "+----------------------------+--------------------------------------------------\n" ); printf( "+----------------------------+--------------------------------------------------\n" );
printf( "| function definitions | %llu\n", printf( "| function definitions | %llu\n",
(unsigned long long)info.counterFunctionDefinition ); (unsigned long long)info->counterFunctionDefinition );
printf( "| counter definitions | %llu\n", printf( "| counter definitions | %llu\n",
(unsigned long long)info.counterCounterDefinition ); (unsigned long long)info->counterCounterDefinition );
printf( "| marker definitions | %llu\n", printf( "| marker definitions | %llu\n",
(unsigned long long)info.counterDefinitionMarker ); (unsigned long long)info->counterDefinitionMarker );
printf( "| |\n" ); printf( "| |\n" );
printf( "| process group definitions | %llu\n", printf( "| process group definitions | %llu\n",
(unsigned long long)info.counterProcessGroupDefinition ); (unsigned long long)info->counterProcessGroupDefinition );
printf( "| function group definitions | %llu\n", printf( "| function group definitions | %llu\n",
(unsigned long long)info.counterFunctionGroupDefinition ); (unsigned long long)info->counterFunctionGroupDefinition );
printf( "| counter group definitions | %llu\n", printf( "| counter group definitions | %llu\n",
(unsigned long long)info.counterCounterGroupDefinition ); (unsigned long long)info->counterCounterGroupDefinition );
printf( "+----------------------------+--------------------------------------------------\n" ); printf( "+----------------------------+--------------------------------------------------\n" );
index = info.counterSourceFileName; index = info->counterSourceFileName;
printf( "| source file names\n" ); printf( "| source file names\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < index; i++) for( i = 0; i < index; i++)
{ {
printf( "| %s\n", info.sourceFileNames[i] ); printf( "| %s\n", info->sourceFileNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
} }
static void free_data_level_2( definitionInfoT info ) static void free_data_level_2( definitionInfoT *info )
{ {
int i, index; int i, index;
index = info.counterSourceFileName; index = info->counterSourceFileName;
for( i = 0; i < index; i++ ) for( i = 0; i < index; i++ )
{ {
free( (info.sourceFileNames)[i] ); free( (info->sourceFileNames)[i] );
} }
free( info.sourceFileNames ); free( info->sourceFileNames );
} }
static void set_handles_level_3( OTF_HandlerArray *handles, static void set_handles_level_3( OTF_HandlerArray *handles,
@ -613,7 +613,7 @@ static void set_handles_level_3( OTF_HandlerArray *handles,
} }
static void show_info_level_3( definitionInfoT info ) static void show_info_level_3( definitionInfoT *info )
{ {
uint64_t i; uint64_t i;
@ -622,47 +622,47 @@ static void show_info_level_3( definitionInfoT info )
printf( "\n##############\n" ); printf( "\n##############\n" );
printf( "+-----------------------+-------------------------------------------------------\n" ); printf( "+-----------------------+-------------------------------------------------------\n" );
printf( "| enters | %llu\n", printf( "| enters | %llu\n",
(unsigned long long)info.counterEnter ); (unsigned long long)info->counterEnter );
printf( "| leaves | %llu\n", printf( "| leaves | %llu\n",
(unsigned long long)info.counterLeave ); (unsigned long long)info->counterLeave );
printf( "| sends | %llu\n", printf( "| sends | %llu\n",
(unsigned long long)info.counterSend ); (unsigned long long)info->counterSend );
printf( "| receives | %llu\n", printf( "| receives | %llu\n",
(unsigned long long)info.counterReceive ); (unsigned long long)info->counterReceive );
printf( "| RMA Put | %llu\n", printf( "| RMA Put | %llu\n",
(unsigned long long)info.counterRMAPut ); (unsigned long long)info->counterRMAPut );
printf( "| RMA Put remote end | %llu\n", printf( "| RMA Put remote end | %llu\n",
(unsigned long long)info.counterRMAPutRemoteEnd ); (unsigned long long)info->counterRMAPutRemoteEnd );
printf( "| RMA Get | %llu\n", printf( "| RMA Get | %llu\n",
(unsigned long long)info.counterRMAGet ); (unsigned long long)info->counterRMAGet );
printf( "| RMA End | %llu\n", printf( "| RMA End | %llu\n",
(unsigned long long)info.counterRMAEnd ); (unsigned long long)info->counterRMAEnd );
printf( "| collective operations | %llu\n", printf( "| collective operations | %llu\n",
(unsigned long long)info.counterCollectiveOperation ); (unsigned long long)info->counterCollectiveOperation );
printf( "| file operations | %llu\n", printf( "| file operations | %llu\n",
(unsigned long long)info.counterFileOperation ); (unsigned long long)info->counterFileOperation );
printf( "| snapshots | %llu\n", printf( "| snapshots | %llu\n",
(unsigned long long)info.counterSnapshot ); (unsigned long long)info->counterSnapshot );
printf( "+-----------------------+-------------------------------------------------------\n" ); printf( "+-----------------------+-------------------------------------------------------\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| counters[%llu]\n", printf( "| counters[%llu]\n",
(unsigned long long)info.counterCounterDefinition ); (unsigned long long)info->counterCounterDefinition );
printf( "+---------------+---------------------------------------------------------------\n" ); printf( "+---------------+---------------------------------------------------------------\n" );
for( i = 0; i < info.counterCounterDefinition; i++ ) for( i = 0; i < info->counterCounterDefinition; i++ )
{ {
printf( "| name | %s\n", info.counters[i].name ); printf( "| name | %s\n", info->counters[i].name );
if( ((info.counters[i].properties) & OTF_COUNTER_TYPE_BITS) == if( ((info->counters[i].properties) & OTF_COUNTER_TYPE_BITS) ==
OTF_COUNTER_TYPE_ACC ) OTF_COUNTER_TYPE_ACC )
{ {
uint64_t lastValue = uint64_t lastValue =
process_get_sum_value( info.counters[i].processMap ); process_get_sum_value( info->counters[i].processMap );
uint64_t lastTime = uint64_t lastTime =
process_get_sum_time( info.counters[i].processMap ); process_get_sum_time( info->counters[i].processMap );
double average = double average =
((double)(lastValue)) * ((double)(info.timerResolution)) / ((double)(lastValue)) * ((double)(info->timerResolution)) /
((double)(lastTime)); ((double)(lastTime));
double highestRate = double highestRate =
process_get_highest_rate(info.counters[i].processMap); process_get_highest_rate(info->counters[i].processMap);
printf( "| last value | %llu\n", (unsigned long long)lastValue ); printf( "| last value | %llu\n", (unsigned long long)lastValue );
printf( "| average rate | %7.4E per sec\n", average ); printf( "| average rate | %7.4E per sec\n", average );
@ -674,17 +674,17 @@ static void show_info_level_3( definitionInfoT info )
printf( "\n" ); printf( "\n" );
} }
static void free_data_level_3( definitionInfoT info ) static void free_data_level_3( definitionInfoT *info )
{ {
uint64_t i; uint64_t i;
for( i = 0; i < info.counterCounterDefinition; i++ ) for( i = 0; i < info->counterCounterDefinition; i++ )
{ {
free( (info.counters)[i].name ); free( (info->counters)[i].name );
if( NULL != (info.counters)[i].processMap ) if( NULL != (info->counters)[i].processMap )
hash_delete( (info.counters)[i].processMap ); hash_delete( (info->counters)[i].processMap );
} }
free( info.counters ); free( info->counters );
} }
static void set_handles_level_4( OTF_HandlerArray *handles, static void set_handles_level_4( OTF_HandlerArray *handles,
@ -747,7 +747,7 @@ static void set_handles_level_4( OTF_HandlerArray *handles,
OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTERGROUP_RECORD ); OTF_HandlerArray_setFirstHandlerArg( handles, info, OTF_DEFCOUNTERGROUP_RECORD );
} }
static void show_info_level_4( definitionInfoT info ) static void show_info_level_4( definitionInfoT *info )
{ {
uint64_t i; uint64_t i;
@ -756,130 +756,130 @@ static void show_info_level_4( definitionInfoT info )
printf( "\n##############\n" ); printf( "\n##############\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| process definitions[%llu]\n", printf( "| process definitions[%llu]\n",
(unsigned long long)info.counterProcessDefinition ); (unsigned long long)info->counterProcessDefinition );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterProcessDefinition; i++ ) for( i = 0; i < info->counterProcessDefinition; i++ )
{ {
printf( "| %s\n", info.processNames[i] ); printf( "| %s\n", info->processNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| function definitions[%llu]\n", printf( "| function definitions[%llu]\n",
(unsigned long long)info.counterFunctionDefinition ); (unsigned long long)info->counterFunctionDefinition );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for(i = 0; i < info.counterFunctionDefinition; i++ ) for(i = 0; i < info->counterFunctionDefinition; i++ )
{ {
printf( "| %s\n",info.functionNames[i] ); printf( "| %s\n",info->functionNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| marker definitions[%llu]\n", printf( "| marker definitions[%llu]\n",
(unsigned long long)info.counterDefinitionMarker ); (unsigned long long)info->counterDefinitionMarker );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterDefinitionMarker; i++ ) for( i = 0; i < info->counterDefinitionMarker; i++ )
{ {
printf( "| %s\n", info.markerNames[i] ); printf( "| %s\n", info->markerNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| collective operation definitions[%llu]\n", printf( "| collective operation definitions[%llu]\n",
(unsigned long long)info.counterCollectiveOperation ); (unsigned long long)info->counterCollectiveOperation );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterCollectiveOperation; i++ ) for( i = 0; i < info->counterCollectiveOperation; i++ )
{ {
printf( "| %s\n", info.collectiveOperationNames[i] ); printf( "| %s\n", info->collectiveOperationNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| process group definitions[%llu]\n", printf( "| process group definitions[%llu]\n",
(unsigned long long)info.counterProcessGroupDefinition ); (unsigned long long)info->counterProcessGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterProcessGroupDefinition; i++ ) for( i = 0; i < info->counterProcessGroupDefinition; i++ )
{ {
printf( "| %s\n", info.processGroupNames[i] ); printf( "| %s\n", info->processGroupNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| function group definitions[%llu]\n", printf( "| function group definitions[%llu]\n",
(unsigned long long)info.counterFunctionGroupDefinition ); (unsigned long long)info->counterFunctionGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterFunctionGroupDefinition; i++ ) for( i = 0; i < info->counterFunctionGroupDefinition; i++ )
{ {
printf( "| %s\n", info.functionGroupNames[i] ); printf( "| %s\n", info->functionGroupNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "\n" ); printf( "\n" );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
printf( "| counter group definitions[%llu]\n", printf( "| counter group definitions[%llu]\n",
(unsigned long long)info.counterCounterGroupDefinition ); (unsigned long long)info->counterCounterGroupDefinition );
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
for( i = 0; i < info.counterCounterGroupDefinition; i++ ) for( i = 0; i < info->counterCounterGroupDefinition; i++ )
{ {
printf( "| %s\n", info.counterGroupNames[i] ); printf( "| %s\n", info->counterGroupNames[i] );
} }
printf( "+-------------------------------------------------------------------------------\n" ); printf( "+-------------------------------------------------------------------------------\n" );
} }
static void free_data_level_4( definitionInfoT info ) static void free_data_level_4( definitionInfoT *info )
{ {
uint64_t i; uint64_t i;
if( info.processNames != NULL ) if( info->processNames != NULL )
{ {
for( i = 0; i < info.counterProcessDefinition; i++ ) for( i = 0; i < info->counterProcessDefinition; i++ )
{ {
free( (info.processNames)[i] ); free( (info->processNames)[i] );
} }
free( info.processNames ); free( info->processNames );
} }
if( info.processGroupNames != NULL ) if( info->processGroupNames != NULL )
{ {
for( i = 0; i < info.counterProcessGroupDefinition; i++ ) for( i = 0; i < info->counterProcessGroupDefinition; i++ )
{ {
free( (info.processGroupNames)[i] ); free( (info->processGroupNames)[i] );
} }
free( info.processGroupNames ); free( info->processGroupNames );
} }
if( info.functionNames != NULL ) if( info->functionNames != NULL )
{ {
for( i = 0; i < info.counterFunctionDefinition; i++ ) for( i = 0; i < info->counterFunctionDefinition; i++ )
{ {
free( (info.functionNames)[i] ); free( (info->functionNames)[i] );
} }
free( info.functionNames ); free( info->functionNames );
} }
if( info.functionGroupNames != NULL ) if( info->functionGroupNames != NULL )
{ {
for( i = 0; i < info.counterFunctionGroupDefinition; i++ ) for( i = 0; i < info->counterFunctionGroupDefinition; i++ )
{ {
free( (info.functionGroupNames)[i] ); free( (info->functionGroupNames)[i] );
} }
free( info.functionGroupNames ); free( info->functionGroupNames );
} }
for(i = 0; i < info.counterCollectiveOperation; i++ ) for(i = 0; i < info->counterCollectiveOperation; i++ )
{ {
free( (info.collectiveOperationNames)[i] ); free( (info->collectiveOperationNames)[i] );
} }
free( info.collectiveOperationNames ); free( info->collectiveOperationNames );
for(i = 0; i < info.counterCounterGroupDefinition; i++ ) for(i = 0; i < info->counterCounterGroupDefinition; i++ )
{ {
free( (info.counterGroupNames)[i] ); free( (info->counterGroupNames)[i] );
} }
free( info.counterGroupNames ); free( info->counterGroupNames );
for( i = 0; i < info.counterDefinitionMarker; i++ ) for( i = 0; i < info->counterDefinitionMarker; i++ )
{ {
free( (info.markerNames)[i] ); free( (info->markerNames)[i] );
} }
free( info.markerNames ); free( info->markerNames );
} }

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

@ -1643,7 +1643,7 @@ bool Summary_Container::find_CollOp(CollOp_Def_Key coll_def_key)
return true; return true;
} }
int Summary_Container::mergeContainer(Summary_Container container) { int Summary_Container::mergeContainer(Summary_Container& container) {
FunctionMap fmap = container.function_map; FunctionMap fmap = container.function_map;
FunctionMap::iterator fit; FunctionMap::iterator fit;

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

@ -827,7 +827,7 @@ class Summary_Container
int csv_P2P(fstream& out, uint32_t trace); int csv_P2P(fstream& out, uint32_t trace);
int csv_CollOp(fstream& out, uint32_t trace); int csv_CollOp(fstream& out, uint32_t trace);
int csv_Data(fstream& out, uint32_t trace); int csv_Data(fstream& out, uint32_t trace);
int mergeContainer(Summary_Container container); int mergeContainer(Summary_Container& container);
private: private:
FunctionMap function_map; FunctionMap function_map;

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

@ -344,7 +344,7 @@ int main( int argc, const char** argv )
} }
} }
data_array = (global_data**) malloc(num_threads * sizeof(global_data)); data_array = (global_data**) malloc(num_threads * sizeof(global_data*));
cpu2thread = (uint32_t*) malloc(num_cpus * sizeof(uint32_t)); cpu2thread = (uint32_t*) malloc(num_cpus * sizeof(uint32_t));
/* Definitons */ /* Definitons */
@ -472,9 +472,11 @@ int main( int argc, const char** argv )
uint32_t start = 0; uint32_t start = 0;
uint32_t end = 0; uint32_t end = 0;
# ifdef _OPENMP
for(int k=0; k<omp_get_thread_num(); k++) { for(int k=0; k<omp_get_thread_num(); k++) {
start += threads[k]; start += threads[k];
} }
# endif
end = start + threads[omp_get_thread_num()] - 1; end = start + threads[omp_get_thread_num()] - 1;
for(uint32_t i=0; i<num_cpus; i++) { for(uint32_t i=0; i<num_cpus; i++) {

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

@ -38,6 +38,7 @@ int handleDefProcessGroup (void *userData, uint32_t stream, uint32_t procGroup,
uint32_t *mod_procs = new uint32_t[numberOfProcs]; uint32_t *mod_procs = new uint32_t[numberOfProcs];
uint32_t mod_numberOfProcs = 0; uint32_t mod_numberOfProcs = 0;
int ret;
for(uint32_t i = 0; i < numberOfProcs; i++) { for(uint32_t i = 0; i < numberOfProcs; i++) {
if ( first->procMap.end() != first->procMap.find(procs[i]) ) { if ( first->procMap.end() != first->procMap.find(procs[i]) ) {
@ -48,12 +49,17 @@ int handleDefProcessGroup (void *userData, uint32_t stream, uint32_t procGroup,
} }
if(mod_numberOfProcs < 1) { if(mod_numberOfProcs < 1) {
delete[] mod_procs;
return OTF_RETURN_OK; return OTF_RETURN_OK;
} }
return ( 0 == OTF_Writer_writeDefProcessGroup ( (OTF_Writer*) first->writer, stream, procGroup, name, ret = ( 0 == OTF_Writer_writeDefProcessGroup ( (OTF_Writer*) first->writer, stream, procGroup, name,
mod_numberOfProcs, mod_procs) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK; mod_numberOfProcs, mod_procs) ) ? OTF_RETURN_ABORT : OTF_RETURN_OK;
delete[] mod_procs;
return ret;
} }
int handleDefFunction (void *userData, uint32_t stream, uint32_t func, const char *name, uint32_t funcGroup, uint32_t source) { int handleDefFunction (void *userData, uint32_t stream, uint32_t func, const char *name, uint32_t funcGroup, uint32_t source) {
@ -106,8 +112,11 @@ int handleDefCreator (void *userData, uint32_t stream, const char *creator) {
int handleDefVersion (void *userData, uint32_t stream, uint8_t major, uint8_t minor, uint8_t sub, const char *string) { int handleDefVersion (void *userData, uint32_t stream, uint8_t major, uint8_t minor, uint8_t sub, const char *string) {
return ( 0 == OTF_Writer_writeOtfVersion ( (OTF_Writer*) userData, stream) ) /* this is deprecated and not necessary at all */
? OTF_RETURN_ABORT : OTF_RETURN_OK; /*return ( 0 == OTF_Writer_writeOtfVersion ( (OTF_Writer*) userData, stream) )
? OTF_RETURN_ABORT : OTF_RETURN_OK;*/
return OTF_RETURN_OK;
} }
int handleDefFile (void *userData, uint32_t stream, uint32_t token, const char *name, uint32_t group) { int handleDefFile (void *userData, uint32_t stream, uint32_t token, const char *name, uint32_t group) {

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

@ -25,6 +25,9 @@
#define RANGE_MODE 1 #define RANGE_MODE 1
#define TABLE_MODE 2 #define TABLE_MODE 2
#define CLEAR_EVERYTHING free_all_pointers(ch_i, first, entries, writer, reader, \
handlers, manager, master, new_master);
#define HELPTEXT "" \ #define HELPTEXT "" \
" \n" \ " \n" \
" otfshrink - creates a new otf file that only includes \n" \ " otfshrink - creates a new otf file that only includes \n" \
@ -50,10 +53,13 @@ map<int, bool> cpuMap;
int write_master(string input, string output, bool invers, bool show, int sim_mode); int write_master(string input, string output, bool invers, bool show, int sim_mode);
int display_processes(firstarg *first, int sim_mode); int display_processes(firstarg *first, int sim_mode);
void free_all_pointers(char *ch_i, firstarg *first, OTF_MapEntry *entries, OTF_Writer *writer,
OTF_Reader *reader, OTF_HandlerArray *handlers, OTF_FileManager *manager,
OTF_MasterControl *master, OTF_MasterControl *new_master);
int main (int argc, char* argv[]) { int main (int argc, char* argv[]) {
char *pwd = new char[OTF_PATH_MAX]; char *pwd = NULL;
bool enable = true; bool enable = true;
bool invers_mode = true; bool invers_mode = true;
bool mode_set = false; bool mode_set = false;
@ -69,12 +75,6 @@ int main (int argc, char* argv[]) {
string output_folder; string output_folder;
string output_path; string output_path;
/* get current working directory */
pwd = getcwd(pwd, OTF_PATH_MAX);
if ( pwd == NULL) {
cerr << "Error: Path length greater than the maximum." << endl;
}
if ( argc <= 1 ) { if ( argc <= 1 ) {
cout << HELPTEXT << endl; cout << HELPTEXT << endl;
return 0; return 0;
@ -223,6 +223,16 @@ int main (int argc, char* argv[]) {
return 1; return 1;
} }
/* get current working directory */
pwd = new char[OTF_PATH_MAX];
*pwd = '\0';
pwd = getcwd(pwd, OTF_PATH_MAX);
if ( pwd == NULL) {
cerr << "Error: Path length greater than the maximum." << endl;
delete[] pwd;
return 1;
}
/* make absolute path - necessary to create a symbolic link later on */ /* make absolute path - necessary to create a symbolic link later on */
if (input_path[0] != '/') { if (input_path[0] != '/') {
input_path = pwd + string("/") + input_path; input_path = pwd + string("/") + input_path;
@ -290,15 +300,9 @@ int main (int argc, char* argv[]) {
/*** end string operations ***/ /*** end string operations ***/
/* create symbolic links, definiton file and master file */ /* create symbolic links, definiton file and master file */
if ( write_master(input_path ,output_path, invers_mode, simulation, sim_mode) ) { return write_master(input_path ,output_path, invers_mode, simulation, sim_mode);
return 2;
}
return 0;
} }
int write_master(string input, string output, bool invers, bool show, int sim_mode) { int write_master(string input, string output, bool invers, bool show, int sim_mode) {
/* create symbolic links, definiton file and master file */ /* create symbolic links, definiton file and master file */
@ -320,8 +324,9 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
OTF_HandlerArray *handlers = NULL; OTF_HandlerArray *handlers = NULL;
OTF_FileManager *manager = NULL; OTF_FileManager *manager = NULL;
OTF_MasterControl *master = NULL; OTF_MasterControl *master = NULL;
OTF_MasterControl *new_master = NULL;
manager = OTF_FileManager_open(1); manager = OTF_FileManager_open(2);
master = OTF_MasterControl_new(manager); master = OTF_MasterControl_new(manager);
OTF_MasterControl_read(master, input.c_str()); OTF_MasterControl_read(master, input.c_str());
@ -333,6 +338,7 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
} else { } else {
cerr << "Error while reading tracefile. No entries in file found." << endl; cerr << "Error while reading tracefile. No entries in file found." << endl;
} }
CLEAR_EVERYTHING
return 2; return 2;
} }
@ -354,13 +360,13 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
} }
} }
/* create new master and symbolic links */ /* create new empty master and symbolic links */
master = OTF_MasterControl_new(manager); new_master = OTF_MasterControl_new(manager);
for(uint32_t i = 0; i < num_args; i++) { for(uint32_t i = 0; i < num_args; i++) {
append = false; append = false;
for(uint32_t j = 0; j < entries[i].n; j++) { for(uint32_t j = 0; j < entries[i].n; j++) {
if(entries[i].values[j] > 0) { if(entries[i].values[j] > 0) {
OTF_MasterControl_append(master, i+1, entries[i].values[j]); OTF_MasterControl_append(new_master, i+1, entries[i].values[j]);
first->procMap[ entries[i].values[j] ] = true; first->procMap[ entries[i].values[j] ] = true;
append = true; append = true;
} }
@ -372,7 +378,7 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
} }
/* create symbolic links */ /* create symbolic links */
sprintf(ch_i, "%x", i+1); snprintf(ch_i, MAX_L, "%x", i+1);
for(int k = 0; k < 4; k++) { for(int k = 0; k < 4; k++) {
@ -383,11 +389,13 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
if ( ! access(s_link.c_str(), F_OK) ) { if ( ! access(s_link.c_str(), F_OK) ) {
if ( unlink(s_link.c_str()) ) { if ( unlink(s_link.c_str()) ) {
cerr << "Error while removing symbolic link " << s_link << endl; cerr << "Error while removing symbolic link " << s_link << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
} }
if ( symlink( file.c_str(), s_link.c_str() ) ) { if ( symlink( file.c_str(), s_link.c_str() ) ) {
cerr << "Error while creating symbolic link " << s_link << endl; cerr << "Error while creating symbolic link " << s_link << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
} else { } else {
@ -398,16 +406,19 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
if ( ! access(s_link.c_str(), F_OK) ) { if ( ! access(s_link.c_str(), F_OK) ) {
if ( unlink(s_link.c_str()) ) { if ( unlink(s_link.c_str()) ) {
cerr << "Error while removing symbolic link " << s_link << endl; cerr << "Error while removing symbolic link " << s_link << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
} }
if ( symlink( file.c_str(), s_link.c_str() ) ) { if ( symlink( file.c_str(), s_link.c_str() ) ) {
cerr << "Error while creating symbolic link " << s_link << endl; cerr << "Error while creating symbolic link " << s_link << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
} else { } else {
if ( k == 0 ) { if ( k == 0 ) {
cerr << "Error: Could not find " << file << endl; cerr << "Error: Could not find " << file << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
} }
@ -415,14 +426,20 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
} }
} }
/* close original master, he is not needed anymore */
OTF_MasterControl_close(master);
master = NULL;
if (show) { if (show) {
display_processes(first, sim_mode); display_processes(first, sim_mode);
CLEAR_EVERYTHING
return 0; return 0;
} }
/* check if there is at least one process to show */ /* check if there is at least one process to show */
if (OTF_MasterControl_getCount(master) < 1) { if (OTF_MasterControl_getCount(new_master) < 1) {
cerr << "You exclude all processes! Master not wrote." << endl; cerr << "You exclude all processes! Master not wrote." << endl;
CLEAR_EVERYTHING
return 2; return 2;
} }
@ -513,24 +530,17 @@ int write_master(string input, string output, bool invers, bool show, int sim_mo
read = OTF_Reader_readDefinitions (reader, handlers); read = OTF_Reader_readDefinitions (reader, handlers);
if( read == OTF_READ_ERROR ) { if( read == OTF_READ_ERROR ) {
fprintf(stderr,"An error occurred while reading the tracefile. It seems to be damaged. Abort.\n"); cerr << "An error occurred while reading the tracefile. It seems to be damaged. Abort." << endl;
CLEAR_EVERYTHING
return 1; return 1;
} }
OTF_HandlerArray_close(handlers); /* set the writer's master to the modified master instance */
OTF_Reader_close(reader); /* closing the writer at the end writes the new master file to harddisk */
OTF_Writer_close(writer); OTF_Writer_setMasterControl(writer, new_master);
/* writes new master file to harddisk */
OTF_MasterControl_write(master, output.c_str());
OTF_MasterControl_close(master);
OTF_FileManager_close(manager);
/* clear everything */ /* clear everything */
delete[] ch_i; CLEAR_EVERYTHING
delete first;
delete[] entries;
return 0; return 0;
} }
@ -595,3 +605,56 @@ int display_processes(firstarg *first, int sim_mode) {
return 0; return 0;
} }
void free_all_pointers(char *ch_i, firstarg *first, OTF_MapEntry *entries, OTF_Writer *writer,
OTF_Reader *reader, OTF_HandlerArray *handlers, OTF_FileManager *manager,
OTF_MasterControl *master, OTF_MasterControl *new_master) {
if(ch_i != NULL) {
delete[] ch_i;
ch_i = NULL;
}
if(first != NULL) {
delete first;
first = NULL;
}
if(entries != NULL) {
delete[] entries;
entries = NULL;
}
/* new_master is free'd by writer instance */
if(writer != NULL) {
OTF_Writer_close(writer);
writer = NULL;
new_master = NULL;
}
if(reader != NULL) {
OTF_Reader_close(reader);
reader = NULL;
}
if(handlers != NULL) {
OTF_HandlerArray_close(handlers);
handlers = NULL;
}
if(manager != NULL) {
OTF_FileManager_close(manager);
manager = NULL;
}
if(master != NULL) {
OTF_MasterControl_close(master);
master = NULL;
}
if(new_master != NULL) {
OTF_MasterControl_close(new_master);
new_master = NULL;
}
}

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

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

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

@ -727,7 +727,7 @@ parseCommandLine( int argc, char ** argv )
{ {
Params.bequiet = true; Params.bequiet = true;
Params.showprogress = false; Params.showprogress = false;
Params.beverbose = false; Params.verbose_level = 0;
} }
else if( strcmp( argv[i], "-v" ) == 0 else if( strcmp( argv[i], "-v" ) == 0
|| strcmp( argv[i], "--verbose" ) == 0 ) || strcmp( argv[i], "--verbose" ) == 0 )
@ -880,10 +880,6 @@ getMinStartTime()
// store minimum timestamp // store minimum timestamp
g_uMinStartTime = min_start_time; g_uMinStartTime = min_start_time;
#ifdef VT_MPI
if( error ) return false;
#endif // VT_MPI
} // MASTER } // MASTER
#ifdef VT_MPI #ifdef VT_MPI
@ -935,6 +931,8 @@ cleanUp()
{ {
for( uint32_t j = 0; j < 4; j++ ) for( uint32_t j = 0; j < 4; j++ )
{ {
bool removed = false;
switch( j ) switch( j )
{ {
case 0: case 0:
@ -952,24 +950,25 @@ cleanUp()
} }
OTF_getFilename( Params.in_file_prefix.c_str(), OTF_getFilename( Params.in_file_prefix.c_str(),
g_vecUnifyCtls[i]->streamid, g_vecUnifyCtls[i]->streamid, filetype,
filetype,
STRBUFSIZE, filename1 ); STRBUFSIZE, filename1 );
if( access( filename1, F_OK ) != 0 ) if( !( removed = ( remove( filename1 ) == 0 ) ) )
{ {
assert( strlen( filename1 ) + 2 + 1 < sizeof( filename1 ) - 1 ); OTF_getFilename( Params.in_file_prefix.c_str(),
g_vecUnifyCtls[i]->streamid,
filetype | OTF_FILECOMPRESSION_COMPRESSED,
STRBUFSIZE, filename1 );
// file not found, try '.z' suffix removed = ( remove( filename1 ) == 0 );
strncat( filename1, ".z", 2 );
} }
if( remove( filename1 ) == 0 ) if( removed )
VPrint( 2, " Removed %s\n", filename1 ); VPrint( 2, " Removed %s\n", filename1 );
} }
} }
if( i != g_vecUnifyCtls.size() ) if( i < g_vecUnifyCtls.size() )
return false; return false;
} }
@ -980,41 +979,41 @@ cleanUp()
// //
for( i = 0; i < 2; i++ ) for( i = 0; i < 2; i++ )
{ {
bool renamed = false;
if( i == 0 ) filetype = OTF_FILETYPE_DEF; if( i == 0 ) filetype = OTF_FILETYPE_DEF;
else filetype = OTF_FILETYPE_MARKER; else filetype = OTF_FILETYPE_MARKER;
OTF_getFilename( tmp_out_file_prefix.c_str(), 0, OTF_getFilename( tmp_out_file_prefix.c_str(), 0, filetype,
filetype,
STRBUFSIZE, filename1 ); STRBUFSIZE, filename1 );
OTF_getFilename( Params.out_file_prefix.c_str(), 0, OTF_getFilename( Params.out_file_prefix.c_str(), 0, filetype,
filetype,
STRBUFSIZE, filename2 ); STRBUFSIZE, filename2 );
if( access( filename1, F_OK ) != 0 ) if( !( renamed = ( rename( filename1, filename2 ) == 0 ) ) )
{ {
assert( strlen( filename1 ) + 2 + 1 < sizeof( filename1 ) - 1 ); OTF_getFilename( tmp_out_file_prefix.c_str(), 0,
assert( strlen( filename2 ) + 2 + 1 < sizeof( filename2 ) - 1 ); filetype | OTF_FILECOMPRESSION_COMPRESSED,
STRBUFSIZE, filename1 );
OTF_getFilename( Params.out_file_prefix.c_str(), 0,
filetype | OTF_FILECOMPRESSION_COMPRESSED,
STRBUFSIZE, filename2 );
// file not found, try '.z' suffix renamed = ( rename( filename1, filename2 ) == 0 );
strncat( filename1, ".z", 2 );
strncat( filename2, ".z", 2 );
} }
if( rename( filename1, filename2 ) != 0 ) if( renamed )
{ {
if( i == 0 ) VPrint( 2, " Renamed %s to %s\n", filename1, filename2 );
}
else if( i == 0 )
{ {
std::cerr << ExeName << ": Error: Could not rename " std::cerr << ExeName << ": Error: Could not rename "
<< filename1 << " to " << filename1 << " to "
<< filename2 << std::endl; << filename2 << std::endl;
return false; break;
}
}
else
{
VPrint( 2, " Renamed %s to %s\n", filename1, filename2 );
} }
} }
if( i < 2 ) return false;
// rename temporary master control file // rename temporary master control file
// //
@ -1098,7 +1097,7 @@ shareParams()
// create MPI datatype for Params_struct // create MPI datatype for Params_struct
// //
char filenames[3][1024]; char **filenames;
char flags[5]; char flags[5];
VT_MPI_INT blockcounts[5] = { 3*1024, 1, 1, 1, 5 }; VT_MPI_INT blockcounts[5] = { 3*1024, 1, 1, 1, 5 };
VTUnify_MPI_Aint displ[5]; VTUnify_MPI_Aint displ[5];
@ -1107,7 +1106,12 @@ shareParams()
VTUnify_MPI_INT, VTUnify_MPI_CHAR }; VTUnify_MPI_INT, VTUnify_MPI_CHAR };
VTUnify_MPI_Datatype newtype; VTUnify_MPI_Datatype newtype;
VTUnify_MPI_Address( &filenames, &displ[0] ); filenames = new char*[3];
filenames[0] = new char[3*1024];
filenames[1] = filenames[0] + ( 1024 * sizeof(char) );
filenames[2] = filenames[1] + ( 1024 * sizeof(char) );
VTUnify_MPI_Address( filenames[0], &displ[0] );
VTUnify_MPI_Address( &(Params.uctl_files_num), &displ[1] ); VTUnify_MPI_Address( &(Params.uctl_files_num), &displ[1] );
VTUnify_MPI_Address( &(Params.verbose_level), &displ[2] ); VTUnify_MPI_Address( &(Params.verbose_level), &displ[2] );
VTUnify_MPI_Address( &(Params.stats_sort_flags), &displ[3] ); VTUnify_MPI_Address( &(Params.stats_sort_flags), &displ[3] );
@ -1146,6 +1150,9 @@ shareParams()
Params.bequiet = (flags[4] == 1); Params.bequiet = (flags[4] == 1);
} }
delete [] filenames[0];
delete [] filenames;
// free MPI datatype // free MPI datatype
VTUnify_MPI_Type_free( &newtype ); VTUnify_MPI_Type_free( &newtype );

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

@ -72,7 +72,6 @@ struct Params_struct
bool showusage; bool showusage;
bool showprogress; bool showprogress;
bool bequiet; bool bequiet;
bool beverbose;
}; };
// //

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

@ -496,7 +496,7 @@ Definitions::createGlobal( const std::vector<DefRec_Base_struct*> *
// start-time // start-time
// //
tt = (time_t)(g_uMinStartTimeEpoch / 1e6); tt = (time_t)(g_uMinStartTimeEpoch / 1e6);
sprintf( comment, " Start: %s (%"U64STR")", snprintf( comment, sizeof( comment ) - 1, " Start: %s (%"U64STR")",
asctime(localtime(&tt)), asctime(localtime(&tt)),
g_uMinStartTimeEpoch ); g_uMinStartTimeEpoch );
p_vecGlobDefs->push_back( new DefRec_DefinitionComment_struct( p_vecGlobDefs->push_back( new DefRec_DefinitionComment_struct(
@ -506,7 +506,7 @@ Definitions::createGlobal( const std::vector<DefRec_Base_struct*> *
// stop-time // stop-time
// //
tt = (time_t)(g_uMaxStopTimeEpoch / 1e6); tt = (time_t)(g_uMaxStopTimeEpoch / 1e6);
sprintf( comment, " Stop: %s (%"U64STR")", snprintf( comment, sizeof( comment ) - 1, " Stop: %s (%"U64STR")",
asctime(localtime(&tt)), asctime(localtime(&tt)),
g_uMaxStopTimeEpoch ); g_uMaxStopTimeEpoch );
p_vecGlobDefs->push_back( new DefRec_DefinitionComment_struct( p_vecGlobDefs->push_back( new DefRec_DefinitionComment_struct(
@ -517,7 +517,8 @@ Definitions::createGlobal( const std::vector<DefRec_Base_struct*> *
// //
tt = (time_t)((g_uMaxStopTimeEpoch - g_uMinStartTimeEpoch) / 1e6); tt = (time_t)((g_uMaxStopTimeEpoch - g_uMinStartTimeEpoch) / 1e6);
gmtime_r(&tt, &elapsed_tm); gmtime_r(&tt, &elapsed_tm);
sprintf( comment, " Elapsed: %s%d:%s%d:%s%d (%"U64STR")", snprintf( comment, sizeof( comment ) - 1,
" Elapsed: %s%d:%s%d:%s%d (%"U64STR")",
elapsed_tm.tm_hour < 10 ? "0" : "", elapsed_tm.tm_hour, elapsed_tm.tm_hour < 10 ? "0" : "", elapsed_tm.tm_hour,
elapsed_tm.tm_min < 10 ? "0" : "", elapsed_tm.tm_min, elapsed_tm.tm_min < 10 ? "0" : "", elapsed_tm.tm_min,
elapsed_tm.tm_sec < 10 ? "0" : "", elapsed_tm.tm_sec, elapsed_tm.tm_sec < 10 ? "0" : "", elapsed_tm.tm_sec,

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

@ -264,7 +264,8 @@ Wrapper::readDataFile()
case 21: // inst_avail case 21: // inst_avail
{ {
char cvalue[128]; char cvalue[128];
strcpy( cvalue, value.c_str() ); strncpy( cvalue, value.c_str(), sizeof( cvalue ) - 1 );
cvalue[sizeof(cvalue) - 1] = '\0';
char * token = strtok( cvalue, " " ); char * token = strtok( cvalue, " " );
if( !token ) if( !token )
@ -465,10 +466,12 @@ Wrapper::parseCommandLine( int argc, char ** argv )
return false; return false;
} }
char * args = new char[strlen(argv[i+1])+1]; size_t args_len = strlen(argv[i+1])+1;
strcpy( args, argv[++i] ); char * args = new char[args_len];
char * token = strtok( args, " " ); strncpy( args, argv[++i], args_len - 1 );
args[args_len - 1] = '\0';
char * token = strtok( args, " " );
do do
{ {
if( strcmp( token, "-rcfile" ) == 0 ) if( strcmp( token, "-rcfile" ) == 0 )
@ -478,7 +481,7 @@ Wrapper::parseCommandLine( int argc, char ** argv )
{ {
std::cerr << ExeName << ": <rcfile> expected -- -rcfile" std::cerr << ExeName << ": <rcfile> expected -- -rcfile"
<< std::endl; << std::endl;
delete args; delete [] args;
return false; return false;
} }
m_pConfig->opari_setRcFile( token ); m_pConfig->opari_setRcFile( token );
@ -490,7 +493,7 @@ Wrapper::parseCommandLine( int argc, char ** argv )
{ {
std::cerr << ExeName << ": <tabfile> expected -- -table" std::cerr << ExeName << ": <tabfile> expected -- -table"
<< std::endl; << std::endl;
delete args; delete [] args;
return false; return false;
} }
@ -502,7 +505,7 @@ Wrapper::parseCommandLine( int argc, char ** argv )
} }
} while( ( token = strtok( 0, " " ) ) ); } while( ( token = strtok( 0, " " ) ) );
delete args; delete [] args;
} }
// //
// -vt:seq // -vt:seq
@ -936,8 +939,6 @@ Wrapper::run()
// rename compiler output to original file name // rename compiler output to original file name
// //
for( i = 0; i < m_pConfig->m_vecOpari_ModObjFiles.size(); i++ ) for( i = 0; i < m_pConfig->m_vecOpari_ModObjFiles.size(); i++ )
{
if( access( m_pConfig->m_vecOpari_ModObjFiles[i].c_str(), F_OK ) == 0 )
{ {
int modi = m_pConfig->m_vecOpari_ModObjFiles[i].find( ".mod" ); int modi = m_pConfig->m_vecOpari_ModObjFiles[i].find( ".mod" );
@ -950,8 +951,13 @@ Wrapper::run()
std::cout << "+++ rename " << m_pConfig->m_vecOpari_ModObjFiles[i] std::cout << "+++ rename " << m_pConfig->m_vecOpari_ModObjFiles[i]
<< " to " << target << std::endl; << " to " << target << std::endl;
rename( m_pConfig->m_vecOpari_ModObjFiles[i].c_str(), if( rename( m_pConfig->m_vecOpari_ModObjFiles[i].c_str(),
target.c_str() ); target.c_str() ) == -1 )
{
std::cerr << ExeName << ": could not rename "
<< m_pConfig->m_vecOpari_ModObjFiles[i] << " to "
<< target << std::endl;
return 1;
} }
} }
} }
@ -1208,7 +1214,7 @@ Wrapper::getIncFilesFromTabFile()
// //
Config::Config() : Config::Config() :
m_eInstType(INST_TYPE_MANUAL), m_iInstAvail(0), m_eLangType(LANG_CC), m_eInstType(INST_TYPE_MANUAL), m_iInstAvail(0),
m_bBeVerbose(false), m_bCompOnly(false), m_bBeVerbose(false), m_bCompOnly(false),
m_bUsesMpi(false), m_bUsesThreads(false), m_bUsesMpi(false), m_bUsesThreads(false),
@ -1228,22 +1234,23 @@ Config::~Config()
bool bool
Config::setLanguage( const LangTypeT lang ) Config::setLanguage( const LangTypeT lang )
{ {
#if !(defined(HAVE_F77) && HAVE_F77) || !(defined(HAVE_F90) && HAVE_F90)
bool error = false; bool error = false;
std::string str_lang; std::string str_lang;
if( lang == LANG_F77 ) if( lang == LANG_F77 )
{ {
#if !(defined(HAVE_F77) && HAVE_F77) # if !(defined(HAVE_F77) && HAVE_F77)
str_lang = "Fortran 77"; str_lang = "Fortran 77";
error = true; error = true;
#endif // HAVE_F77 # endif // HAVE_F77
} }
else if( lang == LANG_F90 ) else if( lang == LANG_F90 )
{ {
#if !(defined(HAVE_F90) && HAVE_F90) # if !(defined(HAVE_F90) && HAVE_F90)
str_lang = "Fortran 90"; str_lang = "Fortran 90";
error = true; error = true;
#endif // HAVE_F90 # endif // HAVE_F90
} }
if( !error ) if( !error )
@ -1259,6 +1266,10 @@ Config::setLanguage( const LangTypeT lang )
} }
return !error; return !error;
#else // HAVE_F77 || HAVE_F90
m_eLangType = lang;
return true;
#endif // HAVE_F77 || HAVE_F90
} }
void void

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

@ -507,7 +507,8 @@ int vt_env_mode()
char* tk; char* tk;
int dc; int dc;
strncpy(tmpbuf, tmp, 128); strncpy(tmpbuf, tmp, 127);
tmpbuf[127] = '\0';
while( *p ) { *p = tolower(*p); p++; } while( *p ) { *p = tolower(*p); p++; }
tk = strtok(tmpbuf, ":"); tk = strtok(tmpbuf, ":");
@ -570,7 +571,8 @@ int vt_env_stat_props()
char* tk; char* tk;
int dc; int dc;
strncpy(tmpbuf, tmp, 128); strncpy(tmpbuf, tmp, 127);
tmpbuf[127] = '\0';
while( *p ) { *p = tolower(*p); p++; } while( *p ) { *p = tolower(*p); p++; }
if (strcmp( tmpbuf, "all" ) == 0) if (strcmp( tmpbuf, "all" ) == 0)
@ -626,7 +628,8 @@ int vt_env_stat_msg_dtls()
char* tk; char* tk;
int dc; int dc;
strncpy(tmpbuf, tmp, 128); strncpy(tmpbuf, tmp, 127);
tmpbuf[127] = '\0';
while( *p ) { *p = tolower(*p); p++; } while( *p ) { *p = tolower(*p); p++; }
tk = strtok(tmpbuf, ":"); tk = strtok(tmpbuf, ":");
@ -670,7 +673,8 @@ int vt_env_stat_collop_dtls()
char* tk; char* tk;
int dc; int dc;
strncpy(tmpbuf, tmp, 128); strncpy(tmpbuf, tmp, 127);
tmpbuf[127] = '\0';
while( *p ) { *p = tolower(*p); p++; } while( *p ) { *p = tolower(*p); p++; }
tk = strtok(tmpbuf, ":"); tk = strtok(tmpbuf, ":");
@ -1008,6 +1012,22 @@ char* vt_env_metrics()
return metrics; return metrics;
} }
char* vt_env_metrics_sep()
{
static char* metrics_sep = NULL;
if (!metrics_sep)
{
metrics_sep = getenv("VT_METRICS_SEP");
if (metrics_sep == NULL || strlen(metrics_sep) == 0)
{
metrics_sep = ":";
}
}
return metrics_sep;
}
/* The file with the metrics specifications can be defined with the /* The file with the metrics specifications can be defined with the
VT_METRICS_SPEC environment variable, otherwise it is looked for in VT_METRICS_SPEC environment variable, otherwise it is looked for in
the current directory and the VampirTrace installation DATADIR. */ the current directory and the VampirTrace installation DATADIR. */

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

@ -57,6 +57,7 @@ EXTERN int vt_env_mpicheck_errexit(void);
EXTERN char* vt_env_rusage(void); EXTERN char* vt_env_rusage(void);
EXTERN int vt_env_rusage_intv(void); EXTERN int vt_env_rusage_intv(void);
EXTERN char* vt_env_metrics(void); EXTERN char* vt_env_metrics(void);
EXTERN char* vt_env_metrics_sep(void);
EXTERN char* vt_env_metrics_spec(void); EXTERN char* vt_env_metrics_spec(void);
EXTERN int vt_env_sync_flush(void); EXTERN int vt_env_sync_flush(void);
EXTERN int vt_env_sync_flush_level(void); EXTERN int vt_env_sync_flush_level(void);

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

@ -77,8 +77,9 @@ static int get_new_trcid()
} }
/* read current trace id */ /* read current trace id */
if ( read(fd, tmp, 10) == -1 ) if ( read(fd, tmp, 9) == -1 )
vt_error_msg("Cannot read file %s: %s", trcid_filename, strerror(errno)); vt_error_msg("Cannot read file %s: %s", trcid_filename, strerror(errno));
tmp[9] = '\0';
if ( tmp[0] == '\0' ) if ( tmp[0] == '\0' )
new_trcid = 1; /* set trace id to 1, if file is empty */ new_trcid = 1; /* set trace id to 1, if file is empty */
@ -116,7 +117,7 @@ void vt_fork_init()
/* create temp. id filename, if necessary */ /* create temp. id filename, if necessary */
if ( trcid_filename[0] == '\0' ) if ( trcid_filename[0] == '\0' )
{ {
sprintf(trcid_filename, "%s/%s.%lx.%u.trcid.tmp", snprintf(trcid_filename, sizeof(trcid_filename)-1, "%s/%s.%lx.%u.trcid.tmp",
vt_env_ldir(), vt_env_fprefix(), vt_pform_node_id(), getpid()); vt_env_ldir(), vt_env_fprefix(), vt_pform_node_id(), getpid());
} }
} }

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

@ -284,8 +284,10 @@ void VTLibwrap_func_init(const VTLibwrap* lw, const char* func,
for( i = 0; i < lw->handlen; i++ ) for( i = 0; i < lw->handlen; i++ )
{ {
if( i > 0 ) strcat(dlsym_errors_merged, "\n"); if( i > 0 )
strcat(dlsym_errors_merged, dlsym_errors[i]); strncat(dlsym_errors_merged, "\n", 255 - strlen(dlsym_errors_merged));
strncat(dlsym_errors_merged, dlsym_errors[i],
255 - strlen(dlsym_errors_merged));
} }
vt_error_msg("dlsym(\"%s\") failed:\n%s", func, dlsym_errors_merged); vt_error_msg("dlsym(\"%s\") failed:\n%s", func, dlsym_errors_merged);
} }

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

@ -66,6 +66,7 @@ static void metricv_add(char* name)
int vt_metric_open() int vt_metric_open()
{ {
char* env; char* env;
char* env_sep;
char* var; char* var;
char* token; char* token;
@ -73,6 +74,8 @@ int vt_metric_open()
if ( ( env = vt_env_metrics() ) == NULL ) if ( ( env = vt_env_metrics() ) == NULL )
return 0; return 0;
env_sep = vt_env_metrics_sep();
var = strdup(env); var = strdup(env);
vt_cntl_msg(2, "VT_METRICS=%s", var); vt_cntl_msg(2, "VT_METRICS=%s", var);
@ -81,11 +84,11 @@ int vt_metric_open()
vt_error_msg("cpc_open: %s", strerror(errno)); vt_error_msg("cpc_open: %s", strerror(errno));
/* read metrics from specification string */ /* read metrics from specification string */
token = strtok(var, ":"); token = strtok(var, env_sep);
while ( token && (nmetrics < VT_METRIC_MAXNUM) ) while ( token && (nmetrics < VT_METRIC_MAXNUM) )
{ {
metricv_add( token ); metricv_add( token );
token = strtok(NULL, ":"); token = strtok(NULL, env_sep);
} }
free(var); free(var);

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

@ -355,6 +355,7 @@ int vt_metric_open()
{ {
int i; int i;
char* env; char* env;
char* env_sep;
char* var; char* var;
char* token; char* token;
const int max_metrics = sizeof (vt_sx_metrics) / sizeof (vt_sx_metrics[0]); const int max_metrics = sizeof (vt_sx_metrics) / sizeof (vt_sx_metrics[0]);
@ -364,6 +365,8 @@ int vt_metric_open()
if ( env == NULL ) if ( env == NULL )
return nmetrics; return nmetrics;
env_sep = vt_env_metrics_sep();
var = strdup(env); var = strdup(env);
vt_cntl_msg(2, "VT_METRICS=%s", var); vt_cntl_msg(2, "VT_METRICS=%s", var);
@ -372,7 +375,7 @@ int vt_metric_open()
while ( *token ) { *token = tolower(*token); token++; } while ( *token ) { *token = tolower(*token); token++; }
/* read metrics from specification string */ /* read metrics from specification string */
token = strtok(var, ":"); token = strtok(var, env_sep);
if (token && (0 == strcmp (token, "all"))) { if (token && (0 == strcmp (token, "all"))) {
vt_cntl_msg(2, "token:%s Adding all metrics", token); vt_cntl_msg(2, "token:%s Adding all metrics", token);
for (i = 0; i < max_metrics; i++) { for (i = 0; i < max_metrics; i++) {
@ -393,7 +396,7 @@ int vt_metric_open()
if (i == max_metrics) { if (i == max_metrics) {
vt_error_msg ("Metric <%s> not supported", token); vt_error_msg ("Metric <%s> not supported", token);
} }
token = strtok(NULL, ":"); token = strtok(NULL, env_sep);
} }
} }

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

@ -106,31 +106,27 @@ static metricmap_t* metricmap_append(metricmap_t* map,
static void metricmap_dump(metricmap_t* map) static void metricmap_dump(metricmap_t* map)
{ {
unsigned j=0; unsigned i = 0;
if (map == NULL) { if (map == NULL || vt_env_verbose() < 3)
printf("Can't dump empty metricmap!\n");
return; return;
}
printf("Metricmap dump (head=0x%p):\n", (void*)map); vt_cntl_msg(3, "Metricmap dump (head=0x%p):", (void*)map);
while (map != NULL) { while (map != NULL) {
printf("m[%3u] 0x%X %s = %s\n", j, map->type, vt_cntl_msg(3, "m[%3u] 0x%X %s = %s", i, map->type,
map->event_name, map->alias_name); map->event_name, map->alias_name);
j++; i++;
map = map->next; map = map->next;
} }
printf("Metricmap dumped %u maps\n", j); vt_cntl_msg(3, "Metricmap dumped %u maps", i);
} }
static void metricmap_free(metricmap_t* map) static void metricmap_free(metricmap_t* map)
{ {
if (map == NULL) { if (map == NULL)
/*printf("Can't free empty metricmap!\n");*/
return; return;
}
/*printf("Metricmap free (head=0x%p):\n", map);*/ vt_cntl_msg(3, "Metricmap free (head=0x%p):", map);
while (map != NULL) { while (map != NULL) {
metricmap_t* next = map->next; metricmap_t* next = map->next;
if (map->event_name != NULL) free(map->event_name); if (map->event_name != NULL) free(map->event_name);
@ -353,6 +349,7 @@ int vt_metric_open()
{ {
int retval; int retval;
char* env; char* env;
char* env_sep;
char* var; char* var;
char* token; char* token;
PAPI_event_info_t info; PAPI_event_info_t info;
@ -368,9 +365,11 @@ int vt_metric_open()
#endif #endif
} }
env_sep = vt_env_metrics_sep();
mapv = vt_metricmap_init( mapv = vt_metricmap_init(
(metmap_t)(METMAP_MEASURE|METMAP_AGGROUP)); (metmap_t)(METMAP_MEASURE|METMAP_AGGROUP));
/*metricmap_dump(mapv);*/ metricmap_dump(mapv);
/* initialize PAPI */ /* initialize PAPI */
retval = PAPI_library_init(PAPI_VER_CURRENT); retval = PAPI_library_init(PAPI_VER_CURRENT);
@ -385,7 +384,7 @@ int vt_metric_open()
vt_cntl_msg(2, "VT_METRICS=%s", var); vt_cntl_msg(2, "VT_METRICS=%s", var);
/* read metrics from specification string */ /* read metrics from specification string */
token = strtok(var, ":"); token = strtok(var, env_sep);
while ( token && (nmetrics < VT_METRIC_MAXNUM) ) { while ( token && (nmetrics < VT_METRIC_MAXNUM) ) {
/* search metricmap for a suitable definition */ /* search metricmap for a suitable definition */
metricmap_t* map = mapv; metricmap_t* map = mapv;
@ -447,7 +446,7 @@ int vt_metric_open()
metricv_add(component, code); metricv_add(component, code);
} }
token = strtok(NULL, ":"); token = strtok(NULL, env_sep);
} }
/*printf("nmetrics=%d\n", nmetrics);*/ /*printf("nmetrics=%d\n", nmetrics);*/
@ -617,7 +616,9 @@ uint32_t vt_metric_props(int i)
return OTF_COUNTER_TYPE_ACC; return OTF_COUNTER_TYPE_ACC;
} }
uint64_t vt_metric_clckrt() #if TIMER == TIMER_PAPI_REAL_CYC
uint64_t vt_metric_clckrt(void)
{ {
const PAPI_hw_info_t* hwinfo = NULL; const PAPI_hw_info_t* hwinfo = NULL;
double hertz; double hertz;
@ -639,12 +640,16 @@ uint64_t vt_metric_clckrt()
return (uint64_t)hertz; return (uint64_t)hertz;
} }
uint64_t vt_metric_real_cyc() uint64_t vt_metric_real_cyc(void)
{ {
return (uint64_t)PAPI_get_real_cyc(); return (uint64_t)PAPI_get_real_cyc();
} }
uint64_t vt_metric_real_usec() #elif TIMER == TIMER_PAPI_REAL_USEC
uint64_t vt_metric_real_usec(void)
{ {
return (uint64_t)PAPI_get_real_usec(); return (uint64_t)PAPI_get_real_usec();
} }
#endif /* TIMER */

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

@ -4094,12 +4094,12 @@ VT_MPI_INT MPI_Exscan( void* sendbuf,
vt_mpifile_data *fdata = vt_mpifile_get_data(fh); \ vt_mpifile_data *fdata = vt_mpifile_get_data(fh); \
if (result == MPI_SUCCESS) \ if (result == MPI_SUCCESS) \
{ \ { \
VT_MPI_INT sz, count; \ VT_MPI_INT sz, cnt; \
PMPI_Type_size(fdata->datatype, &sz); \ PMPI_Type_size(fdata->datatype, &sz); \
PMPI_Get_count(status, fdata->datatype, &count); \ PMPI_Get_count(status, fdata->datatype, &cnt); \
if (count == MPI_UNDEFINED) \ if (cnt == MPI_UNDEFINED) \
count = 0; \ cnt = 0; \
vt_ioend(&time, fdata->fid, fdata->split_collective_id, IOOP, (uint64_t)count * (uint64_t)sz); \ vt_ioend(&time, fdata->fid, fdata->split_collective_id, IOOP, (uint64_t)cnt * (uint64_t)sz); \
} \ } \
else \ else \
{ \ { \
@ -4120,12 +4120,12 @@ VT_MPI_INT MPI_Exscan( void* sendbuf,
uint32_t fid = vt_mpifile_get_id(fh); \ uint32_t fid = vt_mpifile_get_id(fh); \
if (result == MPI_SUCCESS) \ if (result == MPI_SUCCESS) \
{ \ { \
VT_MPI_INT sz, count; \ VT_MPI_INT sz, cnt; \
PMPI_Type_size(datatype, &sz); \ PMPI_Type_size(datatype, &sz); \
PMPI_Get_count(status, datatype, &count); \ PMPI_Get_count(status, datatype, &cnt); \
if (count == MPI_UNDEFINED) \ if (cnt == MPI_UNDEFINED) \
count = 0; \ cnt = 0; \
vt_ioend(&time, fid, handleid, IOOP, (uint64_t)count * (uint64_t)sz); \ vt_ioend(&time, fid, handleid, IOOP, (uint64_t)cnt * (uint64_t)sz); \
} \ } \
else \ else \
{ \ { \

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

@ -1242,6 +1242,7 @@ void VTGen_delete(VTGen* gen)
{ {
char* tmp_namev[5]; char* tmp_namev[5];
char* global_name; char* global_name;
uint32_t global_name_len;
char* suffix; char* suffix;
char* gdir = vt_env_gdir(); char* gdir = vt_env_gdir();
@ -1284,17 +1285,18 @@ void VTGen_delete(VTGen* gen)
suffix = strchr(tmp_namev[i]+strlen(gen->fileprefix)+1, '.'); suffix = strchr(tmp_namev[i]+strlen(gen->fileprefix)+1, '.');
/* build global file name */ /* build global file name */
global_name = (char*)calloc(strlen(gdir) + global_name_len = strlen(gdir) + strlen(fprefix) + 32;
strlen(fprefix) + 32, sizeof(char)); global_name = (char*)calloc(global_name_len+1, sizeof(char));
if (vt_my_funique > 0) if (vt_my_funique > 0)
{ {
sprintf(global_name, "%s/%s_%u.%x%s", snprintf(global_name, global_name_len, "%s/%s_%u.%x%s",
gdir, fprefix, vt_my_funique, 65536*gen->tid+(vt_my_trace+1), gdir, fprefix, vt_my_funique, 65536*gen->tid+(vt_my_trace+1),
suffix); suffix);
} }
else else
{ {
sprintf(global_name, "%s/%s.%x%s", snprintf(global_name, global_name_len, "%s/%s.%x%s",
gdir, fprefix, 65536*gen->tid+(vt_my_trace+1), suffix); gdir, fprefix, 65536*gen->tid+(vt_my_trace+1), suffix);
} }

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

@ -1283,7 +1283,7 @@ static uint32_t vt_get_unique_file_id()
VT_SUSPEND_IO_TRACING(); VT_SUSPEND_IO_TRACING();
/* create filename for unique id file */ /* create filename for unique id file */
sprintf(lock_filename, "%s/%s.lock", vt_env_gdir(), vt_env_fprefix()); snprintf(lock_filename, sizeof(lock_filename)-1, "%s/%s.lock", vt_env_gdir(), vt_env_fprefix());
/* open/create unique id file */ /* open/create unique id file */
if( (fd = open(lock_filename, (O_RDWR | O_CREAT), if( (fd = open(lock_filename, (O_RDWR | O_CREAT),
@ -1299,9 +1299,12 @@ static uint32_t vt_get_unique_file_id()
} }
/* read current unique id */ /* read current unique id */
if( read(fd, tmp, 16) == -1 ) if( read(fd, tmp, 15) == -1 )
vt_error_msg("Cannot read file %s: %s", lock_filename, strerror(errno)); vt_error_msg("Cannot read file %s: %s", lock_filename, strerror(errno));
/* terminate buffer to avoid issues in upcoming functions */
tmp[15] = '\0';
if( tmp[0] == '\0' ) if( tmp[0] == '\0' )
new_fuid = 0; /* set unique id to 0, if file is empty */ new_fuid = 0; /* set unique id to 0, if file is empty */
else else
@ -1343,16 +1346,19 @@ static void vt_write_def_header()
/* VT_MODE */ /* VT_MODE */
tmp_int32 = vt_env_mode(); tmp_int32 = vt_env_mode();
strcpy(tmp_char, ""); tmp_char[0] = '\0';
if( (tmp_int32 & VT_MODE_TRACE) != 0 ) if( (tmp_int32 & VT_MODE_TRACE) != 0 )
strcpy(tmp_char, "TRACE"); {
strncpy(tmp_char, "TRACE", sizeof(tmp_char)-1);
tmp_char[sizeof(tmp_char)-1] = '\0';
}
if( (tmp_int32 & VT_MODE_STAT) != 0 ) if( (tmp_int32 & VT_MODE_STAT) != 0 )
{ {
if( strlen(tmp_char) > 0 ) if( strlen(tmp_char) > 0 )
strcat(tmp_char, ":"); strncat(tmp_char, ":", sizeof(tmp_char)-1-strlen(tmp_char));
strcat(tmp_char, "STAT"); strncat(tmp_char, "STAT", sizeof(tmp_char)-1-strlen(tmp_char));
} }
vt_def_comment("__VT_COMMENT__ VT_MODE: %s", tmp_char); vt_def_comment("__VT_COMMENT__ VT_MODE: %s", tmp_char);
@ -1363,16 +1369,16 @@ static void vt_write_def_header()
if( tmp_uint64 >= (1024*1024*1024) ) if( tmp_uint64 >= (1024*1024*1024) )
{ {
tmp_uint64 /= (1024*1024*1024); tmp_uint64 /= (1024*1024*1024);
sprintf(tmp_char, "%"U64STR"G", tmp_uint64); snprintf(tmp_char, sizeof(tmp_char)-1, "%"U64STR"G", tmp_uint64);
} }
else if( tmp_uint64 >= (1024*1024) ) else if( tmp_uint64 >= (1024*1024) )
{ {
tmp_uint64 /= (1024*1024); tmp_uint64 /= (1024*1024);
sprintf(tmp_char, "%"U64STR"M", tmp_uint64); snprintf(tmp_char, sizeof(tmp_char)-1, "%"U64STR"M", tmp_uint64);
} }
else else
{ {
sprintf(tmp_char, "%"U64STR, tmp_uint64); snprintf(tmp_char, sizeof(tmp_char)-1, "%"U64STR, tmp_uint64);
} }
vt_def_comment("__VT_COMMENT__ VT_BUFFER_SIZE: %s", tmp_char); vt_def_comment("__VT_COMMENT__ VT_BUFFER_SIZE: %s", tmp_char);