1
1
- always check the result of OTF_WStream_get*Buffer since it might be NULL in case OTF_File_open fails

Changes to VT:
	- CUDA Tracing:
		- fixed configure stack for filtered kernels
		- fixed buffer size for CUPTI tracing
		- replaced error message with warning to continue tracing, even if CUDA error occured (VTCUDAsynchronizeEvt)
	- vtunify:
		- enlarged minimum message size for transfering local definitions to rank 0
		- use binary search for searching already created global definitions
		- use binary search for searching already created global marker definitions
		- use LargeVectorC instead of std::vector for pre-allocating elements
	- vtwrapper:
		- added options '-vt:CC' and '-vt:c++' which are synonyms for '-vt:cxx'

This commit was SVN r24997.
Этот коммит содержится в:
Matthias Jurenz 2011-08-05 12:46:26 +00:00
родитель d1a0c4428f
Коммит 1b402ecb1a
13 изменённых файлов: 1003 добавлений и 565 удалений

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

@ -4,6 +4,7 @@
- process and thread buffer size can be explicitly specified by the user
via the environment variables VT_BUFFER_SIZE and VT_THREAD_BUFFER_SIZE
- improved filtering of CUDA kernels
- enhanced creating global definitions in vtunify
- fixed CUDA kernel launch configuration
- fixed unification of local process group definitions
- fixed wrapper generation for MPI implementations which don't support

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

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

