45 static const uint32_t DEFAULT_MAX_FILE_HANDLES= 50;
46 static const uint32_t DEFAULT_BUFFER_SIZE= 1024 * 1024;
47 static const uint32_t DEFAULT_MAX_GROUPS= 16;
48 static const uint8_t DEFAULT_VERBOSE_LEVEL= 0;
49 static const bool DEFAULT_CREATE_CSV=
false;
50 static const bool DEFAULT_CREATE_TEX=
true;
51 static const bool DEFAULT_CREATE_PDF=
true;
52 static const string DEFAULT_OUTPUT_FILE_PREFIX() {
return "result"; }
54 uint32_t max_file_handles;
57 uint8_t verbose_level;
64 string input_file_prefix;
65 string output_file_prefix;
71 static const ClusterAlgorithm DEFAULT_ALGORITHM= CLUSTER_ALG_KMEANS;
72 static double DEFAULT_QUALITY_THRESHOLD() {
return 0.1; }
73 static const string DEFAULT_MAP_FILE_NAME() {
return "result.map"; }
79 double quality_threshold;
82 string shrink_output_prefix;
85 uint32_t synth_ranks_num;
86 uint32_t synth_funcs_num;
89 : alg(DEFAULT_ALGORITHM), enabled(
false), shrink(
false),
91 quality_threshold(DEFAULT_QUALITY_THRESHOLD()),
92 map_file_name(DEFAULT_MAP_FILE_NAME()), synth_data(
false),
93 synth_ranks_num(0), synth_funcs_num(0) {}
98 : max_file_handles(DEFAULT_MAX_FILE_HANDLES),
99 buffer_size(DEFAULT_BUFFER_SIZE), max_groups(DEFAULT_MAX_GROUPS),
100 verbose_level(DEFAULT_VERBOSE_LEVEL), progress(false),
101 read_from_stats(false), create_csv(DEFAULT_CREATE_CSV),
102 create_tex(DEFAULT_CREATE_TEX), create_pdf(DEFAULT_CREATE_PDF),
103 output_file_prefix(DEFAULT_OUTPUT_FILE_PREFIX()) {}
113 static const uint64_t EVENTS_RECORD_LIMIT= 1000000;
114 static const uint64_t STATS_RECORD_LIMIT= 100;
119 #ifdef OTFPROFILE_MPI
121 static const int MSG_TAG= 500;
125 uint64_t* recv_buffers;
130 uint64_t* rank_cur_bytes;
144 const uint8_t verbose_level;
147 Scope(
const uint8_t _verbose_level )
148 : start_time(-1.0), stop_time(-1.0),
149 verbose_level(_verbose_level) {}
156 map< string, Scope > scope_map;
161 static double gettime() {
163 #ifdef OTFPROFILE_MPI
167 gettimeofday( &tv, NULL );
168 return (
double)( tv.tv_sec * 1e6 + tv.tv_usec ) / 1.0e6;
181 Pair() : a(0), b(0) {}
182 Pair( uint64_t aa, uint64_t bb ) : a(aa), b(bb) {}
189 bool operator()(
const Pair& p1,
const Pair& p2 )
const {
194 if ( p1.a == p2.a ) {
214 Triple() : a(0), b(0), c(0) {}
215 Triple( uint64_t aa, uint64_t bb, uint64_t cc ) : a(aa), b(bb), c(cc) {}
222 bool operator()(
const Triple& p1,
const Triple& p2 )
const {
227 if ( p1.a == p2.a ) {
229 if ( p1.b == p2.b ) {
251 Process() : process(0), parent(0) {}
252 Process( uint64_t _process, uint64_t _parent )
253 : process(_process), parent(_parent) {}
263 return p1.process < p2.process;
271 template <
class type>
281 min_max_avg( type a= (type) OTF_UINT64_MAX, type b= (type) 0, type s= (type) 0, uint64_t c= 0 ) :
282 min( a ), max( b ), sum( s ), cnt( c ) {}
286 void append(
const type& value ) {
288 if ( ((type) 0) != value ) {
290 min= ( value < min ) ? value : min;
291 max= ( value > max ) ? value : max;
300 min= ( other.min < min ) ? other.min : min;
301 max= ( other.max > max ) ? other.max : max;
321 static const uint32_t MAX_GROUPS;
324 map< uint64_t, uint64_t > processesToGroups;
325 map< uint64_t, set<uint64_t> > groupsToProcesses;
335 bool insert( uint64_t group, uint64_t process ) {
340 pair< map< uint64_t, uint64_t >::const_iterator,
bool> ret=
341 processesToGroups.insert( pair< uint64_t, uint64_t >( process, group ) );
345 groupsToProcesses[ group ].insert( process );
349 if ( !enabled && 1 < groupsToProcesses[ group ].size() ) {
361 uint64_t process2group( uint64_t process )
const {
363 map< uint64_t, uint64_t >::const_iterator it= processesToGroups.find( process );
365 return ( processesToGroups.end() != it ) ? it->second : ( uint64_t) 0 ;
371 const set<uint64_t>* group2processes( uint64_t group )
const {
373 map< uint64_t, set<uint64_t> >::const_iterator it= groupsToProcesses.find( group );
375 return ( groupsToProcesses.end() != it ) ? ( & it->second ) : NULL ;
379 uint32_t numGroups( )
const {
381 return groupsToProcesses.size();
398 uint64_t childDuration;
415 : firstValue( (uint64_t)-1 ), lastValue( (uint64_t)-1 ),
416 lastTime( (uint64_t)-1 ), childDelta( 0 ) {}
420 map< uint64_t, CounterData > counterIdDataMap;
423 : fid( f ), timestamp( t ), childDuration( 0 ) {}
437 void add( uint64_t n= 0,
double ex= 0.0,
double in= 0.0 ) {
440 excl_time.append( ex );
441 incl_time.append( in );
446 count.add( other.count );
447 excl_time.add( other.excl_time );
448 incl_time.add( other.incl_time );
470 void add_send( uint64_t n= 0, uint64_t b= 0,
double d= 0.0 ) {
472 count_send.append( n );
473 bytes_send.append( b );
474 duration_send.append( d );
477 void add_recv( uint64_t n= 0, uint64_t b= 0,
double d= 0.0 ) {
479 count_recv.append( n );
480 bytes_recv.append( b );
481 duration_recv.append( d );
486 count_send.add( other.count_send );
487 count_recv.add( other.count_recv );
488 bytes_send.add( other.bytes_send );
489 bytes_recv.add( other.bytes_recv );
490 duration_send.add( other.duration_send );
491 duration_recv.add( other.duration_recv );
498 static const uint32_t BIN_LOG_BASE= 2;
506 void add( uint64_t n= 0 ) {
513 count.add( other.count );
530 : collop(0), bytes_send(0), bytes_recv(0), begin_time(0) {}
532 uint64_t _bytes_recv, uint64_t _begin_time )
533 : collop(_collop), bytes_send(_bytes_send), bytes_recv(_bytes_recv),
534 begin_time(_begin_time) {}
544 const uint32_t myRank;
545 const uint32_t numRanks;
547 #ifdef OTFPROFILE_MPI
549 uint32_t packBufferSize;
554 uint32_t myProcessesNum;
555 uint32_t* myProcessesList;
584 set< Process, ltProcess > allProcesses;
587 map< uint64_t, string > functionIdNameMap;
590 map< uint64_t, string > counterIdNameMap;
593 map< uint64_t, string > processIdNameMap;
603 map< uint64_t, list<StackType> > stackPerProcess;
607 map< Pair, PendingCollective, ltPair > pendingCollectives;
612 map< uint64_t, uint64_t > collectiveOperationsToClasses;
615 set< uint64_t > countersOfInterest;
618 uint64_t timerResolution;
621 uint64_t recvTimeKey;
635 map< Pair, FunctionData, ltPair > functionMapPerRank;
639 map< Triple, CounterData, ltTriple > counterMapPerFunctionRank;
643 map< Pair, MessageData, ltPair > messageMapPerRankPair;
647 map< uint64_t, MessageData > messageMapPerRank;
651 map< Pair, CollectiveData, ltPair > collectiveMapPerRank;
661 map< uint64_t, FunctionData > functionMapGlobal;
665 map< Pair, CounterData, ltPair > counterMapGlobal;
670 map< Pair, MessageData, ltPair > messageMapPerGroupPair;
674 map< uint64_t, MessageData > messageMapPerGroup;
678 map< Pair, MessageSpeedData, ltPair > messageSpeedMapPerLength;
682 map< Pair, CollectiveData, ltPair > collectiveMapPerGroup;
687 AllData( uint32_t my_rank= 0, uint32_t num_ranks= 1 ) :
688 myRank(my_rank), numRanks(num_ranks), myProcessesNum(0),
689 myProcessesList(NULL), timerResolution(0), recvTimeKey(0) {
691 #ifdef OTFPROFILE_MPI
702 free( myProcessesList );
703 myProcessesList= NULL;
705 #ifdef OTFPROFILE_MPI
715 #ifdef OTFPROFILE_MPI
716 char* guaranteePackBuffer( uint32_t size ) {
718 if ( packBufferSize < size ) {
720 packBufferSize= size;
721 packBuffer= (
char*) realloc( packBuffer, packBufferSize *
sizeof(
char) );
722 assert( NULL != packBuffer );
729 char* freePackBuffer( ) {
739 char* getPackBuffer( ) {
Definition: datastructs.h:140
Definition: datastructs.h:317
Definition: datastructs.h:208
Definition: datastructs.h:138
Definition: datastructs.h:110
Definition: datastructs.h:400
Definition: datastructs.h:496
Definition: datastructs.h:428
Definition: datastructs.h:41
Definition: datastructs.h:187
Definition: datastructs.h:386
Definition: datastructs.h:69
Definition: datastructs.h:220
Definition: datastructs.h:522
Definition: datastructs.h:272
Definition: datastructs.h:457
Definition: datastructs.h:258
Definition: datastructs.h:541
VampirTrace http://www.tu-dresden.de/zih/vampirtrace.
Definition: datastructs.h:246
Main top-level request struct definition.
Definition: request.h:100
Deals with all data type related issues.
Definition: datastructs.h:176