Fixed several Coverity warnings
This commit was SVN r25014.
Этот коммит содержится в:
родитель
8014e3429e
Коммит
3a6e9b19ee
@ -16,7 +16,7 @@
|
||||
string OMPragmaC::find_next_word() {
|
||||
while ( pline < lines.size() ) {
|
||||
string::size_type wbeg = lines[pline].find_first_not_of(" \t", ppos);
|
||||
if ( lines[pline][wbeg] == '\\' || wbeg == string::npos ) {
|
||||
if ( wbeg == string::npos || lines[pline][wbeg] == '\\' ) {
|
||||
++pline;
|
||||
if ( pline < lines.size() ) { ppos = 0; } else { return ""; }
|
||||
} else if ( lines[pline][wbeg] == '(' || lines[pline][wbeg] == ')' ) {
|
||||
|
@ -14,7 +14,7 @@
|
||||
string OMPragmaF::find_next_word() {
|
||||
while ( pline < lines.size() ) {
|
||||
string::size_type wbeg = lines[pline].find_first_not_of(" \t", ppos);
|
||||
if ( lines[pline][wbeg] == '&' || wbeg == string::npos ) {
|
||||
if ( wbeg == string::npos || lines[pline][wbeg] == '&' ) {
|
||||
++pline;
|
||||
if ( pline < lines.size() ) {
|
||||
ppos = lines[pline].find(sentinel) + slen;
|
||||
@ -120,7 +120,7 @@ void OMPragmaF::remove_empties() {
|
||||
lines[0][slen] = ' ';
|
||||
} else {
|
||||
string::size_type l = lines[0].find_first_not_of(" \t", s+slen);
|
||||
if ( lines[0][l] == '&' ) lines[0][l] = ' ';
|
||||
if ( l != string::npos && lines[0][l] == '&' ) lines[0][l] = ' ';
|
||||
}
|
||||
|
||||
// make sure last line is not a continuated line
|
||||
@ -133,7 +133,8 @@ void OMPragmaF::remove_empties() {
|
||||
|
||||
// remove trailing comma
|
||||
amp = lines[lastline].find_last_not_of(" \t", c);
|
||||
if ( lines[lastline][amp] == ',' ) lines[lastline][amp] = ' ';
|
||||
if ( amp != string::npos && lines[lastline][amp] == ',' )
|
||||
lines[lastline][amp] = ' ';
|
||||
}
|
||||
|
||||
OMPragma* OMPragmaF::split_combined() {
|
||||
@ -153,9 +154,11 @@ OMPragma* OMPragmaF::split_combined() {
|
||||
string::size_type com = lines[i].find("!", s+slen);
|
||||
if ( com != string::npos ) --com;
|
||||
string::size_type amp2 = lines[i].find_last_not_of(" \t", com);
|
||||
if ( lines[i][amp2] == '&' ) inner->lines[i][amp2] = '&';
|
||||
if ( amp2 != string::npos && lines[i][amp2] == '&' )
|
||||
inner->lines[i][amp2] = '&';
|
||||
string::size_type amp1 = lines[i].find_first_not_of(" \t", s+slen);
|
||||
if ( lines[i][amp1] == '&' ) inner->lines[i][amp1] = '&';
|
||||
if ( amp1 != string::npos && lines[i][amp1] == '&' )
|
||||
inner->lines[i][amp1] = '&';
|
||||
}
|
||||
|
||||
// fix pragma name
|
||||
|
@ -47,6 +47,8 @@ void OMPRegion::generate_descr(ostream& os) {
|
||||
os << "\n";
|
||||
|
||||
if (descrs.size()) {
|
||||
ostream::fmtflags sav_os_flags = os.flags();
|
||||
|
||||
os << "#define POMP_DLIST_" << setw(5) << setfill('0') << id
|
||||
<< " shared(";
|
||||
for (set<int>::const_iterator it = descrs.begin();
|
||||
@ -63,6 +65,8 @@ void OMPRegion::generate_descr(ostream& os) {
|
||||
}
|
||||
#endif // OPARI_VT
|
||||
os << ")\n\n";
|
||||
|
||||
os.flags( sav_os_flags );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace {
|
||||
unsigned& pline, string::size_type& ppos) {
|
||||
while ( pline < size ) {
|
||||
string::size_type wbeg = preStmt[pline].find_first_not_of(" \t", ppos);
|
||||
if ( preStmt[pline][wbeg] == '\\' || wbeg == string::npos ) {
|
||||
if ( wbeg == string::npos || preStmt[pline][wbeg] == '\\' ) {
|
||||
++pline;
|
||||
if ( pline < size ) { ppos = 0; } else { return ""; }
|
||||
} else {
|
||||
|
@ -424,7 +424,7 @@ void process_fortran(istream& is, const char* infile, ostream& os,
|
||||
string::size_type com = lowline.find("!", pstart+4+pomp);
|
||||
if ( com != string::npos ) --com;
|
||||
string::size_type amp = lowline.find_last_not_of(" \t", com);
|
||||
if ( lowline[amp] == '&' ) {
|
||||
if ( amp != string::npos && lowline[amp] == '&' ) {
|
||||
// last non-white non-comment character == '&' --> continuation
|
||||
needPragma = true;
|
||||
} else {
|
||||
@ -532,4 +532,9 @@ void process_fortran(istream& is, const char* infile, ostream& os,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// currPragma should be deleted at this point; ensure that to prevent
|
||||
// memory leak
|
||||
if ( currPragma )
|
||||
delete currPragma;
|
||||
}
|
||||
|
@ -46,7 +46,8 @@ struct Function {
|
||||
int64_t accDurationIncl;
|
||||
|
||||
|
||||
Function() {}
|
||||
Function() :
|
||||
id(0), invocations(0), depth(0), accDurationExcl(0), accDurationIncl(0) {}
|
||||
|
||||
Function( uint32_t _id, const std::string& nm ) :
|
||||
id(_id), name(nm), invocations(0), depth(0), accDurationExcl(0), accDurationIncl(0) {}
|
||||
|
@ -713,49 +713,47 @@ getParams( int argc, char** argv )
|
||||
|
||||
// show error message, if necessary
|
||||
//
|
||||
if( opt_error != OPT_ERR_OK )
|
||||
MASTER
|
||||
{
|
||||
MASTER
|
||||
switch( opt_error )
|
||||
{
|
||||
switch( opt_error )
|
||||
case OPT_ERR_OK:
|
||||
{
|
||||
case OPT_ERR_ARG_MISSING:
|
||||
{
|
||||
std::cerr << ExeName << ": option '" << args[i]
|
||||
<< "' requires an argument" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_ARG_INVALID:
|
||||
{
|
||||
std::cerr << ExeName << ": invalid argument `"
|
||||
<< args[i+1] << "' for `" << args[i] << "'" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_UNRECOGNIZED:
|
||||
{
|
||||
std::cerr << ExeName << ": unrecognized option -- '"
|
||||
<< args[i] << "'" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_OTHER:
|
||||
{
|
||||
std::cerr << opt_error_other << std::endl;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_ARG_MISSING:
|
||||
{
|
||||
std::cerr << ExeName << ": option '" << args[i]
|
||||
<< "' requires an argument" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_ARG_INVALID:
|
||||
{
|
||||
std::cerr << ExeName << ": invalid argument `"
|
||||
<< args[i+1] << "' for `" << args[i] << "'" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_UNRECOGNIZED:
|
||||
{
|
||||
std::cerr << ExeName << ": unrecognized option -- '"
|
||||
<< args[i] << "'" << std::endl;
|
||||
break;
|
||||
}
|
||||
case OPT_ERR_OTHER:
|
||||
{
|
||||
std::cerr << opt_error_other << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( opt_error != OPT_ERR_OK )
|
||||
{
|
||||
std::cerr << "Try `" << ExeName << " --help' for more information."
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return ( opt_error == OPT_ERR_OK );
|
||||
}
|
||||
|
||||
static void
|
||||
@ -895,8 +893,12 @@ stringList2Vector( const std::string& str, std::vector<std::string>& vec,
|
||||
|
||||
// trim list entry
|
||||
//
|
||||
entry.erase( 0, entry.find_first_not_of( " " ) );
|
||||
entry.erase( entry.find_last_not_of( " " ) + 1 );
|
||||
std::string::size_type si = entry.find_first_not_of( " " );
|
||||
if( si != std::string::npos )
|
||||
entry.erase( 0, si );
|
||||
si = entry.find_last_not_of( " " );
|
||||
if( si != std::string::npos )
|
||||
entry.erase( si + 1 );
|
||||
|
||||
// add list entry to output vector, if it's not empty
|
||||
//
|
||||
|
@ -62,6 +62,15 @@ private:
|
||||
//
|
||||
struct ProgressS
|
||||
{
|
||||
// contructor
|
||||
ProgressS()
|
||||
: curBytes( 0 ), maxBytes( 0 )
|
||||
#ifdef VT_MPI
|
||||
, sendRequest( MPI_REQUEST_NULL ), recvBuffers( 0 ), recvRequests( 0 ),
|
||||
recvStatuses( 0 ), recvIndices( 0 ), rankCurBytes( 0 ), ranksLeft( 0 )
|
||||
#endif // VT_MPI
|
||||
{}
|
||||
|
||||
uint64_t curBytes; // current bytes read
|
||||
uint64_t maxBytes; // max. bytes readable
|
||||
|
||||
|
@ -51,7 +51,7 @@ FilterGeneratorC::run()
|
||||
|
||||
do
|
||||
{
|
||||
char** envp = new char*[2];
|
||||
envp = new char*[2];
|
||||
envp[0] = envp[1] = 0;
|
||||
|
||||
// convert program parameters for the old vtfilter
|
||||
|
@ -1396,6 +1396,8 @@ FilterTraceC::getMaxBytesToRead( uint64_t& maxBytes )
|
||||
maxBytes += max;
|
||||
}
|
||||
|
||||
// close OTF handler array
|
||||
OTF_HandlerArray_close( handlers );
|
||||
// close OTF reader
|
||||
OTF_Reader_close( reader );
|
||||
// close OTF file manager
|
||||
@ -1474,8 +1476,8 @@ FilterTraceC::FilterS::pack( const uint32_t& proc, char*& buffer,
|
||||
for( std::set<uint32_t>::const_iterator proc_it = procsOff.begin();
|
||||
proc_it != procsOff.end(); proc_it++ )
|
||||
{
|
||||
uint32_t proc = *proc_it;
|
||||
MPI_Pack( &proc, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos,
|
||||
uint32_t off_proc = *proc_it;
|
||||
MPI_Pack( &off_proc, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos,
|
||||
comm );
|
||||
}
|
||||
}
|
||||
@ -1529,10 +1531,12 @@ FilterTraceC::FilterS::unpack( const uint32_t& proc, char*& buffer,
|
||||
MPI_Unpack( buffer, bufferSize, &bufferPos, &procsOff_size, 1, MPI_UNSIGNED,
|
||||
comm );
|
||||
|
||||
// procsOff
|
||||
//
|
||||
for( uint32_t i = 0; i < procsOff_size; i++ )
|
||||
{
|
||||
uint32_t proc;
|
||||
MPI_Unpack( buffer, bufferSize, &bufferPos, &proc, 1, MPI_UNSIGNED, comm );
|
||||
uint32_t off_proc;
|
||||
MPI_Unpack( buffer, bufferSize, &bufferPos, &off_proc, 1, MPI_UNSIGNED, comm );
|
||||
|
||||
procsOff.insert( proc );
|
||||
}
|
||||
|
@ -437,7 +437,6 @@ HooksMsgMatchC::getRecvMsgs( LargeVectorC<RecvMsgS*> & recvMsgs )
|
||||
recv_msgs[i]->clear();
|
||||
delete recv_msgs[i];
|
||||
}
|
||||
delete [] recv_msgs;
|
||||
|
||||
#ifdef VT_MPI
|
||||
// distribute receive messages to ranks which processes the corresponding
|
||||
@ -451,6 +450,8 @@ HooksMsgMatchC::getRecvMsgs( LargeVectorC<RecvMsgS*> & recvMsgs )
|
||||
#endif // VT_MPI
|
||||
}
|
||||
|
||||
delete [] recv_msgs;
|
||||
|
||||
return !error;
|
||||
}
|
||||
|
||||
|
@ -448,20 +448,29 @@ void HooksTdbC::writeRecHook_DefComment( HooksC::VaArgsT & args ) {
|
||||
std::string vt_comment = *comment;
|
||||
std::string vt_env_name;
|
||||
std::string vt_env_value;
|
||||
int start_pos;
|
||||
int pos;
|
||||
std::string::size_type start_pos;
|
||||
std::string::size_type pos;
|
||||
|
||||
start_pos = vt_comment.find_first_not_of( ' ', 0 );
|
||||
|
||||
vt_comment.erase( 0, start_pos );
|
||||
if( start_pos != std::string::npos ) {
|
||||
|
||||
if( vt_comment.substr( 0, 3 ) == "VT_" ) {
|
||||
vt_comment.erase( 0, start_pos );
|
||||
|
||||
pos = vt_comment.find( ": ", 0 );
|
||||
vt_env_name = vt_comment.substr( 0, pos );
|
||||
vt_env_value = vt_comment.substr( pos + 2, vt_comment.length() );
|
||||
if( vt_comment.length() > 3 && vt_comment.substr( 0, 3 ) == "VT_" ) {
|
||||
|
||||
RootData.vt_env[vt_env_name] = vt_env_value;
|
||||
pos = vt_comment.find( ": ", 0 );
|
||||
|
||||
if( pos != std::string::npos ) {
|
||||
|
||||
vt_env_name = vt_comment.substr( 0, pos );
|
||||
vt_env_value = vt_comment.substr( pos + 2, vt_comment.length() );
|
||||
|
||||
RootData.vt_env[vt_env_name] = vt_env_value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1022,7 +1031,7 @@ HooksTdbC::CollOpC::CollOpC()
|
||||
HooksTdbC::CollOpC::CollOpC( uint64_t _num, uint64_t _bytes_sent, uint64_t _bytes_recv )
|
||||
: num(_num), bytes_sent(_bytes_sent), bytes_recv(_bytes_recv) {}
|
||||
|
||||
HooksTdbC::CollOpC HooksTdbC::CollOpC::operator+=( HooksTdbC::CollOpC cs ) {
|
||||
HooksTdbC::CollOpC HooksTdbC::CollOpC::operator+=( const HooksTdbC::CollOpC & cs ) {
|
||||
|
||||
num += cs.num;
|
||||
bytes_sent += cs.bytes_sent;
|
||||
@ -1040,7 +1049,7 @@ HooksTdbC::IoC::IoC()
|
||||
: num_read(0), bytes_read(0), num_written(0), bytes_written(0), num_open(0),
|
||||
num_close(0), num_seek(0) {}
|
||||
|
||||
HooksTdbC::IoC HooksTdbC::IoC::operator+=( HooksTdbC::IoC is) {
|
||||
HooksTdbC::IoC HooksTdbC::IoC::operator+=( const HooksTdbC::IoC & is) {
|
||||
|
||||
num_read += is.num_read;
|
||||
bytes_read += is.bytes_read;
|
||||
@ -1061,14 +1070,21 @@ HooksTdbC::IoC HooksTdbC::IoC::operator+=( HooksTdbC::IoC is) {
|
||||
|
||||
HooksTdbC::MasterDataC::MasterDataC() {
|
||||
|
||||
starttime = 0;
|
||||
runtime = 0;
|
||||
filesize = 0;
|
||||
num_streams = 0;
|
||||
|
||||
num_processes = 0;
|
||||
num_active_processes = 0;
|
||||
num_threads = 0;
|
||||
|
||||
vt_flush_id = 0;
|
||||
is_compressed = false;
|
||||
|
||||
create_output = false;
|
||||
|
||||
vt_flush_id = 0;
|
||||
|
||||
}
|
||||
|
||||
HooksTdbC::MasterDataC::~MasterDataC() {}
|
||||
@ -1124,6 +1140,7 @@ uint64_t HooksTdbC::MasterDataC::calcFilesize() {
|
||||
}
|
||||
|
||||
return filesize;
|
||||
|
||||
}
|
||||
|
||||
std::string HooksTdbC::MasterDataC::intToHex( int i ) {
|
||||
@ -1157,6 +1174,8 @@ std::string HooksTdbC::MasterDataC::safeCwd() {
|
||||
} else {
|
||||
|
||||
/* an error occurred */
|
||||
|
||||
delete [] buf;
|
||||
return NULL;
|
||||
|
||||
}
|
||||
@ -1164,6 +1183,8 @@ std::string HooksTdbC::MasterDataC::safeCwd() {
|
||||
} else {
|
||||
|
||||
/* all right */
|
||||
|
||||
delete [] buf;
|
||||
return std::string( buf );
|
||||
|
||||
}
|
||||
@ -1250,10 +1271,10 @@ HooksTdbC::ThreadDataC::ThreadDataC()
|
||||
bytes_rma(0), num_marker(0), num_stats(0), num_snaps(0),
|
||||
num_vt_flushes(0) {}
|
||||
|
||||
HooksTdbC::ThreadDataC HooksTdbC::ThreadDataC::operator+=( HooksTdbC::ThreadDataC td ) {
|
||||
HooksTdbC::ThreadDataC HooksTdbC::ThreadDataC::operator+=( const HooksTdbC::ThreadDataC & td ) {
|
||||
|
||||
std::map<uint32_t, HooksTdbC::CollOpC>::iterator collop_it;
|
||||
std::map<uint32_t, HooksTdbC::IoC>::iterator io_it;
|
||||
std::map<uint32_t, HooksTdbC::CollOpC>::const_iterator collop_it;
|
||||
std::map<uint32_t, HooksTdbC::IoC>::const_iterator io_it;
|
||||
|
||||
num_events += td.num_events;
|
||||
num_enter += td.num_enter;
|
||||
|
@ -48,7 +48,7 @@ private:
|
||||
CollOpC();
|
||||
CollOpC( uint64_t _num, uint64_t _bytes_sent, uint64_t _bytes_recv );
|
||||
|
||||
CollOpC operator+=( CollOpC cs );
|
||||
CollOpC operator+=( const CollOpC & cs );
|
||||
|
||||
uint64_t num;
|
||||
uint64_t bytes_sent;
|
||||
@ -68,7 +68,7 @@ private:
|
||||
// uint64_t _bytes_written, uint64_t _num_open, uint64_t _num_close,
|
||||
// uint64_t _num_seek );
|
||||
|
||||
IoC operator+=( IoC is );
|
||||
IoC operator+=( const IoC & is );
|
||||
|
||||
uint64_t num_read;
|
||||
uint64_t bytes_read;
|
||||
@ -157,7 +157,7 @@ private:
|
||||
|
||||
ThreadDataC();
|
||||
|
||||
ThreadDataC operator+=( ThreadDataC td );
|
||||
ThreadDataC operator+=( const ThreadDataC & td );
|
||||
|
||||
bool toBuffer( uint64_t * buf );
|
||||
|
||||
|
@ -430,6 +430,7 @@ getUnifyControls()
|
||||
{
|
||||
uint32_t stream_id;
|
||||
bool stream_avail = true;
|
||||
std::istringstream iss;
|
||||
|
||||
// is stream not available?
|
||||
if( buffer[strlen( buffer ) - 1] == '!' )
|
||||
@ -443,11 +444,15 @@ getUnifyControls()
|
||||
any_stream_avail = true;
|
||||
}
|
||||
|
||||
sscanf(buffer, "%x", &stream_id);
|
||||
if( stream_id == 0 ) { error = true; break; }
|
||||
iss.str( buffer );
|
||||
assert( iss );
|
||||
error = !( iss >> std::hex >> stream_id );
|
||||
|
||||
streamids.push_back( stream_id );
|
||||
streamavs.push_back( stream_avail );
|
||||
if( !error && stream_id > 0 )
|
||||
{
|
||||
streamids.push_back( stream_id );
|
||||
streamavs.push_back( stream_avail );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -456,30 +461,29 @@ getUnifyControls()
|
||||
//
|
||||
case 2:
|
||||
{
|
||||
std::istringstream iss( buffer );
|
||||
assert( iss );
|
||||
|
||||
switch( ++(col_no[line_no_sec-2]) )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(ltime[0]));
|
||||
error = !( iss >> std::hex >> ltime[0] );
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(offset[0]));
|
||||
error = !( iss >> std::hex >> offset[0] );
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(ltime[1]));
|
||||
error = !( iss >> std::hex >> ltime[1] );
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(offset[1]));
|
||||
error = !( iss >> std::hex >> offset[1] );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -496,6 +500,8 @@ getUnifyControls()
|
||||
case 3:
|
||||
{
|
||||
static ETimeSyncC::SyncPhaseS sync_phase;
|
||||
std::istringstream iss( buffer );
|
||||
assert( iss );
|
||||
|
||||
theTimeSync->setSyncMethod( TimeSyncC::METHOD_ENHANCED );
|
||||
|
||||
@ -503,23 +509,24 @@ getUnifyControls()
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
sscanf(buffer, "%x", &(sync_phase.mapid));
|
||||
error = !( iss >> std::hex >> sync_phase.mapid );
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_phase.time));
|
||||
error = !( iss >> std::hex >> sync_phase.time );
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_phase.duration));
|
||||
error = !( iss >> std::hex >> sync_phase.duration );
|
||||
|
||||
sync_phases.push_back( sync_phase );
|
||||
if( !error )
|
||||
{
|
||||
sync_phases.push_back( sync_phase );
|
||||
col_no[line_no_sec-2] = 0;
|
||||
}
|
||||
|
||||
col_no[line_no_sec-2] = 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -536,6 +543,8 @@ getUnifyControls()
|
||||
{
|
||||
static std::pair<uint32_t, uint32_t> sync_pair;
|
||||
static ETimeSyncC::SyncTimeS sync_time;
|
||||
std::istringstream iss( buffer );
|
||||
assert( iss );
|
||||
|
||||
if( 4 <= line_no_sec &&
|
||||
line_no_sec <= 4 + sync_phases.size() - 1 )
|
||||
@ -544,42 +553,43 @@ getUnifyControls()
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
sscanf(buffer, "%x", &(sync_pair.first));
|
||||
error = !( iss >> std::hex >> sync_pair.first );
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
sscanf(buffer, "%x", &(sync_pair.second));
|
||||
error = !( iss >> std::hex >> sync_pair.second );
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_time.t[0]));
|
||||
error = !( iss >> std::hex >> sync_time.t[0] );
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_time.t[1]));
|
||||
error = !( iss >> std::hex >> sync_time.t[1] );
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_time.t[2]));
|
||||
error = !( iss >> std::hex >> sync_time.t[2] );
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
sscanf(buffer, "%llx",
|
||||
(unsigned long long int*)&(sync_time.t[3]));
|
||||
sync_time.phase_idx = line_no_sec - 4;
|
||||
error = !( iss >> std::hex >> sync_time.t[3] );
|
||||
|
||||
sync_pairs.push_back( sync_pair );
|
||||
sync_times.push_back( sync_time );
|
||||
if( !error )
|
||||
{
|
||||
sync_time.phase_idx = line_no_sec - 4;
|
||||
|
||||
sync_pairs.push_back( sync_pair );
|
||||
sync_times.push_back( sync_time );
|
||||
|
||||
col_no[line_no_sec-2] = 0;
|
||||
}
|
||||
|
||||
col_no[line_no_sec-2] = 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -646,7 +646,7 @@ DefinitionsC::readLocal( const std::vector<uint32_t> & streamIds )
|
||||
// create instance for local definition relating to its type
|
||||
//
|
||||
|
||||
DefRec_BaseS * new_loc_def;
|
||||
DefRec_BaseS * new_loc_def = 0;
|
||||
|
||||
switch( def_type )
|
||||
{
|
||||
@ -2015,11 +2015,13 @@ DefinitionsC::CommentsC::~CommentsC()
|
||||
}
|
||||
|
||||
bool
|
||||
DefinitionsC::CommentsC::processLocal(
|
||||
const DefRec_DefCommentS & locComment )
|
||||
DefinitionsC::CommentsC::processLocal( const DefRec_DefCommentS & locComment )
|
||||
{
|
||||
bool error = false;
|
||||
|
||||
std::istringstream iss( locComment.comment );
|
||||
assert( iss );
|
||||
|
||||
switch( locComment.type )
|
||||
{
|
||||
case DefRec_DefCommentS::TYPE_START_TIME:
|
||||
@ -2027,8 +2029,8 @@ DefinitionsC::CommentsC::processLocal(
|
||||
// get minimum start time from comment
|
||||
//
|
||||
uint64_t starttime;
|
||||
sscanf( locComment.comment.c_str(), "%llu",
|
||||
(unsigned long long int*)&starttime );
|
||||
iss >> starttime;
|
||||
assert( iss );
|
||||
|
||||
// update minimum start time, if necessary
|
||||
if( starttime < m_traceTimes.minStartTimeEpoch )
|
||||
@ -2041,11 +2043,10 @@ DefinitionsC::CommentsC::processLocal(
|
||||
// get maximum stop time from comment
|
||||
//
|
||||
uint64_t stoptime;
|
||||
sscanf( locComment.comment.c_str(), "%llu",
|
||||
(unsigned long long int*)&stoptime );
|
||||
iss >> stoptime;
|
||||
assert( iss );
|
||||
|
||||
// update maximum stop time, if necessary
|
||||
//
|
||||
if( stoptime > m_traceTimes.maxStopTimeEpoch )
|
||||
m_traceTimes.maxStopTimeEpoch = stoptime;
|
||||
|
||||
@ -2056,10 +2057,45 @@ DefinitionsC::CommentsC::processLocal(
|
||||
{
|
||||
// get peer process id, local communicator token, and tag from comment
|
||||
//
|
||||
|
||||
uint32_t peer = locComment.loccpuid;
|
||||
uint32_t comm;
|
||||
uint32_t tag;
|
||||
sscanf( locComment.comment.c_str(), "C%xT%x", &comm, &tag );
|
||||
char delim;
|
||||
|
||||
for( uint8_t i = 0; i < 4; i++ )
|
||||
{
|
||||
switch( i )
|
||||
{
|
||||
case 0: // 'C'
|
||||
{
|
||||
iss >> delim;
|
||||
assert( iss );
|
||||
assert( delim == 'C' );
|
||||
break;
|
||||
}
|
||||
case 1: // communicator token
|
||||
{
|
||||
iss >> std::hex >> comm;
|
||||
assert( iss );
|
||||
break;
|
||||
}
|
||||
case 2: // 'T'
|
||||
{
|
||||
iss >> delim;
|
||||
assert( iss );
|
||||
assert( delim == 'T' );
|
||||
break;
|
||||
}
|
||||
case 3: // tag
|
||||
default:
|
||||
{
|
||||
iss >> std::hex >> tag;
|
||||
assert( iss );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// temporary store user communication id and peer
|
||||
m_userCom.comIdsAndPeers.push_back(
|
||||
@ -2114,6 +2150,10 @@ DefinitionsC::CommentsC::processLocal(
|
||||
|
||||
break;
|
||||
}
|
||||
default: // DefRec_DefCommentS::TYPE_UNKNOWN
|
||||
{
|
||||
assert( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
return !error;
|
||||
@ -2486,7 +2526,7 @@ DefinitionsC::ProcessGroupsC::processLocal(
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
case DefRec_DefProcessGroupS::TYPE_OTHER:
|
||||
{
|
||||
// deflate group members
|
||||
deflateMembers( locProcGrp.members );
|
||||
@ -2496,6 +2536,10 @@ DefinitionsC::ProcessGroupsC::processLocal(
|
||||
|
||||
break;
|
||||
}
|
||||
default: // DefRec_DefProcessGroupS::TYPE_UNKNOWN
|
||||
{
|
||||
assert( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
return !error;
|
||||
|
@ -244,7 +244,7 @@ private:
|
||||
{
|
||||
// constructor for searching a communicator by its members
|
||||
OtherCommS( const uint32_t & _membersid )
|
||||
: membersid( _membersid ) {}
|
||||
: deftoken ( 0 ), membersid( _membersid ), index( 0 ) {}
|
||||
|
||||
// constructor for creating a new communicator entry
|
||||
OtherCommS( const uint32_t & _deftoken, const uint32_t & _membersid,
|
||||
|
@ -109,11 +109,11 @@ struct DefRec_DefCommentS : DefRec_BaseS
|
||||
typedef enum
|
||||
{
|
||||
TYPE_START_TIME, TYPE_STOP_TIME, TYPE_VT, TYPE_USER,
|
||||
TYPE_USRCOM_SEND, TYPE_USRCOM_RECV
|
||||
TYPE_USRCOM_SEND, TYPE_USRCOM_RECV, TYPE_UNKNOWN
|
||||
} CommentTypeT;
|
||||
|
||||
DefRec_DefCommentS()
|
||||
: DefRec_BaseS( DEF_REC_TYPE__DefComment ) {}
|
||||
: DefRec_BaseS( DEF_REC_TYPE__DefComment ), type( TYPE_UNKNOWN ) {}
|
||||
DefRec_DefCommentS( const uint32_t & _loccpuid, const uint32_t _orderidx,
|
||||
const CommentTypeT & _type, const std::string & _comment )
|
||||
: DefRec_BaseS( DEF_REC_TYPE__DefComment, _loccpuid, _orderidx ),
|
||||
@ -291,11 +291,12 @@ struct DefRec_DefProcessGroupS : DefRec_BaseS
|
||||
typedef enum
|
||||
{
|
||||
TYPE_NODE, TYPE_MPI_COMM_WORLD, TYPE_MPI_COMM_SELF, TYPE_MPI_COMM_OTHER,
|
||||
TYPE_OMP_TEAM, TYPE_GPU_COMM, TYPE_GPU_GROUP, TYPE_USER_COMM, TYPE_OTHER
|
||||
TYPE_OMP_TEAM, TYPE_GPU_COMM, TYPE_GPU_GROUP, TYPE_USER_COMM, TYPE_OTHER,
|
||||
TYPE_UNKNOWN
|
||||
} ProcessGroupTypeT;
|
||||
|
||||
DefRec_DefProcessGroupS()
|
||||
: DefRec_BaseS( DEF_REC_TYPE__DefProcessGroup ) {}
|
||||
: DefRec_BaseS( DEF_REC_TYPE__DefProcessGroup ), type( TYPE_UNKNOWN ) {}
|
||||
DefRec_DefProcessGroupS( const uint32_t & _loccpuid,
|
||||
const uint32_t & _deftoken, const ProcessGroupTypeT & _type,
|
||||
const std::string & _name, const uint32_t & _nmembers,
|
||||
|
@ -29,7 +29,7 @@ MarkersC * theMarkers = 0; // instance of class MarkersC
|
||||
// public methods
|
||||
//
|
||||
|
||||
MarkersC::MarkersC()
|
||||
MarkersC::MarkersC() : m_tkfacScope( 0 )
|
||||
{
|
||||
assert( theTokenFactory );
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user