@ -395,14 +395,14 @@ DefinitionsC::readLocal( const std::vector<uint32_t> & streamIds )
const VT_MPI_INT msg_tag = 100;
// minimum message size
const VT_MPI_INT min_msg_size = 1024 * 1024;
const VT_MPI_INT min_msg_size = 100 * 1024 * 1024;
#endif // VT_MPI
// read local definitions of each given stream
//
// vector of local definitions
std::vector<DefRec_BaseS*> loc_defs;
LargeVectorC<DefRec_BaseS*> loc_defs;
for( uint32_t i = 0; i < streamIds.size(); i++ )
{
@ -825,7 +825,7 @@ DefinitionsC::readLocal( const std::vector<uint32_t> & streamIds )
bool
DefinitionsC::readLocal( const uint32_t & streamId,
std::vector<DefRec_BaseS*> & locDefs )
LargeVectorC<DefRec_BaseS*> & locDefs )
{
bool error = false;
@ -1022,7 +1022,7 @@ DefinitionsC::readLocal( const uint32_t & streamId,
}
bool
DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
DefinitionsC::processLocal( const LargeVectorC<DefRec_BaseS*> & locDefs )
{
bool error = false;
@ -1034,7 +1034,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
{
case DEF_REC_TYPE__DefComment:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefCommentS * loc_def_entry =
static_cast<DefRec_DefCommentS*>( locDefs[i] );
@ -1045,7 +1045,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefCreator:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefCreatorS * loc_def_entry =
static_cast<DefRec_DefCreatorS*>( locDefs[i] );
@ -1062,7 +1062,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefTimerResolution:
{
// get reference to local definitions entry
// get local definitions entry
const DefRec_DefTimerResolutionS * loc_def_entry =
static_cast<DefRec_DefTimerResolutionS*>( locDefs[i] );
@ -1079,7 +1079,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefTimeRange:
{
// get reference to local definitions entry
// get local definitions entry
const DefRec_DefTimeRangeS * loc_def_entry =
static_cast<DefRec_DefTimeRangeS*>( locDefs[i] );
@ -1091,7 +1091,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefProcess:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefProcessS * loc_def_entry =
static_cast<DefRec_DefProcessS*>( locDefs[i] );
@ -1103,7 +1103,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefProcessGroup:
{
// get reference to local definition entry
// get local definition entry
DefRec_DefProcessGroupS * loc_def_entry =
static_cast<DefRec_DefProcessGroupS*>( locDefs[i] );
@ -1114,7 +1114,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefSclFile:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefSclFileS * loc_def_entry =
static_cast<DefRec_DefSclFileS*>( locDefs[i] );
@ -1129,7 +1129,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefScl:
{
// get reference to local definition entry
// get local definition entry
DefRec_DefSclS * loc_def_entry =
static_cast<DefRec_DefSclS*>( locDefs[i] );
@ -1156,7 +1156,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefFileGroup:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefFileGroupS * loc_def_entry =
static_cast<DefRec_DefFileGroupS*>( locDefs[i] );
@ -1171,7 +1171,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefFile:
{
// get reference to local definition entry
// get local definition entry
DefRec_DefFileS * loc_def_entry =
static_cast<DefRec_DefFileS*>( locDefs[i] );
@ -1198,7 +1198,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefFunctionGroup:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefFunctionGroupS * loc_def_entry =
static_cast<DefRec_DefFunctionGroupS*>( locDefs[i] );
@ -1213,7 +1213,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefFunction:
{
// get reference to local definition entry
// get local definition entry
DefRec_DefFunctionS * loc_def_entry =
static_cast<DefRec_DefFunctionS*>( locDefs[i] );
@ -1255,7 +1255,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefCollOp:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefCollOpS * loc_def_entry =
static_cast<DefRec_DefCollOpS*>( locDefs[i] );
@ -1270,7 +1270,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefCounterGroup:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefCounterGroupS * loc_def_entry =
static_cast<DefRec_DefCounterGroupS*>( locDefs[i] );
@ -1285,7 +1285,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefCounter:
{
// get reference to local definition entry
// get local definition entry
DefRec_DefCounterS * loc_def_entry =
static_cast<DefRec_DefCounterS*>( locDefs[i] );
@ -1312,7 +1312,7 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
}
case DEF_REC_TYPE__DefKeyValue:
{
// get reference to local definition entry
// get local definition entry
const DefRec_DefKeyValueS * loc_def_entry =
static_cast<DefRec_DefKeyValueS*>( locDefs[i] );
@ -1335,6 +1335,18 @@ DefinitionsC::processLocal( const std::vector<DefRec_BaseS*> & locDefs )
return !error;
}
// function for resorting global definitions based on T::SortS
template <class T>
static void resort_glob_defs( const std::set<T> & in,
std::set<const T*, typename T::SortS> & out )
{
for( typename std::set<T>::const_iterator it =
in.begin(); it != in.end(); it++ )
{
out.insert( &(*it) );
}
}
bool
DefinitionsC::writeGlobal()
{
@ -1438,16 +1450,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefComment:
{
// resort definition comments
//
typedef
std::set<const DefRec_DefCommentS*, DefRec_DefCommentS::SortS>
resorted_comments_t;
resorted_comments_t resorted_comments;
resort_glob_defs<DefRec_DefCommentS>(
m_globDefs.comments, resorted_comments );
// iterate over all definition comments
for( std::set<DefRec_DefCommentS>::const_iterator it =
m_globDefs.comments.begin();
it != m_globDefs.comments.end() && !error; it++ )
for( resorted_comments_t::const_iterator it =
resorted_comments.begin(); it != resorted_comments.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefCommentS record = *it;
DefRec_DefCommentS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook(
@ -1464,16 +1488,27 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefProcess:
{
// resort process definitions
//
typedef
std::set<const DefRec_DefProcessS*, DefRec_DefProcessS::SortS>
resorted_procs_t;
resorted_procs_t resorted_procs;
resort_glob_defs<DefRec_DefProcessS>(
m_globDefs.procs, resorted_procs );
// iterate over all process definitions
for( std::set<DefRec_DefProcessS>::const_iterator it =
m_globDefs.procs.begin();
it != m_globDefs.procs.end() && !error; it++ )
for( resorted_procs_t::const_iterator it =
resorted_procs.begin(); it != resorted_procs.end(); it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefProcessS record = *it;
DefRec_DefProcessS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefProcess,
@ -1491,16 +1526,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefProcessGroup:
{
// resort process group definitions
//
typedef
std::set<const DefRec_DefProcessGroupS*, DefRec_DefProcessGroupS::SortS>
resorted_proc_grps_t;
resorted_proc_grps_t resorted_proc_grps;
resort_glob_defs<DefRec_DefProcessGroupS>(
m_globDefs.procGrps, resorted_proc_grps );
// iterate over all process group definitions
for( std::set<DefRec_DefProcessGroupS>::const_iterator it =
m_globDefs.procGrps.begin();
it != m_globDefs.procGrps.end() && !error; it++ )
for( resorted_proc_grps_t::const_iterator it =
resorted_proc_grps.begin(); it != resorted_proc_grps.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefProcessGroupS record = *it;
DefRec_DefProcessGroupS record = **it;
// inflate group members
m_procGrps->inflateMembers( record.members );
@ -1535,16 +1582,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefSclFile:
{
// resort scl file definitions
//
typedef
std::set<const DefRec_DefSclFileS*, DefRec_DefSclFileS::SortS>
resorted_scl_files_t;
resorted_scl_files_t resorted_scl_files;
resort_glob_defs<DefRec_DefSclFileS>(
m_globDefs.sclFiles, resorted_scl_files );
// iterate over all scl file definitions
for( std::set<DefRec_DefSclFileS>::const_iterator it =
m_globDefs.sclFiles.begin();
it != m_globDefs.sclFiles.end() && !error; it++ )
for( resorted_scl_files_t::const_iterator it =
resorted_scl_files.begin(); it != resorted_scl_files.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefSclFileS record = *it;
DefRec_DefSclFileS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefSclFile,
@ -1562,16 +1621,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefScl:
{
// resort scl definitions
//
typedef
std::set<const DefRec_DefSclS*, DefRec_DefSclS::SortS>
resorted_scls_t;
resorted_scls_t resorted_scls;
resort_glob_defs<DefRec_DefSclS>(
m_globDefs.scls, resorted_scls );
// iterate over all scl definitions
for( std::set<DefRec_DefSclS>::const_iterator it =
m_globDefs.scls.begin();
it != m_globDefs.scls.end() && !error; it++ )
for( resorted_scls_t::const_iterator it =
resorted_scls.begin(); it != resorted_scls.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefSclS record = *it;
DefRec_DefSclS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefScl, 5,
@ -1589,16 +1660,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefFileGroup:
{
// resort file group definitions
//
typedef
std::set<const DefRec_DefFileGroupS*, DefRec_DefFileGroupS::SortS>
resorted_file_grps_t;
resorted_file_grps_t resorted_file_grps;
resort_glob_defs<DefRec_DefFileGroupS>(
m_globDefs.fileGrps, resorted_file_grps );
// iterate over all file group definitions
for( std::set<DefRec_DefFileGroupS>::const_iterator it =
m_globDefs.fileGrps.begin();
it != m_globDefs.fileGrps.end() && !error; it++ )
for( resorted_file_grps_t::const_iterator it =
resorted_file_grps.begin(); it != resorted_file_grps.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefFileGroupS record = *it;
DefRec_DefFileGroupS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefFileGroup,
@ -1615,16 +1698,27 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefFile:
{
// resort file definitions
//
typedef
std::set<const DefRec_DefFileS*, DefRec_DefFileS::SortS>
resorted_files_t;
resorted_files_t resorted_files;
resort_glob_defs<DefRec_DefFileS>(
m_globDefs.files, resorted_files );
// iterate over all file definitions
for( std::set<DefRec_DefFileS>::const_iterator it =
m_globDefs.files.begin();
it != m_globDefs.files.end() && !error; it++ )
for( resorted_files_t::const_iterator it =
resorted_files.begin(); it != resorted_files.end(); it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefFileS record = *it;
DefRec_DefFileS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefFile, 5,
@ -1642,16 +1736,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefFunctionGroup:
{
// resort function group definitions
//
typedef
std::set<const DefRec_DefFunctionGroupS*, DefRec_DefFunctionGroupS::SortS>
resorted_func_grps_t;
resorted_func_grps_t resorted_func_grps;
resort_glob_defs<DefRec_DefFunctionGroupS>(
m_globDefs.funcGrps, resorted_func_grps );
// iterate over all function group definitions
for( std::set<DefRec_DefFunctionGroupS>::const_iterator
it = m_globDefs.funcGrps.begin();
it != m_globDefs.funcGrps.end() && !error; it++ )
for( resorted_func_grps_t::const_iterator it =
resorted_func_grps.begin(); it != resorted_func_grps.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefFunctionGroupS record = *it;
DefRec_DefFunctionGroupS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook(
@ -1668,16 +1774,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefFunction:
{
// resort function definitions
//
typedef
std::set<const DefRec_DefFunctionS*, DefRec_DefFunctionS::SortS>
resorted_funcs_t;
resorted_funcs_t resorted_funcs;
resort_glob_defs<DefRec_DefFunctionS>(
m_globDefs.funcs, resorted_funcs );
// iterate over all function definitions
for( std::set<DefRec_DefFunctionS>::const_iterator it =
m_globDefs.funcs.begin();
it != m_globDefs.funcs.end() && !error; it++ )
for( resorted_funcs_t::const_iterator it =
resorted_funcs.begin(); it != resorted_funcs.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefFunctionS record = *it;
DefRec_DefFunctionS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefFunction,
@ -1695,16 +1813,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefCollOp:
{
// resort collop. definitions
//
typedef
std::set<const DefRec_DefCollOpS*, DefRec_DefCollOpS::SortS>
resorted_collops_t;
resorted_collops_t resorted_collops;
resort_glob_defs<DefRec_DefCollOpS>(
m_globDefs.collops, resorted_collops );
// iterate over all collop. definitions
for( std::set<DefRec_DefCollOpS>::const_iterator
it = m_globDefs.collops.begin();
it != m_globDefs.collops.end() && !error; it++ )
for( resorted_collops_t::const_iterator it =
resorted_collops.begin(); it != resorted_collops.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefCollOpS record = *it;
DefRec_DefCollOpS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefCollOp, 5,
@ -1722,16 +1852,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefCounterGroup:
{
// resort counter group definitions
//
typedef
std::set<const DefRec_DefCounterGroupS*, DefRec_DefCounterGroupS::SortS>
resorted_cntr_grps_t;
resorted_cntr_grps_t resorted_cntr_grps;
resort_glob_defs<DefRec_DefCounterGroupS>(
m_globDefs.cntrGrps, resorted_cntr_grps );
// iterate over all counter group definitions
for( std::set<DefRec_DefCounterGroupS>::const_iterator
it = m_globDefs.cntrGrps.begin();
it != m_globDefs.cntrGrps.end() && !error; it++ )
for( resorted_cntr_grps_t::const_iterator it =
resorted_cntr_grps.begin(); it != resorted_cntr_grps.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefCounterGroupS record = *it;
DefRec_DefCounterGroupS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook(
@ -1748,16 +1890,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefCounter:
{
// resort counter definitions
//
typedef
std::set<const DefRec_DefCounterS*, DefRec_DefCounterS::SortS>
resorted_cntrs_t;
resorted_cntrs_t resorted_cntrs;
resort_glob_defs<DefRec_DefCounterS>(
m_globDefs.cntrs, resorted_cntrs );
// iterate over all counter definitions
for( std::set<DefRec_DefCounterS>::const_iterator it =
m_globDefs.cntrs.begin();
it != m_globDefs.cntrs.end() && !error; it++ )
for( resorted_cntrs_t::const_iterator it =
resorted_cntrs.begin(); it != resorted_cntrs.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefCounterS record = *it;
DefRec_DefCounterS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefCounter,
@ -1777,16 +1931,28 @@ DefinitionsC::writeGlobal()
}
case DEF_REC_TYPE__DefKeyValue:
{
// iterate over all function definitions
for( std::set<DefRec_DefKeyValueS>::const_iterator it =
m_globDefs.keyVals.begin();
it != m_globDefs.keyVals.end() && !error; it++ )
// resort key-value definitions
//
typedef
std::set<const DefRec_DefKeyValueS*, DefRec_DefKeyValueS::SortS>
resorted_keyvals_t;
resorted_keyvals_t resorted_keyvals;
resort_glob_defs<DefRec_DefKeyValueS>(
m_globDefs.keyVals, resorted_keyvals );
// iterate over all key-value definitions
for( resorted_keyvals_t::const_iterator it =
resorted_keyvals.begin(); it != resorted_keyvals.end();
it++ )
{
bool do_write = true;
// get copy of definition record in order that hook(s) can
// modify it
DefRec_DefKeyValueS record = *it;
DefRec_DefKeyValueS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefKeyValue,
@ -1940,8 +2106,7 @@ DefinitionsC::CommentsC::processLocal(
// search for already created global definition comment
std::set<DefRec_DefCommentS>::const_iterator it =
std::find( glob_comments.begin(), glob_comments.end(),
new_comment );
glob_comments.find( new_comment );
// add global definition comment to set, if not found
if( it == glob_comments.end() )

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

@ -14,6 +14,7 @@
#define _VT_UNIFY_DEFS_H_
#include "vt_unify_defs_recs.h"
#include "vt_unify_lvector.hh"
#include "vt_unify_usrcom.h"
#include "vt_inttypes.h"
@ -341,11 +342,11 @@ private:
// read local definitions of certain single stream
bool readLocal( const uint32_t & streamId,
std::vector<DefRec_BaseS*> & locDefs );
LargeVectorC<DefRec_BaseS*> & locDefs );
// process local definitions
// (i.e. create global tokens)
bool processLocal( const std::vector<DefRec_BaseS*> & locDefs );
bool processLocal( const LargeVectorC<DefRec_BaseS*> & locDefs );
// write global definitions
bool writeGlobal();

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

@ -52,6 +52,18 @@ typedef enum
//
struct DefRec_BaseS
{
//
// compare structure for final sort
//
struct SortS
{
bool operator()( const DefRec_BaseS * a, const DefRec_BaseS * b ) const
{
return a->deftoken < b->deftoken;
}
};
DefRec_BaseS( DefRecTypeT _dtype )
: dtype( _dtype ), loccpuid( 0 ), deftoken( 0 ) {}
DefRec_BaseS( const DefRecTypeT & _dtype, const uint32_t & _loccpuid,
@ -67,11 +79,6 @@ struct DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator<( const DefRec_BaseS & a ) const
{
return deftoken < a.deftoken;
}
DefRecTypeT dtype;
uint32_t loccpuid;
uint32_t deftoken;
@ -83,6 +90,22 @@ struct DefRec_BaseS
//
struct DefRec_DefCommentS : DefRec_BaseS
{
//
// compare structure for final sort
//
struct SortS
{
bool operator()( const DefRec_DefCommentS * a,
const DefRec_DefCommentS * b ) const
{
if( a->type == b->type )
return a->deftoken < b->deftoken; // order index
else
return a->type < b->type;
}
};
typedef enum
{
TYPE_START_TIME, TYPE_STOP_TIME, TYPE_VT, TYPE_USER,
@ -104,16 +127,11 @@ struct DefRec_DefCommentS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefCommentS & a ) const
{
return ( type == a.type &&
comment.compare( a.comment ) == 0 );
}
// operator for searching
bool operator<( const DefRec_DefCommentS & a ) const
{
if( type == a.type )
return deftoken < a.deftoken; // order index
return comment < a.comment;
else
return type < a.type;
}
@ -201,6 +219,24 @@ struct DefRec_DefTimeRangeS : DefRec_BaseS
//
struct DefRec_DefProcessS : DefRec_BaseS
{
//
// compare structure for final sort
//
struct SortS
{
bool operator()( const DefRec_DefProcessS * a,
const DefRec_DefProcessS * b ) const
{
if( ( a->deftoken & VT_TRACEID_BITMASK ) ==
( b->deftoken & VT_TRACEID_BITMASK ) )
return a->deftoken < b->deftoken;
else
return ( a->deftoken & VT_TRACEID_BITMASK ) <
( b->deftoken & VT_TRACEID_BITMASK );
}
};
DefRec_DefProcessS()
: DefRec_BaseS( DEF_REC_TYPE__DefProcess ),
parent( 0 ) {}
@ -217,14 +253,13 @@ struct DefRec_DefProcessS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
// operator for searching
bool operator<( const DefRec_DefProcessS & a ) const
{
if( ( deftoken & VT_TRACEID_BITMASK ) ==
( a.deftoken & VT_TRACEID_BITMASK ) )
return deftoken < a.deftoken;
if( parent == a.parent )
return name < a.name;
else
return ( deftoken & VT_TRACEID_BITMASK ) <
( a.deftoken & VT_TRACEID_BITMASK );
return parent < a.parent;
}
std::string name;
@ -237,6 +272,22 @@ struct DefRec_DefProcessS : DefRec_BaseS
//
struct DefRec_DefProcessGroupS : DefRec_BaseS
{
//
// compare structure for final sort
//
struct SortS
{
bool operator()( const DefRec_DefProcessGroupS * a,
const DefRec_DefProcessGroupS * b ) const
{
if( a->type == b->type )
return a->deftoken < b->deftoken;
else
return a->type < b->type;
}
};
typedef enum
{
TYPE_NODE, TYPE_MPI_COMM_WORLD, TYPE_MPI_COMM_SELF, TYPE_MPI_COMM_OTHER,
@ -273,19 +324,24 @@ struct DefRec_DefProcessGroupS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefProcessGroupS & a ) const
{
return ( type == a.type &&
members == a.members &&
name.compare( a.name ) == 0 );
}
// operator for searching
bool operator<( const DefRec_DefProcessGroupS & a ) const
{
if( type == a.type )
return deftoken < a.deftoken;
{
if( members == a.members )
{
return name < a.name;
}
else
{
return members < a.members;
}
}
else
{
return type < a.type;
}
}
ProcessGroupTypeT type;
@ -314,9 +370,10 @@ struct DefRec_DefSclFileS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefSclFileS & a ) const
// operator for searching
bool operator<( const DefRec_DefSclFileS & a ) const
{
return filename.compare( a.filename ) == 0;
return filename < a.filename;
}
std::string filename;
@ -344,10 +401,13 @@ struct DefRec_DefSclS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefSclS & a ) const
// operator for searching
bool operator<( const DefRec_DefSclS & a ) const
{
return ( sclfile == a.sclfile &&
sclline == a.sclline );
if( sclfile == a.sclfile )
return sclline < a.sclline;
else
return sclfile < a.sclfile;
}
uint32_t sclfile;
@ -375,9 +435,10 @@ struct DefRec_DefFileGroupS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefFileGroupS & a ) const
// operator for searching
bool operator<( const DefRec_DefFileGroupS & a ) const
{
return name.compare( a.name ) == 0;
return name < a.name;
}
std::string name;
@ -405,10 +466,13 @@ struct DefRec_DefFileS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefFileS & a ) const
// operator for searching
bool operator<( const DefRec_DefFileS & a ) const
{
return ( group == a.group &&
name.compare( a.name ) == 0 );
if( group == a.group )
return name < a.name;
else
return group < a.group;
}
std::string name;
@ -436,9 +500,10 @@ struct DefRec_DefFunctionGroupS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefFunctionGroupS & a ) const
// operator for searching
bool operator<( const DefRec_DefFunctionGroupS & a ) const
{
return name.compare( a.name ) == 0;
return name < a.name;
}
std::string name;
@ -467,11 +532,24 @@ struct DefRec_DefFunctionS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefFunctionS & a ) const
// operator for searching
bool operator<( const DefRec_DefFunctionS & a ) const
{
return ( group == a.group &&
scltoken == a.scltoken &&
name.compare( a.name ) == 0 );
if( group == a.group )
{
if( scltoken == a.scltoken )
{
return name < a.name;
}
else
{
return scltoken < a.scltoken;
}
}
else
{
return group < a.group;
}
}
std::string name;
@ -501,10 +579,13 @@ struct DefRec_DefCollOpS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefCollOpS & a ) const
// operator for searching
bool operator<( const DefRec_DefCollOpS & a ) const
{
return ( type == a.type &&
name.compare( a.name ) == 0 );
if( type == a.type )
return name < a.name;
else
return type < a.type;
}
std::string name;
@ -532,9 +613,10 @@ struct DefRec_DefCounterGroupS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefCounterGroupS & a ) const
// operator for searching
bool operator<( const DefRec_DefCounterGroupS & a ) const
{
return name.compare( a.name ) == 0;
return name < a.name;
}
std::string name;
@ -564,12 +646,31 @@ struct DefRec_DefCounterS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefCounterS & a ) const
// operator for searching
bool operator<( const DefRec_DefCounterS & a ) const
{
return ( properties == a.properties &&
group == a.group &&
name.compare( a.name ) == 0 &&
unit.compare( a.unit ) == 0 );
if( properties == a.properties )
{
if( group == a.group )
{
if( name == a.name )
{
return unit < a.unit;
}
else
{
return name < a.name;
}
}
else
{
return group < a.group;
}
}
else
{
return properties < a.properties;
}
}
std::string name;
@ -600,10 +701,13 @@ struct DefRec_DefKeyValueS : DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefKeyValueS & a ) const
// operator for searching
bool operator<( const DefRec_DefKeyValueS & a ) const
{
return ( type == a.type &&
name.compare( a.name ) == 0 );
if( type == a.type )
return name < a.name;
else
return type < a.type;
}
OTF_Type type;
@ -616,6 +720,22 @@ struct DefRec_DefKeyValueS : DefRec_BaseS
//
struct DefRec_DefMarkerS: DefRec_BaseS
{
//
// compare structure for final sort
//
struct SortS
{
bool operator()( const DefRec_DefMarkerS * a,
const DefRec_DefMarkerS * b ) const
{
if( a->type == b->type )
return a->deftoken < b->deftoken;
else
return a->type < b->type;
}
};
DefRec_DefMarkerS()
: DefRec_BaseS( DEF_REC_TYPE__DefMarker ),
type( 0 ) {}
@ -632,16 +752,11 @@ struct DefRec_DefMarkerS: DefRec_BaseS
VT_MPI_INT & bufferPos );
#endif // VT_MPI
bool operator==( const DefRec_DefMarkerS & a ) const
{
return ( type == a.type &&
name.compare( a.name ) == 0 );
}
// operator for searching
bool operator<( const DefRec_DefMarkerS & a ) const
{
if( type == a.type )
return deftoken < a.deftoken;
return name < a.name;
else
return type < a.type;
}

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

@ -58,7 +58,7 @@ Handle_KeyValueList( const uint32_t & proc, OTF_KeyValueList * kvs )
//
int
Handle_DefComment( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefComment( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, const char * comment )
{
// get common string identifiers as std::string's for more convenient use
@ -148,7 +148,7 @@ Handle_DefComment( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefCreator( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefCreator( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, const char * creator )
{
std::string _creator(creator);
@ -164,7 +164,7 @@ Handle_DefCreator( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefTimerResolution( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefTimerResolution( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint64_t ticksPerSecond )
{
// trigger read record hook
@ -178,7 +178,7 @@ Handle_DefTimerResolution( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefTimeRange( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefTimeRange( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint64_t minTime, uint64_t maxTime )
{
// trigger read record hook
@ -193,7 +193,7 @@ Handle_DefTimeRange( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefProcess( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefProcess( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t parent )
{
std::string _name(name);
@ -209,7 +209,7 @@ Handle_DefProcess( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefProcessGroup( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefProcessGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t n,
uint32_t * array )
{
@ -302,7 +302,7 @@ Handle_DefProcessGroup( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefSclFile( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefSclFile( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * filename )
{
std::string _filename(filename);
@ -319,7 +319,7 @@ Handle_DefSclFile( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefScl( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefScl( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, uint32_t sclfile, uint32_t sclline )
{
// trigger read record hook
@ -334,7 +334,7 @@ Handle_DefScl( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefFileGroup( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefFileGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name )
{
std::string _name(name);
@ -351,7 +351,7 @@ Handle_DefFileGroup( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefFile( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefFile( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t group )
{
std::string _name(name);
@ -368,7 +368,7 @@ Handle_DefFile( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefFunctionGroup( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefFunctionGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name )
{
std::string _name(name);
@ -385,7 +385,7 @@ Handle_DefFunctionGroup( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefFunction( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefFunction( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t group,
uint32_t scltoken )
{
@ -404,7 +404,7 @@ Handle_DefFunction( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefCollOp( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefCollOp( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t collOp, const char * name, uint32_t type )
{
std::string _name(name);
@ -421,7 +421,7 @@ Handle_DefCollOp( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefCounterGroup( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefCounterGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name )
{
std::string _name(name);
@ -438,7 +438,7 @@ Handle_DefCounterGroup( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefCounter( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefCounter( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t properties,
uint32_t countergroup, const char * unit )
{
@ -458,7 +458,7 @@ Handle_DefCounter( std::vector<DefRec_BaseS*> * locDefs,
}
int
Handle_DefKeyValue( std::vector<DefRec_BaseS*> * locDefs,
Handle_DefKeyValue( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t key, OTF_Type type, const char * name,
const char * description )
{
@ -479,7 +479,7 @@ Handle_DefKeyValue( std::vector<DefRec_BaseS*> * locDefs,
//
int
Handle_DefMarker( std::vector<DefRec_DefMarkerS*> * locDefs,
Handle_DefMarker( LargeVectorC<DefRec_DefMarkerS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name,
uint32_t type )
{
@ -497,7 +497,7 @@ Handle_DefMarker( std::vector<DefRec_DefMarkerS*> * locDefs,
}
int
Handle_MarkerSpot( std::vector<MarkersC::MarkerSpotS*> * locSpots,
Handle_MarkerSpot( LargeVectorC<MarkersC::MarkerSpotS*> * locSpots,
uint64_t time, uint32_t proc, uint32_t marker,
const char * text )
{

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

@ -14,6 +14,7 @@
#define _VT_UNIFY_HANDLERS_H_
#include "vt_unify_defs_recs.h"
#include "vt_unify_lvector.hh"
#include "vt_unify_markers.h"
#include "otf.h"
@ -25,68 +26,68 @@ void Handle_KeyValueList( const uint32_t & proc, OTF_KeyValueList * kvs );
// definition record handlers
//
int Handle_DefComment( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefComment( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, const char * comment );
int Handle_DefCreator( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefCreator( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, const char * creator );
int Handle_DefTimerResolution( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefTimerResolution( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint64_t ticksPerSecond );
int Handle_DefTimeRange( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefTimeRange( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint64_t minTime, uint64_t maxTime );
int Handle_DefProcess( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefProcess( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name,
uint32_t parent );
int Handle_DefProcessGroup( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefProcessGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name,
uint32_t n, uint32_t * array );
int Handle_DefSclFile( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefSclFile( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * filename );
int Handle_DefScl( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefScl( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, uint32_t sclfile,
uint32_t sclline );
int Handle_DefFileGroup( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefFileGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name );
int Handle_DefFile( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefFile( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name,
uint32_t group );
int Handle_DefFunctionGroup( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefFunctionGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name );
int Handle_DefFunction( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefFunction( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t group,
uint32_t scltoken );
int Handle_DefCollOp( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefCollOp( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t collOp, const char * name, uint32_t type );
int Handle_DefCounterGroup( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefCounterGroup( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name );
int Handle_DefCounter( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefCounter( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name,
uint32_t properties, uint32_t countergroup, const char * unit );
int Handle_DefKeyValue( std::vector<DefRec_BaseS*> * locDefs,
int Handle_DefKeyValue( LargeVectorC<DefRec_BaseS*> * locDefs,
uint32_t streamid, uint32_t key, OTF_Type type, const char * name,
const char * description );
// marker record handlers
//
int Handle_DefMarker( std::vector<DefRec_DefMarkerS*> * locDefs,
int Handle_DefMarker( LargeVectorC<DefRec_DefMarkerS*> * locDefs,
uint32_t streamid, uint32_t deftoken, const char * name, uint32_t type );
int Handle_MarkerSpot( std::vector<MarkersC::MarkerSpotS*> * locSpots,
int Handle_MarkerSpot( LargeVectorC<MarkersC::MarkerSpotS*> * locSpots,
uint64_t time, uint32_t proc, uint32_t marker, const char * text );
// event record handlers

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

@ -26,6 +26,8 @@ class LargeVectorC
public:
typedef typename std::allocator<T>::size_type size_type;
typedef typename std::vector<T>::iterator iterator;
typedef typename std::vector<T>::const_iterator const_iterator;
// default chunk size (num. of elements to pre-allocate)
static const size_type DEFAULT_CHUNK_SIZE = 100000;
@ -69,6 +71,21 @@ public:
m_size = 0;
}
// get iterator to the first element
typename std::vector<T>::iterator begin()
{
return m_vector.begin();
}
// get iterator to the element following the last element
typename std::vector<T>::iterator end()
{
if( m_size == 0 )
return m_vector.end();
else
return m_vector.begin() + m_size;
}
// access the first element
T & front()
{
@ -101,6 +118,13 @@ public:
return m_vector[pos];
}
// get reference to element at specific location (const version)
const T & operator[]( size_type pos ) const
{
assert( pos < m_size );
return m_vector[pos];
}
private:
// actual vector

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

@ -194,10 +194,10 @@ MarkersC::readLocal()
VPrint( 2, " Reading local markers\n" );
// vector of local marker definitions
std::vector<DefRec_DefMarkerS*> loc_defs;
LargeVectorC<DefRec_DefMarkerS*> loc_defs;
// vector of local marker spots
std::vector<MarkerSpotS*> loc_spots;
LargeVectorC<MarkerSpotS*> loc_spots;
do
{
@ -316,8 +316,8 @@ MarkersC::readLocal()
bool
MarkersC::readLocal( const uint32_t & streamId,
std::vector<DefRec_DefMarkerS*> & locDefs,
std::vector<MarkerSpotS*> & locSpots )
LargeVectorC<DefRec_DefMarkerS*> & locDefs,
LargeVectorC<MarkerSpotS*> & locSpots )
{
bool error = false;
@ -432,16 +432,33 @@ MarkersC::writeGlobal()
do
{
// resort marker definitions
//
typedef
std::set<const DefRec_DefMarkerS*, DefRec_DefMarkerS::SortS>
resorted_markers_t;
resorted_markers_t resorted_markers;
for( std::set<DefRec_DefMarkerS>::const_iterator it =
m_globDefs.begin(); it != m_globDefs.end(); it++ )
{
resorted_markers.insert( &(*it) );
}
// write global marker definition records
//
for( std::set<DefRec_DefMarkerS>::const_iterator it =
m_globDefs.begin(); it != m_globDefs.end() && !error; it++ )
// iterate over all marker definitions
for( resorted_markers_t::const_iterator it = resorted_markers.begin();
it != resorted_markers.end(); it++ )
{
bool do_write = true;
// get copy of marker def. record in order that hook(s) can
// modify it
DefRec_DefMarkerS record = *it;
DefRec_DefMarkerS record = **it;
// trigger write record hook
theHooks->triggerWriteRecordHook( HooksC::Record_DefMarker, 5,

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

@ -17,10 +17,10 @@
#include "vt_unify.h"
#include "vt_unify_defs_recs.h"
#include "vt_unify_lvector.hh"
#include "vt_unify_tkfac.h"
#include <set>
#include <vector>
//
// MarkersC class
@ -87,8 +87,8 @@ private:
// read local markers of certain stream
bool readLocal( const uint32_t & streamId,
std::vector<DefRec_DefMarkerS*> & locDefs,
std::vector<MarkerSpotS*> & locSpots );
LargeVectorC<DefRec_DefMarkerS*> & locDefs,
LargeVectorC<MarkerSpotS*> & locSpots );
// write global markers
bool writeGlobal();
@ -108,7 +108,7 @@ private:
std::set<DefRec_DefMarkerS> m_globDefs;
// global marker spots
std::vector<MarkerSpotS> m_globSpots;
LargeVectorC<MarkerSpotS> m_globSpots;
};

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

@ -41,8 +41,7 @@ TokenFactoryScopeC<T>::create( const void * localDef )
uint32_t global_token;
// search for already created global definition
typename std::set<T>::const_iterator it =
std::find( m_globDefs->begin(), m_globDefs->end(), local_def );
typename std::set<T>::const_iterator it = m_globDefs->find( local_def );
// get its global token, if found
//

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

@ -748,7 +748,7 @@ Wrapper::parseCommandLine( int argc, char ** argv )
// -vt:inst, -vt:opari, -vt:tau, -vt:pdt
// (processed above; ignore here)
//
if( arg.compare("-vt:help") == 0
if( arg.compare("-vt:help") == 0
|| arg.compare("-vt:version") == 0
|| arg.compare("-vt:show") == 0
|| arg.compare("-vt:verbose") == 0
@ -772,10 +772,13 @@ Wrapper::parseCommandLine( int argc, char ** argv )
i++;
}
//
// -vt:<cc|cxx|f77|f90> <cmd>
// -vt:<cc|CC|c++|cxx|f77|f90> <cmd>
//
else if( (m_pConfig->m_eLangType == LANG_CC && arg.compare("-vt:cc") == 0)
|| (m_pConfig->m_eLangType == LANG_CXX && arg.compare("-vt:cxx") == 0)
else if( ( m_pConfig->m_eLangType == LANG_CC && arg.compare("-vt:cc") == 0 )
|| ( m_pConfig->m_eLangType == LANG_CXX &&
( arg.compare("-vt:CC") == 0
|| arg.compare("-vt:c++") == 0
|| arg.compare("-vt:cxx") == 0 ) )
|| (m_pConfig->m_eLangType == LANG_F77 && arg.compare("-vt:f77") == 0)
|| (m_pConfig->m_eLangType == LANG_F90 && arg.compare("-vt:f90") == 0) )
{

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

@ -526,7 +526,7 @@ void vt_cudartwrap_init(void)
maxEvtNum = 0;
trace_events = 0;
/*asyncBufSize = (sizeof(VTCUDAKernel) > sizeof(VTCUDAMemcpy)) ? sizeof(VTCUDAKernel) : sizeof(VTCUDAMemcpy);*/
asyncBufSize = sizeof(VTCUDAKernel);
asyncBufSize = sizeof(VTCUDAKernel) + sizeof(VTCUDAknconf);
}
#endif
@ -896,7 +896,8 @@ static uint64_t VTCUDAsynchronizeEvt(cudaEvent_t syncEvt)
{
/* Record and synchronization events on stream 0 (prior to FERMI)
see NVIDIA CUDA Programming Guide 2.3, sections 3.2.6.1 and 3.2.6.2
see NVIDIA CUDA Programming Guide (4.0), Chapter 3. -> CUDA C Runtime ->
subsection Events (3.2.5.6)
-> "Events in stream zero are recorded after all preceding tasks/commands
from all streams are completed by the device." */
cudaEventRecord_ptr(syncEvt, 0);
@ -907,14 +908,13 @@ static uint64_t VTCUDAsynchronizeEvt(cudaEvent_t syncEvt)
/* error handling */
if(cudaSuccess != ret){
if(cudaErrorInvalidResourceHandle == ret){
vt_warning("[CUDART] Synchronization stop event is invalid. Context has "
"been destroyed, \nbefore asynchronous tasks could be flushed! "
vt_warning("[CUDART] Synchronization stop event is invalid. Context has"
" been destroyed, \nbefore asynchronous tasks could be flushed! "
"Traces might be incomplete!");
return (uint64_t)-1;
}else{
vt_error_msg("[CUDA Error <%s>:%i] %s", __FILE__,__LINE__,
cudaGetErrorString_ptr(ret));
checkCUDACall(ret, NULL);
}
return (uint64_t)-1;
}
}
@ -2337,11 +2337,11 @@ cudaError_t cudaLaunch(const char *entry)
/* get kernel element */
e = getKernelElement(entry);
if(e != NULL){
/* check if the kernel will be traced on the correct thread */
vtDev = VTCUDAgetDevice(ptid);
/* get the active device */
vtDev = VTCUDAgetDevice(ptid);
if(e != NULL){
/* check the kernel configure stack for last configured kernel */
if(vtDev->conf_stack == vtDev->buf_size){
ret = VT_LIBWRAP_FUNC_CALL(vt_cudart_lw, (entry));
@ -2360,8 +2360,6 @@ cudaError_t cudaLaunch(const char *entry)
kernel->blocksPerGrid = vtKnconf->blocksPerGrid;
kernel->threadsPerBlock = vtKnconf->threadsPerBlock;
kernel->strm = vtKnconf->strm;
vtDev->conf_stack = vtDev->conf_stack + sizeof(VTCUDAknconf);
}
vt_cntl_msg(3, "[CUDART] Launch '%s' (device %d, tid %d, rid %d, strm %d)",
@ -2404,8 +2402,13 @@ cudaError_t cudaLaunch(const char *entry)
#endif
checkCUDACall(cudaEventRecord_ptr(kernel->evt->strt, kernel->strm->stream),
"cudaEventRecord(startEvt, strmOfLastKernel) failed!");
}
}
}/* e != NULL */
/* pop this kernel from configure stack */
vtDev->conf_stack = vtDev->conf_stack + sizeof(VTCUDAknconf);
} /* trace_kernels && do_trace */
}
/* call cudaLaunch itself */