Changes to VT:
- Use own implementation of assert() to work around a compiler bug (seen on MacOS using GCC v4.2.1): The linker results in an undefined reference to ___builtin_expect() when using assert() within OpenMP-parallel regions. This commit was SVN r25595.
Этот коммит содержится в:
родитель
989d75bfec
Коммит
b3f4fca3f4
@ -1,4 +1,5 @@
|
||||
5.12.1openmpi
|
||||
- fixed build issues on MacOS using GCC v4.2
|
||||
- fixed a bug in the MPI wrapper functions MPI_Gatherv and MPI_Scatterv
|
||||
which occurred due to illegal access to insignificant parameters on
|
||||
non-root ranks
|
||||
|
@ -4,6 +4,13 @@
|
||||
|
||||
#include "util/util.h"
|
||||
|
||||
/* use own implementation of assert() to work around a compiler bug
|
||||
(seen on MacOS using GCC v4.2.1):
|
||||
The linker results in an undefined reference to ___builtin_expect()
|
||||
when using assert() within OpenMP-parallel regions. */
|
||||
#undef assert
|
||||
#define assert vt_assert
|
||||
|
||||
#if !(defined(HAVE_ASPRINTF) && HAVE_ASPRINTF)
|
||||
# undef asprintf
|
||||
# define asprintf vt_asprintf
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "vt_dyn.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "vt_filthandler.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -15,8 +15,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// Define this macro to avoid writing of events which have relationships to
|
||||
// disabled processes.
|
||||
// For example: Do not write a send message event where its receive process is
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//////////////////// class HooksAsyncEventsC ////////////////////
|
||||
|
||||
// class's instance object to allow access from static member methods
|
||||
|
@ -14,8 +14,6 @@
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//////////////////// class HooksBaseC ////////////////////
|
||||
|
||||
// public methods
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_HOOKS_BASE_H_
|
||||
#define _VT_UNIFY_HOOKS_BASE_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify_hooks.h"
|
||||
|
||||
//
|
||||
|
@ -13,8 +13,6 @@
|
||||
#include "vt_unify.h"
|
||||
#include "vt_unify_hooks_margins.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//////////////////// class HooksProcessMarginsC ////////////////////
|
||||
|
||||
// public methods
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//////////////////// class HooksMsgMatchC ////////////////////
|
||||
|
||||
// public methods
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include "mpi.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAX_TYPES 50
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_MPI_H_
|
||||
#define _VT_UNIFY_MPI_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_defs.h" /* to get VT_MPI_INT */
|
||||
|
||||
/* use MPI's profile interface for the library version of the unifier */
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(HAVE_OMP) && HAVE_OMP
|
||||
# ifdef VT_LIB
|
||||
# undef HAVE_OMP
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_DEFS_H_
|
||||
#define _VT_UNIFY_DEFS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify_defs_recs.h"
|
||||
#include "vt_unify_lvector.hh"
|
||||
#include "vt_unify_usrcom.h"
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_DEFS_RECS_H_
|
||||
#define _VT_UNIFY_DEFS_RECS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify.h"
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_ESYNC_H_
|
||||
#define _VT_UNIFY_ESYNC_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include <list>
|
||||
@ -20,8 +22,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//
|
||||
// ETimeSyncC class
|
||||
//
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// instances of class EventsAndStatsC
|
||||
//
|
||||
EventsAndStatsC * theEvents = 0;
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_EVENTS_STATS_H_
|
||||
#define _VT_UNIFY_EVENTS_STATS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
//
|
||||
// EventsAndStatsC class
|
||||
//
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
#include "otf.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
void
|
||||
HandleKeyValueList( const uint32_t & proc, OTF_KeyValueList * kvs )
|
||||
{
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_HANDLERS_H_
|
||||
#define _VT_UNIFY_HANDLERS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify_defs_recs.h"
|
||||
#include "vt_unify_lvector.hh"
|
||||
#include "vt_unify_markers.h"
|
||||
|
@ -13,12 +13,12 @@
|
||||
#ifndef _VT_UNIFY_HOOKS_H_
|
||||
#define _VT_UNIFY_HOOKS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// generic hooks' identifier bits
|
||||
//
|
||||
enum
|
||||
|
@ -13,9 +13,9 @@
|
||||
#ifndef _VT_UNIFY_LVECTOR_HH_
|
||||
#define _VT_UNIFY_LVECTOR_HH_
|
||||
|
||||
#include <vector>
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
|
||||
//
|
||||
// LargeVectorC class
|
||||
|
@ -20,8 +20,6 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
MarkersC * theMarkers = 0; // instance of class MarkersC
|
||||
|
||||
//////////////////// class MarkersC ////////////////////
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_MARKERS_H_
|
||||
#define _VT_UNIFY_MARKERS_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include "vt_unify.h"
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_SYNC_H_
|
||||
#define _VT_UNIFY_SYNC_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify.h"
|
||||
|
||||
#ifdef VT_ETIMESYNC
|
||||
@ -23,8 +25,6 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
//
|
||||
// TimeSyncC class
|
||||
//
|
||||
|
@ -13,8 +13,6 @@
|
||||
#include "vt_unify.h"
|
||||
#include "vt_unify_tkfac.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
TokenFactoryC * theTokenFactory = 0; // instance of class TokenFactoryC
|
||||
|
||||
//////////////////// class TokenFactoryC ////////////////////
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_TKFAC_H_
|
||||
#define _VT_UNIFY_TKFAC_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify_defs_recs.h"
|
||||
#include "vt_unify_tkfac_scope.h"
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_TKFAC_SCOPE_H_
|
||||
#define _VT_UNIFY_TKFAC_SCOPE_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_unify.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -13,8 +13,6 @@
|
||||
#include "vt_unify.h"
|
||||
#include "vt_unify_usrcom.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
UserComC * theUserCom = 0; // instance of class UserComC
|
||||
|
||||
//////////////////// class UserComC ////////////////////
|
||||
|
@ -13,6 +13,8 @@
|
||||
#ifndef _VT_UNIFY_USRCOM_H_
|
||||
#define _VT_UNIFY_USRCOM_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include <map>
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "vt_inttypes.h"
|
||||
|
||||
#include "util/installdirs.h"
|
||||
#include "util/util.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@ -21,7 +22,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -1316,7 +1316,7 @@ doWrap()
|
||||
//
|
||||
std::string cpp_file = src_file;
|
||||
si = cpp_file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
cpp_file.insert( si, ".cpp" );
|
||||
|
||||
files_to_remove.push_back( cpp_file );
|
||||
@ -1350,7 +1350,7 @@ doWrap()
|
||||
|
||||
std::string pomp_file = src_file;
|
||||
si = pomp_file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
pomp_file.insert( si, ".pomp" );
|
||||
|
||||
// convert Fortran source file suffix to upper case, in order to
|
||||
@ -1401,7 +1401,7 @@ doWrap()
|
||||
if( si != std::string::npos )
|
||||
pdb_file = src_file.substr( si+1 );
|
||||
si = pdb_file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
pdb_file.replace( si, 4, ".pdb" );
|
||||
|
||||
files_to_remove.push_back( pdb_file );
|
||||
@ -1411,7 +1411,7 @@ doWrap()
|
||||
|
||||
std::string tau_file = src_file;
|
||||
si = tau_file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
tau_file.insert( si, ".tau" );
|
||||
|
||||
// convert Fortran source file suffix to upper case, in order to
|
||||
@ -1481,7 +1481,7 @@ doWrap()
|
||||
obj_file = src_file.substr( si+1 );
|
||||
|
||||
si = obj_file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
obj_file = obj_file.substr( 0, si ) + ".o";
|
||||
|
||||
obj_files_to_rename[obj_file] = Config.mod_files[i].second;
|
||||
@ -2068,14 +2068,14 @@ ConfigS::setCompilerCmd( const std::string& cmd )
|
||||
void
|
||||
ConfigS::addCompilerArg( const std::string& arg )
|
||||
{
|
||||
assert( arg.length() > 0 );
|
||||
vt_assert( arg.length() > 0 );
|
||||
addOrSetStringList( Config.comp_args, arg );
|
||||
}
|
||||
|
||||
void
|
||||
ConfigS::addCompilerLib( const std::string& lib )
|
||||
{
|
||||
assert( lib.length() > 0 );
|
||||
vt_assert( lib.length() > 0 );
|
||||
addOrSetStringList( Config.comp_libs, lib );
|
||||
}
|
||||
|
||||
@ -2096,7 +2096,7 @@ ConfigS::addModSrcFile( const std::string& file )
|
||||
// create object file name of source file
|
||||
//
|
||||
si = file_base.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
file_obj = file_base.substr( 0, si ) + ".o";
|
||||
|
||||
// store source/object file name for later processing by OPARI and/or TAU
|
||||
@ -2106,7 +2106,7 @@ ConfigS::addModSrcFile( const std::string& file )
|
||||
//
|
||||
|
||||
si = file.rfind( '.' );
|
||||
assert( si != std::string::npos );
|
||||
vt_assert( si != std::string::npos );
|
||||
|
||||
std::string base = file.substr( 0, si );
|
||||
std::string suffix = file.substr( si );
|
||||
@ -2160,28 +2160,28 @@ ConfigS::setOpariRcFile( const std::string& file )
|
||||
void
|
||||
ConfigS::addOpariArg( const std::string& arg )
|
||||
{
|
||||
assert( arg.length() > 0 );
|
||||
vt_assert( arg.length() > 0 );
|
||||
addOrSetStringList( Config.opari_args, arg, arg[0] == '!' );
|
||||
}
|
||||
|
||||
void
|
||||
ConfigS::addTauinstArg( const std::string& arg )
|
||||
{
|
||||
assert( arg.length() > 0 );
|
||||
vt_assert( arg.length() > 0 );
|
||||
addOrSetStringList( Config.tauinst_args, arg, arg[0] == '!' );
|
||||
}
|
||||
|
||||
void
|
||||
ConfigS::addTauinstParseArg( const std::string& arg )
|
||||
{
|
||||
assert( arg.length() > 0 );
|
||||
vt_assert( arg.length() > 0 );
|
||||
addOrSetStringList( Config.tauinst_parseargs, arg, arg[0] == '!' );
|
||||
}
|
||||
|
||||
void
|
||||
ConfigS::addPrepFlag( const std::string& flag )
|
||||
{
|
||||
assert( flag.length() > 0 );
|
||||
vt_assert( flag.length() > 0 );
|
||||
addOrSetStringList( Config.prep_flags, flag, flag[0] == '!' );
|
||||
}
|
||||
|
||||
@ -2281,7 +2281,7 @@ ConfigS::setInstAvail( const std::string& type )
|
||||
bool
|
||||
ConfigS::setInstType( const InstTypeT type )
|
||||
{
|
||||
assert( inst_avail != 0 );
|
||||
vt_assert( inst_avail != 0 );
|
||||
|
||||
// instrumentation available ?
|
||||
if( !isInstAvail( type ) )
|
||||
|
@ -172,6 +172,12 @@ static int guess_strlen(const char* fmt, va_list ap)
|
||||
}
|
||||
|
||||
|
||||
void vt_assert_fail(const char* file, int line, const char* expr)
|
||||
{
|
||||
printf("%s:%u: failed assertion `%s'\n", file, line, expr);
|
||||
abort();
|
||||
}
|
||||
|
||||
int vt_asprintf(char** ptr, const char* fmt, ...)
|
||||
{
|
||||
int length;
|
||||
|
@ -35,6 +35,9 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define vt_assert(expr) if(!(expr)) vt_assert_fail(__FILE__, __LINE__, #expr);
|
||||
|
||||
EXTERN void vt_assert_fail(const char* file, int line, const char* expr);
|
||||
EXTERN int vt_asprintf(char** ptr, const char* fmt, ...);
|
||||
EXTERN int vt_snprintf(char* str, size_t size, const char* fmt, ...);
|
||||
EXTERN int vt_vasprintf(char** ptr, const char* fmt, va_list ap);
|
||||
|
@ -119,7 +119,7 @@ static void register_region(struct profile_gen_struct* d, uint8_t rtype)
|
||||
strncpy(stname, "do_while", 8+1);
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void VT_Dyn_start(uint32_t index, char* name, char* fname, int lno)
|
||||
uint64_t time;
|
||||
uint32_t* rid;
|
||||
|
||||
vt_assert(index < VT_MAX_DYNINST_REGIONS);
|
||||
vt_libassert(index < VT_MAX_DYNINST_REGIONS);
|
||||
|
||||
/* Ignore events if VT is initializing */
|
||||
if( !dyn_init && !vt_is_alive ) return;
|
||||
@ -128,7 +128,7 @@ void VT_Dyn_end(uint32_t index)
|
||||
{
|
||||
uint64_t time;
|
||||
|
||||
vt_assert(index < VT_MAX_DYNINST_REGIONS);
|
||||
vt_libassert(index < VT_MAX_DYNINST_REGIONS);
|
||||
|
||||
/* If VampirTrace already finalized, return */
|
||||
if ( !vt_is_alive ) return;
|
||||
|
@ -50,7 +50,7 @@ static void vt_print_msg(const char* prefix, const char* fmt, va_list az)
|
||||
fflush(NULL);
|
||||
}
|
||||
|
||||
void vt_assert_impl(const char* f, int l, const char* expr)
|
||||
void vt_libassert_fail(const char* f, int l, const char* expr)
|
||||
{
|
||||
vt_iowrap_externals_init();
|
||||
libc_fprintf(stderr, "%s: FATAL: %s:%d: Assertion `%s' failed\n\nPlease report this incident to " PACKAGE_BUGREPORT "\n",
|
||||
|
@ -24,8 +24,9 @@
|
||||
/* set process id/rank for messages */
|
||||
EXTERN void vt_error_pid(const int pid);
|
||||
|
||||
#define vt_assert(expr) if(!(expr)) vt_assert_impl(__FILE__, __LINE__, #expr);
|
||||
EXTERN void vt_assert_impl(const char* f, int l, const char* expr);
|
||||
/* abort if assertion is false */
|
||||
#define vt_libassert(expr) if(!(expr)) vt_libassert_fail(__FILE__, __LINE__, #expr);
|
||||
EXTERN void vt_libassert_fail(const char* f, int l, const char* expr);
|
||||
|
||||
/* abort and system error message */
|
||||
#define vt_error() vt_error_impl(__FILE__, __LINE__)
|
||||
|
@ -305,7 +305,7 @@ void vt_esync_app_uctl_data(char** data)
|
||||
size_t size;
|
||||
uint32_t i;
|
||||
|
||||
vt_assert(*data != NULL);
|
||||
vt_libassert(*data != NULL);
|
||||
|
||||
size = strlen(*data);
|
||||
|
||||
|
@ -77,25 +77,25 @@ VT_DECLDEF(void vt_get_mpi_f_statuses_ignore_cb_f(void* addr1, void* addr2)) {
|
||||
void vt_fmpiconst_init()
|
||||
{
|
||||
vt_get_mpi_f_bottom___();
|
||||
vt_assert(vt_mpi_f_bottom_addr != NULL);
|
||||
vt_libassert(vt_mpi_f_bottom_addr != NULL);
|
||||
vt_cntl_msg(2, "Detected address of MPI_BOTTOM=%x",
|
||||
vt_mpi_f_bottom_addr);
|
||||
#if (defined(HAVE_DECL_MPI_IN_PLACE) && HAVE_DECL_MPI_IN_PLACE)
|
||||
vt_get_mpi_f_in_place___();
|
||||
vt_assert(vt_mpi_f_in_place_addr != NULL);
|
||||
vt_libassert(vt_mpi_f_in_place_addr != NULL);
|
||||
vt_cntl_msg(2, "Detected address of MPI_IN_PLACE=%x",
|
||||
vt_mpi_f_in_place_addr);
|
||||
#endif /* HAVE_DECL_MPI_IN_PLACE */
|
||||
vt_get_mpi_f_statuses_ignore___();
|
||||
vt_assert(vt_mpi_f_status_ignore_addr != NULL);
|
||||
vt_libassert(vt_mpi_f_status_ignore_addr != NULL);
|
||||
vt_cntl_msg(2, "Detected address of MPI_F_STATUS_IGNORE=%x",
|
||||
vt_mpi_f_status_ignore_addr);
|
||||
vt_assert(vt_mpi_f_statuses_ignore_addr != NULL);
|
||||
vt_libassert(vt_mpi_f_statuses_ignore_addr != NULL);
|
||||
vt_cntl_msg(2, "Detected address of MPI_F_STATUSES_IGNORE=%x",
|
||||
vt_mpi_f_statuses_ignore_addr);
|
||||
#if !(defined(HAVE_DECL_MPI_STATUS_SIZE) && HAVE_DECL_MPI_STATUS_SIZE)
|
||||
vt_get_mpi_status_size___(&vt_mpi_status_size);
|
||||
vt_assert(vt_mpi_status_size > 0);
|
||||
vt_libassert(vt_mpi_status_size > 0);
|
||||
vt_cntl_msg(2, "Detected value of MPI_STATUS_SIZE=%d",
|
||||
vt_mpi_status_size);
|
||||
#endif /* HAVE_DECL_MPI_STATUS_SIZE */
|
||||
|
@ -58,7 +58,7 @@ static int get_new_trcid()
|
||||
char tmp[10] = "";
|
||||
uint8_t do_unlock = 1;
|
||||
|
||||
vt_assert(trcid_filename[0] != '\0');
|
||||
vt_libassert(trcid_filename[0] != '\0');
|
||||
|
||||
VT_SUSPEND_IO_TRACING(VT_CURRENT_THREAD);
|
||||
|
||||
@ -131,7 +131,7 @@ void vt_fork_finalize()
|
||||
|
||||
void vt_fork(pid_t pid)
|
||||
{
|
||||
vt_assert(pid != -1);
|
||||
vt_libassert(pid != -1);
|
||||
|
||||
fork_performed = 1;
|
||||
|
||||
@ -195,7 +195,7 @@ uint32_t vt_fork_get_num_childs_tot()
|
||||
int fd;
|
||||
char tmp[16] = "";
|
||||
|
||||
vt_assert(trcid_filename[0] != '\0');
|
||||
vt_libassert(trcid_filename[0] != '\0');
|
||||
|
||||
VT_SUSPEND_IO_TRACING(VT_CURRENT_THREAD);
|
||||
|
||||
@ -207,9 +207,9 @@ uint32_t vt_fork_get_num_childs_tot()
|
||||
if ( read(fd, tmp, 16) == -1 )
|
||||
vt_error_msg("Cannot read file %s: %s", trcid_filename, strerror(errno));
|
||||
|
||||
vt_assert(tmp[0] != '\0');
|
||||
vt_libassert(tmp[0] != '\0');
|
||||
nchilds_tot = atoi(tmp);
|
||||
vt_assert(nchilds_tot > 0);
|
||||
vt_libassert(nchilds_tot > 0);
|
||||
|
||||
/* close temp. id file */
|
||||
close(fd);
|
||||
@ -228,7 +228,7 @@ char* vt_fork_get_trcid_filename()
|
||||
{
|
||||
char* filename;
|
||||
|
||||
vt_assert(trcid_filename[0] != '\0');
|
||||
vt_libassert(trcid_filename[0] != '\0');
|
||||
|
||||
filename = strdup(trcid_filename);
|
||||
if ( filename == NULL )
|
||||
|
@ -26,7 +26,7 @@ uint32_t vt_getcpu_cid = 0;
|
||||
|
||||
void vt_getcpu_init()
|
||||
{
|
||||
vt_assert(vt_misc_cgid != 0);
|
||||
vt_libassert(vt_misc_cgid != 0);
|
||||
|
||||
/* write counter definition */
|
||||
vt_getcpu_cid = vt_def_counter(VT_CURRENT_THREAD, "CPU_ID", "#",
|
||||
|
@ -38,7 +38,7 @@ static void store_vampir_file_id(int fd, uint32_t file_id,
|
||||
{
|
||||
vampir_file_t *file_ptr;
|
||||
|
||||
vt_assert( (fd < max_open_files) && (fd >= 0) );
|
||||
vt_libassert( (fd < max_open_files) && (fd >= 0) );
|
||||
file_ptr = &fd_to_vampirid[fd];
|
||||
file_ptr->vampir_file_id = file_id;
|
||||
file_ptr->vampir_file_group_id = file_group_id;
|
||||
@ -49,7 +49,7 @@ vampir_file_t *get_vampir_file(int fd)
|
||||
{
|
||||
vampir_file_t *file_ptr;
|
||||
|
||||
vt_assert( (fd < max_open_files) && (fd >= 0) );
|
||||
vt_libassert( (fd < max_open_files) && (fd >= 0) );
|
||||
file_ptr = &fd_to_vampirid[fd];
|
||||
if( file_ptr->vampir_file_id == 0 ) {
|
||||
return &unknown_fd_vampir_file;
|
||||
@ -77,7 +77,7 @@ void vt_iofile_open(const char* fname, int fd)
|
||||
uint32_t gid;
|
||||
|
||||
/* fprintf( stderr, "opening file: %s\n", fname); */
|
||||
vt_assert( (fd < max_open_files) && (fd >= 0) );
|
||||
vt_libassert( (fd < max_open_files) && (fd >= 0) );
|
||||
gid=(fd<3) ? file_group_id_stdio : file_group_id_rest;
|
||||
#if defined (VT_MT) || defined (VT_HYB) || defined (VT_JAVA)
|
||||
VTTHRD_LOCK_IDS();
|
||||
@ -92,7 +92,7 @@ void vt_iofile_open(const char* fname, int fd)
|
||||
/** Mark the fd as closed */
|
||||
void vt_iofile_close(int fd)
|
||||
{
|
||||
vt_assert( (fd < max_open_files) && (fd >= 0) );
|
||||
vt_libassert( (fd < max_open_files) && (fd >= 0) );
|
||||
fd_to_vampirid[fd].vampir_file_id = 0;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ uint32_t vt_iofile_id(const char* fname)
|
||||
|
||||
void vt_iofile_dupfd(int oldfd, int newfd)
|
||||
{
|
||||
vt_assert( (newfd < max_open_files) && (newfd >=0) &&
|
||||
vt_libassert( (newfd < max_open_files) && (newfd >=0) &&
|
||||
(oldfd < max_open_files) && (oldfd >=0) );
|
||||
fd_to_vampirid[newfd] = fd_to_vampirid[oldfd];
|
||||
fd_to_vampirid[newfd].handle = VTTHRD_IO_NEXT_HANDLE(VTTHRD_MY_VTTHRD);
|
||||
|
@ -823,7 +823,7 @@ void vt_java_get_thread_name(jvmtiEnv* jvmti, jthread thread,
|
||||
jvmtiError error;
|
||||
|
||||
if ( jvmti == NULL ) jvmti = vt_jvmti_agent->jvmti;
|
||||
vt_assert(jvmti != NULL);
|
||||
vt_libassert(jvmti != NULL);
|
||||
|
||||
/* initialize thread name */
|
||||
strcpy(tname, "Unknown");
|
||||
@ -851,7 +851,7 @@ void vt_java_get_thread_name(jvmtiEnv* jvmti, jthread thread,
|
||||
void vt_java_check_error(jvmtiEnv* jvmti, jvmtiError error, const char* str)
|
||||
{
|
||||
if ( jvmti == NULL ) jvmti = vt_jvmti_agent->jvmti;
|
||||
vt_assert(jvmti != NULL);
|
||||
vt_libassert(jvmti != NULL);
|
||||
|
||||
if ( error != JVMTI_ERROR_NONE )
|
||||
{
|
||||
|
@ -199,7 +199,7 @@ void VTLibwrap_delete(VTLibwrap** lw)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
vt_assert(*lw);
|
||||
vt_libassert(*lw);
|
||||
|
||||
/* close all opened handles */
|
||||
for( i = 0; i < (*lw)->handlen; i++ )
|
||||
@ -236,7 +236,7 @@ void VTLibwrap_func_init(const VTLibwrap* lw, const char* func,
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
vt_assert(lw);
|
||||
vt_libassert(lw);
|
||||
|
||||
VT_MEMHOOKS_OFF();
|
||||
|
||||
@ -334,13 +334,13 @@ void VTLibwrap_func_start(const VTLibwrap* lw, const int funcid)
|
||||
{
|
||||
uint64_t time;
|
||||
|
||||
vt_assert(lw);
|
||||
vt_libassert(lw);
|
||||
|
||||
if( !vt_is_alive ) return;
|
||||
|
||||
VT_MEMHOOKS_OFF();
|
||||
|
||||
vt_assert(funcid != VT_LIBWRAP_NOID);
|
||||
vt_libassert(funcid != VT_LIBWRAP_NOID);
|
||||
|
||||
time = vt_pform_wtime();
|
||||
|
||||
@ -353,13 +353,13 @@ void VTLibwrap_func_end(const VTLibwrap* lw, const int funcid)
|
||||
{
|
||||
uint64_t time;
|
||||
|
||||
vt_assert(lw);
|
||||
vt_libassert(lw);
|
||||
|
||||
if( !vt_is_alive ) return;
|
||||
|
||||
VT_MEMHOOKS_OFF();
|
||||
|
||||
vt_assert(funcid != VT_LIBWRAP_NOID);
|
||||
vt_libassert(funcid != VT_LIBWRAP_NOID);
|
||||
|
||||
time = vt_pform_wtime();
|
||||
|
||||
|
@ -48,7 +48,7 @@ void vt_mpi_register()
|
||||
|
||||
void vt_mpi_register_remain()
|
||||
{
|
||||
vt_assert( mpi_fid != (uint32_t)-1 );
|
||||
vt_libassert( mpi_fid != (uint32_t)-1 );
|
||||
|
||||
/* include generated function registry */
|
||||
# include "vt_mpireg.gen.c"
|
||||
|
@ -475,7 +475,7 @@ void VTGen_flush(VTGen* gen, uint8_t lastFlush,
|
||||
ctype = OTF_COLLECTIVE_TYPE_ONE2ALL;
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
if (OTF_WStream_writeDefCollectiveOperation(gen->filestream, entry->cid,
|
||||
@ -594,7 +594,7 @@ void VTGen_flush(VTGen* gen, uint8_t lastFlush,
|
||||
mtype = OTF_MARKER_TYPE_HINT;
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
if (OTF_WStream_writeDefMarker(gen->filestream, entry->mid,
|
||||
@ -634,7 +634,7 @@ void VTGen_flush(VTGen* gen, uint8_t lastFlush,
|
||||
vtype = OTF_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
if (OTF_WStream_writeDefKeyValue(gen->filestream, entry->kid, vtype,
|
||||
@ -792,7 +792,7 @@ void VTGen_flush(VTGen* gen, uint8_t lastFlush,
|
||||
kvpair.value.otf_double = entry->kvalue.d;
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
if (OTF_WBuffer_writeKeyValuePair_short( filestream_buffer,
|
||||
@ -985,7 +985,7 @@ void VTGen_flush(VTGen* gen, uint8_t lastFlush,
|
||||
}
|
||||
default:
|
||||
{
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1135,25 +1135,25 @@ void VTGen_delete(VTGen* gen)
|
||||
OTF_getFilename(gen->fileprefix, gen->tid+1,
|
||||
OTF_FILETYPE_DEF | gen->filecomp,
|
||||
0, NULL);
|
||||
vt_assert(tmp_namev[0]);
|
||||
vt_libassert(tmp_namev[0]);
|
||||
|
||||
tmp_namev[1] =
|
||||
OTF_getFilename(gen->fileprefix, gen->tid+1,
|
||||
OTF_FILETYPE_EVENT | gen->filecomp,
|
||||
0, NULL);
|
||||
vt_assert(tmp_namev[1]);
|
||||
vt_libassert(tmp_namev[1]);
|
||||
|
||||
tmp_namev[2] =
|
||||
OTF_getFilename(gen->fileprefix, gen->tid+1,
|
||||
OTF_FILETYPE_STATS | gen->filecomp,
|
||||
0, NULL);
|
||||
vt_assert(tmp_namev[2]);
|
||||
vt_libassert(tmp_namev[2]);
|
||||
|
||||
tmp_namev[3] =
|
||||
OTF_getFilename(gen->fileprefix, gen->tid+1,
|
||||
OTF_FILETYPE_MARKER | gen->filecomp,
|
||||
0, NULL);
|
||||
vt_assert(tmp_namev[3]);
|
||||
vt_libassert(tmp_namev[3]);
|
||||
|
||||
tmp_namev[4] = NULL;
|
||||
|
||||
@ -1965,7 +1965,7 @@ void VTGen_write_KEYVAL(VTGen* gen, uint32_t kid, uint8_t vtype, void* kvalue)
|
||||
VTGEN_ALIGN_LENGTH(sizeof(VTBuf_Entry_KeyValue));
|
||||
|
||||
/* No VTGEN_ALLOC_EVENT since space must be guaranteed */
|
||||
vt_assert( (uint64_t)((gen)->buf->pos - (gen)->buf->mem) <=
|
||||
vt_libassert( (uint64_t)((gen)->buf->pos - (gen)->buf->mem) <=
|
||||
(uint64_t)((gen)->buf->size - length) );
|
||||
|
||||
new_entry = ((VTBuf_Entry_KeyValue*)gen->buf->pos);
|
||||
@ -1999,7 +1999,7 @@ void VTGen_write_KEYVAL(VTGen* gen, uint32_t kid, uint8_t vtype, void* kvalue)
|
||||
new_entry->kvalue.d = *((double*)kvalue);
|
||||
break;
|
||||
default:
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
VTGEN_JUMP(gen, length);
|
||||
|
@ -697,13 +697,13 @@ void vt_plugin_cntr_finalize(uint32_t tnum) {
|
||||
|
||||
static void maybe_register_new_thread(VTThrd * thrd, uint32_t tid) {
|
||||
struct vt_plugin_cntr_defines * plugin_cntr_defines;
|
||||
vt_assert(thrd!=NULL);
|
||||
vt_libassert(thrd!=NULL);
|
||||
/* "register" a thread */
|
||||
if (thrd->plugin_cntr_defines == NULL) {
|
||||
uint32_t i;
|
||||
thrd->plugin_cntr_defines
|
||||
= calloc(1, sizeof(struct vt_plugin_cntr_defines));
|
||||
vt_assert(thrd->plugin_cntr_defines!=NULL);
|
||||
vt_libassert(thrd->plugin_cntr_defines!=NULL);
|
||||
plugin_cntr_defines
|
||||
= (struct vt_plugin_cntr_defines *) thrd->plugin_cntr_defines;
|
||||
plugin_cntr_defines->counters = calloc(VT_PLUGIN_CNTR_SYNCH_TYPE_MAX,
|
||||
@ -829,7 +829,7 @@ static void add_events(struct vt_plugin current_plugin, VTThrd * thrd) {
|
||||
|
||||
uint32_t vt_plugin_cntr_get_num_synch_metrics(VTThrd * thrd) {
|
||||
uint32_t num = 0;
|
||||
vt_assert(thrd != NULL);
|
||||
vt_libassert(thrd != NULL);
|
||||
if (thrd->plugin_cntr_defines == NULL)
|
||||
return 0;
|
||||
num = ((struct vt_plugin_cntr_defines *)(thrd->plugin_cntr_defines))
|
||||
|
@ -124,7 +124,7 @@ uint32_t VTThrd_getThreadId()
|
||||
if (tid == NULL && vt_jvmti_agent->vm_is_dead)
|
||||
return 0;
|
||||
else
|
||||
vt_assert(tid != NULL);
|
||||
vt_libassert(tid != NULL);
|
||||
|
||||
return *tid;
|
||||
}
|
||||
@ -133,7 +133,7 @@ void VTThrd_createMutex(VTThrdMutex** mutex)
|
||||
{
|
||||
jvmtiError error;
|
||||
|
||||
vt_assert(mutexInitMutex != NULL);
|
||||
vt_libassert(mutexInitMutex != NULL);
|
||||
|
||||
error = (*jvmti)->RawMonitorEnter(jvmti, mutexInitMutex);
|
||||
vt_java_check_error(jvmti, error, "RawMonitorEnter");
|
||||
@ -190,7 +190,7 @@ void VTThrd_unlock(VTThrdMutex** mutex)
|
||||
{
|
||||
jvmtiError error;
|
||||
|
||||
vt_assert(*mutex != NULL);
|
||||
vt_libassert(*mutex != NULL);
|
||||
|
||||
error = (*jvmti)->RawMonitorExit(jvmti, (*mutex)->m);
|
||||
vt_java_check_error(jvmti, error, "RawMonitorExit");
|
||||
|
@ -66,7 +66,7 @@ uint8_t VTThrd_isAlive()
|
||||
|
||||
uint32_t VTThrd_getThreadId()
|
||||
{
|
||||
vt_assert(threadId != VT_NO_ID);
|
||||
vt_libassert(threadId != VT_NO_ID);
|
||||
return threadId;
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ void VTThrd_lock(VTThrdMutex** mutex)
|
||||
|
||||
void VTThrd_unlock(VTThrdMutex** mutex)
|
||||
{
|
||||
vt_assert(*mutex != NULL);
|
||||
vt_libassert(*mutex != NULL);
|
||||
|
||||
omp_unset_lock(&((*mutex)->m));
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ static uint8_t masterThreadTerminated = 0;
|
||||
|
||||
static uint32_t idle_tid_list_size(uint32_t ptid)
|
||||
{
|
||||
vt_assert(ptid < VTThrdMaxNum);
|
||||
vt_libassert(ptid < VTThrdMaxNum);
|
||||
return idleThreadIds[ptid].size;
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ static void idle_tid_list_push_back(uint32_t ptid, uint32_t tid)
|
||||
{
|
||||
IdleThreadIdListEntryT* idle_tid;
|
||||
|
||||
vt_assert(ptid < VTThrdMaxNum);
|
||||
vt_libassert(ptid < VTThrdMaxNum);
|
||||
|
||||
/* create new list entry */
|
||||
idle_tid = (IdleThreadIdListEntryT*)calloc(1,
|
||||
@ -98,8 +98,8 @@ static uint32_t idle_tid_list_pop_front(uint32_t ptid)
|
||||
uint32_t tid;
|
||||
IdleThreadIdListEntryT* tmp;
|
||||
|
||||
vt_assert(ptid < VTThrdMaxNum);
|
||||
vt_assert(idleThreadIds[ptid].size > 0);
|
||||
vt_libassert(ptid < VTThrdMaxNum);
|
||||
vt_libassert(idleThreadIds[ptid].size > 0);
|
||||
|
||||
/* get thread-ID from the first list entry */
|
||||
tid = idleThreadIds[ptid].first->tid;
|
||||
@ -289,7 +289,7 @@ uint32_t VTThrd_getThreadId()
|
||||
if (tid == NULL && masterThreadTerminated)
|
||||
return 0;
|
||||
else
|
||||
vt_assert(tid != NULL);
|
||||
vt_libassert(tid != NULL);
|
||||
|
||||
return *tid;
|
||||
}
|
||||
@ -331,7 +331,7 @@ void VTThrd_lock(VTThrdMutex** mutex)
|
||||
|
||||
void VTThrd_unlock(VTThrdMutex** mutex)
|
||||
{
|
||||
vt_assert(*mutex != NULL);
|
||||
vt_libassert(*mutex != NULL);
|
||||
|
||||
pthread_mutex_unlock(&((*mutex)->m));
|
||||
}
|
||||
|
@ -2196,7 +2196,7 @@ uint32_t vt_def_region(uint32_t tid, const char* rname, uint32_t fid,
|
||||
#if !defined(VT_DISABLE_RFG)
|
||||
/* get region's filter/group information */
|
||||
rinf = RFG_Regions_add(VTTHRD_RFGREGIONS(VTThrdv[0]), rname, rid);
|
||||
vt_assert(rinf != NULL);
|
||||
vt_libassert(rinf != NULL);
|
||||
|
||||
/* get region's group name, if specified by VT_GROUPS_SPEC */
|
||||
if ( rinf->groupName != NULL )
|
||||
@ -2558,7 +2558,7 @@ uint8_t vt_enter(uint32_t tid, uint64_t* time, uint32_t rid)
|
||||
#if (defined(VT_MT) || defined(VT_HYB) || defined(VT_JAVA))
|
||||
VTTHRD_UNLOCK_IDS();
|
||||
#endif /* VT_MT || VT_HYB || V_JAVA */
|
||||
vt_assert(rinf_master != NULL);
|
||||
vt_libassert(rinf_master != NULL);
|
||||
|
||||
rinf = RFG_Regions_add(VTTHRD_RFGREGIONS(VTThrdv[tid]),
|
||||
rinf_master->regionName, rid);
|
||||
@ -2571,9 +2571,9 @@ uint8_t vt_enter(uint32_t tid, uint64_t* time, uint32_t rid)
|
||||
|
||||
if (!RFG_Regions_stackPush(VTTHRD_RFGREGIONS(VTThrdv[tid]),
|
||||
rid, do_trace, &rinf))
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
# else /* VT_MT || VT_HYB || VT_JAVA || VT_GPU */
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
# endif /* VT_MT || VT_HYB || VT_JAVA || VT_GPU */
|
||||
}
|
||||
|
||||
@ -2633,7 +2633,7 @@ void vt_exit(uint32_t tid, uint64_t* time)
|
||||
if (!RFG_Regions_stackPop(VTTHRD_RFGREGIONS(VTThrdv[tid]),
|
||||
&rinf, &climitbyenter))
|
||||
{
|
||||
vt_assert(0);
|
||||
vt_libassert(0);
|
||||
}
|
||||
|
||||
if (climitbyenter == 0)
|
||||
|
@ -66,12 +66,12 @@ void vt_unimci_check_msg(uint8_t record, uint64_t* time)
|
||||
|
||||
/* get first message */
|
||||
UNIMCI_pop_msg( &msg );
|
||||
vt_assert( msg );
|
||||
vt_libassert( msg );
|
||||
|
||||
/* record marker, if allowed */
|
||||
if( record )
|
||||
{
|
||||
vt_assert( time );
|
||||
vt_libassert( time );
|
||||
|
||||
/* check for message type */
|
||||
switch( msg->msgType )
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user