Commit 3866f884 authored by hkrishna's avatar hkrishna

warning fixes for engine directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23639 18c085ea-50e0-402c-830e-de6fd14e8384
parent fab8851c
......@@ -225,8 +225,9 @@ protected:
<< " [" << minmax[0] << ", " << minmax[1] << "]" << endl;
std::vector<VISIT_LONG_LONG> hist(256, 0);
if(!avtDatasetExaminer::CalculateHistogram(ds, it->first, minmax[0], minmax[1], hist))
if(!avtDatasetExaminer::CalculateHistogram(ds, it->first, minmax[0], minmax[1], hist)) {
debug1 << "CalculateHistogram failed" << endl;
}
it->second = new Histogram;
for(int i = 0; i < 256; ++i)
......@@ -611,7 +612,7 @@ CumulativeQuery<CQCellIdentifier,
delete [] allIds;
delete [] allFrequencies;
for( int ts=0; ts<selectionPerTimeStep.size(); ++ts )
for( size_t ts=0; ts<selectionPerTimeStep.size(); ++ts )
{
delete [] allIdsPerTimeStep[ts];
delete [] allVariablesPerTimeStep[ts];
......@@ -856,11 +857,11 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::Summation(
typename CQSelection::const_iterator it;
for(it = cellFrequency.begin(); it != cellFrequency.end(); ++it)
{
if(it->second.frequency == nts)
if((unsigned int)it->second.frequency == nts)
{
selection[it->first] = it->second;
for( int ts=0; ts<nts; ++ts )
for( unsigned int ts=0; ts<nts; ++ts )
{
// cellsPerTimeStep is a const but the [] operator
// is not a const so use find instead which is a
......@@ -884,7 +885,7 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::Summation(
{
selection = cellFrequency;
for( int ts=0; ts<nts; ++ts )
for( unsigned int ts=0; ts<nts; ++ts )
selectionPerTimeStep[ts] = cellsPerTimeStep[ts];
}
}
......@@ -1517,7 +1518,7 @@ CumulativeQuery<CQCellIdentifier, CQSelection>::SelectAndHistogram(
double *allVariables = new double[totalCells];
int *index = new int[totalCells];
int i = 0;
//int i = 0;
// Create an index variable that we'll sort using another variable
// while storing the variables and ids in a one dimensional array.
......@@ -2597,7 +2598,7 @@ GetSelectionEx(avtDataObject_p dob, avtContract_p contract, const SelectionPrope
// the variables that we care about.
//
hist.SetInput(newdob);
for(int i = 0; i < prop2.GetVariables().size(); ++i)
for(size_t i = 0; i < prop2.GetVariables().size(); ++i)
hist.AddVariable(prop2.GetVariables()[i]);
newdob = hist.GetOutput();
......@@ -2701,7 +2702,7 @@ avtNamedSelection *
CumulativeQueryNamedSelectionExtension::GetSelection(avtDataObject_p dob,
const SelectionProperties &props, avtNamedSelectionCache &cache)
{
const char *mName = "CumulativeQueryNamedSelectionExtension::GetSelection: ";
//const char *mName = "CumulativeQueryNamedSelectionExtension::GetSelection: ";
avtNamedSelection *ns = NULL;
avtContract_p c0 = dob->GetContractFromPreviousExecution();
......
......@@ -128,7 +128,7 @@ DataNetwork::~DataNetwork(void)
if (!clone)
{
ReleaseData();
for (int i = 0 ; i < nodeList.size() ; i++)
for (size_t i = 0 ; i < nodeList.size() ; i++)
{
delete nodeList[i];
}
......
......@@ -216,6 +216,7 @@ const int INTERRUPT_MESSAGE_TAG = GetUniqueStaticMessageTag();
class ViewerRemoteProcess : public RemoteProcess
{
using RemoteProcess::Launch;
public:
ViewerRemoteProcess(const std::string &p) : RemoteProcess(p)
{
......@@ -622,8 +623,9 @@ Engine::Initialize(int *argc, char **argv[], bool sigs)
std::set_new_handler(Engine::NewHandler);
#endif
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "ENGINE started. pid: " << getpid() << endl;
}
#ifdef PARALLEL
{
char msg[1024];
......@@ -805,9 +807,10 @@ Engine::InitializeCompute()
{
std::ostringstream s;
s << "Setting up " << this->nDisplays << " GPUs for HW rendering";
if (DebugStream::Level3())
if (DebugStream::Level3()) {
debug3 << "Setting up X displays for " << this->nDisplays << " GPUs."
<< " Using X arguments: '" << this->X_Args << "'" << std::endl;
}
TimedCodeBlock(s.str(), this->SetupDisplay());
}
avtCallback::SetNowinMode(true);
......@@ -819,14 +822,16 @@ Engine::InitializeCompute()
#if defined(PARALLEL) && defined(HAVE_ICET)
if(this->useIceT)
{
if (DebugStream::Level2())
if (DebugStream::Level2()) {
debug2 << "Using IceT network manager." << std::endl;
}
netmgr = new IceTNetworkManager;
}
else
{
if (DebugStream::Level2())
if (DebugStream::Level2()) {
debug2 << "Using standard network manager." << std::endl;
}
netmgr = new NetworkManager;
}
#else
......@@ -1447,8 +1452,9 @@ Engine::ConnectViewer(int *argc, char **argv[])
}
CATCH(IncompatibleVersionException)
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "The engine has a different version than its client." << endl;
}
noFatalExceptions = false;
}
CATCH(CouldNotConnectException)
......@@ -1579,8 +1585,9 @@ Engine::PAR_EventLoop()
overrideTimeoutEnabled = false;
idleTimeoutEnabled = true;
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Resetting idle timeout to " << idleTimeoutMins << " minutes." << endl;
}
ResetTimeout(idleTimeoutMins * 60);
// Get the next message length.
......@@ -1603,8 +1610,9 @@ Engine::PAR_EventLoop()
// We have work to do, so reset the alarm.
idleTimeoutEnabled = false;
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Resetting execution timeout to " << executionTimeoutMins << " minutes." << endl;
}
ResetTimeout(executionTimeoutMins * 60);
// Process the state information.
......@@ -1732,8 +1740,9 @@ Engine::EventLoop()
overrideTimeoutEnabled = false;
idleTimeoutEnabled = true;
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Resetting idle timeout to " << idleTimeoutMins << " minutes." << endl;
}
ResetTimeout(idleTimeoutMins * 60);
//
......@@ -1748,16 +1757,18 @@ Engine::EventLoop()
{
// We've got some work to do. Reset the alarm.
idleTimeoutEnabled = false;
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Resetting execution timeout to " << executionTimeoutMins << " minutes." << endl;
}
ResetTimeout(executionTimeoutMins * 60);
// Process input.
ProcessInput();
idleTimeoutEnabled = true;
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Resetting idle timeout to " << idleTimeoutMins << " minutes." << endl;
}
ResetTimeout(idleTimeoutMins * 60);
}
CATCH(LostConnectionException)
......@@ -1982,10 +1993,11 @@ Engine::ProcessCommandLine(int argc, char **argv)
if(!StringHelpers::str_to_u_numeric<size_t>(argv[i+1],
&this->nDisplays))
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "Could not parse '-n-gpus-per-node' argument "
<< "'" << argv[i+1] << "'. "
<< "Disabling hardware acceleration!" << std::endl;
}
this->nDisplays = 0;
haveHWAccel = false;
}
......@@ -2040,8 +2052,9 @@ Engine::ProcessCommandLine(int argc, char **argv)
{
if (!PAR_Rank())
cerr << "-timeout option will soon be deprecated. Use -idle-timeout or -exec-timeout." << endl;
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "-timeout option will soon be deprecated. Use -idle-timeout or -exec-timeout." << endl;
}
idleTimeoutMins = (int) to;
}
else if (strcmp(argv[i], "-idle-timeout") == 0)
......@@ -2053,8 +2066,9 @@ Engine::ProcessCommandLine(int argc, char **argv)
{
if (!PAR_Rank())
cerr << "\"" << argv[i] << "\" option ignored due to bad argument." << endl;
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "\"" << argv[i] << "\" option ignored due to bad argument." << endl;
}
}
i++;
}
......@@ -2062,8 +2076,9 @@ Engine::ProcessCommandLine(int argc, char **argv)
{
if (!PAR_Rank())
cerr << "\"" << argv[i] << "\" option ignored due to missing argument." << endl;
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "\"" << argv[i] << "\" option ignored due to missing argument." << endl;
}
}
}
else if (strcmp(argv[i], "-ui-bcast-thresholds") == 0)
......@@ -2093,6 +2108,8 @@ Engine::ProcessCommandLine(int argc, char **argv)
}
#ifdef PARALLEL
MPIXfer::SetUIBcastThresholds(nanoSecsOfSleeps, secsOfSpinBeforeSleeps);
#else
(void) secsOfSpinBeforeSleeps;
#endif
}
else
......@@ -2205,9 +2222,10 @@ Engine::ProcessCommandLine(int argc, char **argv)
}
else
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "Ignoring IceT request: currently incompatible with "
"parallel HW acceleration.\n";
}
}
}
else if (strcmp(argv[i], "-no-icet") == 0)
......@@ -2354,9 +2372,10 @@ WriteByteStreamToSocket(NonBlockingRPC *rpc, Connection *vtkConnection,
rpc->SendReply(totalSize);
int writeData = visitTimer->StartTimer();
int nStrings = do_str.GetNStrings();
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "sending " << totalSize << " bytes to the viewer " << nStrings
<< " from strings." << endl;
}
const int buff_size = 4096;
unsigned char buffer[buff_size];
......@@ -2407,8 +2426,9 @@ WriteByteStreamToSocket(NonBlockingRPC *rpc, Connection *vtkConnection,
}
}
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "Number of actual direct writes = " << strings_written << endl;
}
char info[124];
SNPRINTF(info, 124, "Writing %d bytes to socket", totalSize);
......@@ -2907,9 +2927,10 @@ Engine::WriteData(NonBlockingRPC *rpc, avtDataObjectWriter_p &writer,
(currentTotalGlobalCellCount + currentCellCount
> scalableThreshold))
{
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "exceeded scalable threshold of " << scalableThreshold
<< endl;
}
thresholdExceeded = true;
}
......@@ -2934,8 +2955,9 @@ Engine::WriteData(NonBlockingRPC *rpc, avtDataObjectWriter_p &writer,
if (DebugStream::Level5())
{
debug5 << "Exceeded scalable threshold of " << scalableThreshold << endl;
if (reducedCurrentCellCount == INT_MAX-1)
if (reducedCurrentCellCount == INT_MAX-1) {
debug5 << "This was due to 'oridinary' overflow in summing cell counts" << endl;
}
}
}
thresholdExceeded = true;
......@@ -2961,8 +2983,9 @@ Engine::WriteData(NonBlockingRPC *rpc, avtDataObjectWriter_p &writer,
if (thresholdExceeded && !sendDataAnyway)
{
// dummy a null data object message to send to viewer
if (DebugStream::Level2())
if (DebugStream::Level2()) {
debug2 << "Sending back null dataset message.\n";
}
avtNullData_p nullData = new avtNullData(NULL,AVT_NULL_DATASET_MSG);
CopyTo(ui_dob, nullData);
}
......@@ -2988,8 +3011,9 @@ Engine::WriteData(NonBlockingRPC *rpc, avtDataObjectWriter_p &writer,
}
else
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "Sending error: " << v.GetErrorMessage() << std::endl;
}
rpc->SendError(v.GetErrorMessage());
}
......@@ -3030,9 +3054,10 @@ Engine::WriteData(NonBlockingRPC *rpc, avtDataObjectWriter_p &writer,
}
else
{
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "not sending data to proc 0 because the data object "
<< "does not require parallel streams." << endl;
}
}
}
......@@ -3400,9 +3425,10 @@ Engine::EngineInitializeProgressCallback(void *data, int nStages)
}
else
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "ERROR: EngineInitializeProgressCallback called "
<< "with nStages == 0" << endl;
}
}
}
......@@ -3786,13 +3812,13 @@ ProcessAttributes *
Engine::GetProcessAttributes()
{
// Only allocate procAtts once.
if (procAtts == NULL)
if (procAtts == NULL) {
procAtts = new ProcessAttributes;
}
// Populate procAtts.
{
unsigned long m_size, m_rss;
double m_size_mb, m_rss_mb;
double m_size_mb/*, m_rss_mb*/;
intVector pids;
intVector ppids;
intVector memusage;
......@@ -3807,6 +3833,7 @@ Engine::GetProcessAttributes()
#endif
#ifdef PARALLEL
char myHost[2*MPI_MAX_PROCESSOR_NAME];
int strLen;
MPI_Get_processor_name(myHost, &strLen);
......@@ -3819,13 +3846,13 @@ Engine::GetProcessAttributes()
//Convert to megabytes
m_size_mb = ( (double)m_size / 1048576.0);
m_rss_mb = ( (double)m_rss / 1048576.0);
//m_rss_mb = ( (double)m_rss / 1048576.0);
// collect pids and host names
int *allPids;
int *allPpids;
char *allHosts;
int *allMemusage;
int *allPids = NULL;
int *allPpids = NULL;
char *allHosts = NULL;
int *allMemusage = NULL;
if (PAR_Rank() == 0)
{
allPids = new int[PAR_Size()];
......@@ -3859,6 +3886,7 @@ Engine::GetProcessAttributes()
delete [] allHosts;
delete [] allMemusage;
}
#else
pids.push_back(myPid);
......@@ -3872,7 +3900,7 @@ Engine::GetProcessAttributes()
//Convert to megabytes
m_size_mb = ( (double)m_size / 1048576.0);
m_rss_mb = ( (double)m_rss / 1048576.0);
//m_rss_mb = ( (double)m_rss / 1048576.0);
memusage.push_back(m_size_mb);
bool isParallel = false;
#endif
......@@ -3882,9 +3910,11 @@ Engine::GetProcessAttributes()
procAtts->SetHosts(hosts);
procAtts->SetMemory(memusage);
procAtts->SetIsParallel(isParallel);
}
return procAtts;
}
// ****************************************************************************
......@@ -4055,9 +4085,10 @@ Engine::SetupDisplay()
}
else
{
if (DebugStream::Level1())
if (DebugStream::Level1()) {
debug1 << "Display initialization failed. Rendering in this state "
<< "has undefined results ..." << std::endl;
}
}
}
......@@ -4083,8 +4114,9 @@ ResetEngineTimeout(void *p, int secs)
e->SetOverrideTimeout(secs*60);
if (e->IsIdleTimeoutEnabled() == false)
{
if (DebugStream::Level5())
if (DebugStream::Level5()) {
debug5 << "ResetEngineTimeout: Overriding timeout to " << secs << " seconds." << endl;
}
}
else
{
......
......@@ -1409,7 +1409,7 @@ RPCExecutor<DefineVirtualDatabaseRPC>::Execute(DefineVirtualDatabaseRPC *rpc)
<< ", time=" << rpc->GetTime()
<< ", numStates=" << rpc->GetDatabaseFiles().size()
<< endl;
for (int i = 0; i < rpc->GetDatabaseFiles().size(); ++i)
for (size_t i = 0; i < rpc->GetDatabaseFiles().size(); ++i)
debug5 << "file["<<i<<"]="<<rpc->GetDatabaseFiles()[i].c_str() << endl;
TRY
......@@ -1495,7 +1495,7 @@ RPCExecutor<RenderRPC>::Execute(RenderRPC *rpc)
debug2 << "Executing RenderRPC for the following plots" << endl;
debug2 << " ";
for (int i = 0; i < rpc->GetIDs().size(); i++)
for (size_t i = 0; i < rpc->GetIDs().size(); i++)
debug2 << rpc->GetIDs()[i] << ", ";
debug2 << endl;
......
......@@ -327,7 +327,7 @@ IceTNetworkManager::Render(bool checkThreshold, intVector networkIds, bool getZB
this->RenderSetup(networkIds, getZBuffer, annotMode, windowID, leftEye);
bool plotDoingTransparencyOutsideTransparencyActor = false;
for(int i = 0 ; i < networkIds.size() ; i++)
for(size_t i = 0 ; i < networkIds.size() ; i++)
{
workingNet = NULL;
UseNetwork(networkIds[i]);
......
......@@ -603,6 +603,7 @@ LoadBalancer::Reduce(avtContract_p input)
// data replication.
//
bool dataReplicationRequested = input->ReplicateSingleDomainOnAllProcessors();
(void) dataReplicationRequested; /// variable used in parallel env..
input->SetReplicateSingleDomainOnAllProcessors(false);
//
......@@ -649,7 +650,7 @@ LoadBalancer::Reduce(avtContract_p input)
UpdateProgress(pipelineInfo[input->GetPipelineIndex()].current,
(int)list.size());
pipelineInfo[input->GetPipelineIndex()].current++;
if (pipelineInfo[input->GetPipelineIndex()].current == list.size())
if (pipelineInfo[input->GetPipelineIndex()].current == (int)list.size())
pipelineInfo[input->GetPipelineIndex()].complete = true;
return new_data;
}
......@@ -707,7 +708,7 @@ LoadBalancer::Reduce(avtContract_p input)
UpdateProgress(pipelineInfo[input->GetPipelineIndex()].current,
domainListForStreaming.size());
pipelineInfo[input->GetPipelineIndex()].current++;
if (pipelineInfo[input->GetPipelineIndex()].current == domainListForStreaming.size())
if (pipelineInfo[input->GetPipelineIndex()].current == (int)domainListForStreaming.size())
{
pipelineInfo[input->GetPipelineIndex()].complete = true;
domainListForStreaming.clear();
......@@ -762,15 +763,15 @@ LoadBalancer::Reduce(avtContract_p input)
}
else if (theScheme == LOAD_BALANCE_STRIDE_ACROSS_BLOCKS)
{
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (j % nProcs == rank)
if (j % nProcs == (size_t)rank)
mylist.push_back(list[j]);
}
}
else if (theScheme == LOAD_BALANCE_ABSOLUTE)
{
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (list[j] % nProcs == rank)
mylist.push_back(list[j]);
......@@ -782,9 +783,9 @@ LoadBalancer::Reduce(avtContract_p input)
IOInfo &ioInfo(ioMap[lbInfo.db]);
const HintList &hints(ioInfo.ioInfo.GetHints());
for (int j = 0 ; j < list.size() ; j++)
for (size_t j = 0 ; j < list.size() ; j++)
{
if (hints.size() >= rank)
if (hints.size() >= (size_t)rank)
{
const vector<int> &doms = hints[rank];
int ndoms = doms.size();
......@@ -804,7 +805,7 @@ LoadBalancer::Reduce(avtContract_p input)
// all procs randomly jumble the list of domain ids
// all procs compute same jumbled list due to same seed
// [ which won't be true on a heterogeneous platform ]
int j;
size_t j;
vector<int> jumbledList = list;
srand(0xDeadBeef);
for (j = 0 ; j < list.size() * 5; j++)
......@@ -818,7 +819,7 @@ LoadBalancer::Reduce(avtContract_p input)
// now, do round-robin assignment from the jumbled list
for (j = 0 ; j < list.size() ; j++)
{
if (j % nProcs == rank)
if (j % nProcs == (size_t)rank)
mylist.push_back(jumbledList[j]);
}
}
......@@ -854,7 +855,7 @@ LoadBalancer::Reduce(avtContract_p input)
trav.GetDomainList(domainList);
// Make a work list and a completed list
int totaldomains = domainList.size();
size_t totaldomains = domainList.size();
deque<int> incomplete(domainList.begin(), domainList.end());
vector<int> complete;
......@@ -934,7 +935,7 @@ LoadBalancer::Reduce(avtContract_p input)
// count the number of processors which have
// this file opened
int nopen = 0;
for (int j=0; j<ioInfo.files.size(); j++)
for (size_t j=0; j<ioInfo.files.size(); j++)
if (ioInfo.files[j].count(fileno) > 0)
nopen++;
if (nopen < minopen)
......@@ -1082,18 +1083,19 @@ LoadBalancer::AddDatabase(const string &db, avtDatabase *db_ptr, int time)
debug4 << "LoadBalancer::AddDatabase - db=" << db.c_str() << endl;
debug4 << " iohints=[";
const HintList &hints = io.GetHints();
for (int i=0; i<hints.size(); i++)
for (size_t i=0; i<hints.size(); i++)
{
debug4 << " {";
for (int j=0; j<hints[i].size(); j++)
for (size_t j=0; j<hints[i].size(); j++)
{
ioMap[db].fileMap[hints[i][j]] = i;
debug4 << hints[i][j];
if (j<hints[i].size()-1) debug4 << ",";
if (j<hints[i].size()-1) { debug4 << ","; }
}
debug4 << "}";
if (i<hints.size()-1)
if (i<hints.size()-1) {
debug4 << "\n ";
}
}
debug4 << "] " << endl;
}
......@@ -1141,7 +1143,7 @@ LoadBalancer::AddPipeline(const string &db)
void
LoadBalancer::ResetPipeline(int index)
{
if (index < 0 || index >= pipelineInfo.size())
if (index < 0 || (size_t)index >= pipelineInfo.size())
{
debug1 << "Given an invalid pipeline index to reset (" << index << ")."
<< endl;
......
......@@ -267,7 +267,7 @@ MPIXfer::Process()
{
if(PAR_UIProcess())
{
int i, msgLength = curLength + sizeof(int)*2;
size_t i, msgLength = curLength + sizeof(int)*2;
#ifdef VISIT_BLUE_GENE_P
// Make the buffer be 32-byte aligned
unsigned char *buf = 0;
......@@ -464,8 +464,9 @@ MPIXfer::VisIt_MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root,
if (nanoSecsOfSleeps <= 0)
{
static bool first = true;
if (first)
if (first) {
debug5 << "Using MPI's Bcast; not VisIt_MPI_Bcast" << endl;
}
first = false;
MPI_Bcast(buf, count, datatype, root, comm);
return 2;
......@@ -539,9 +540,10 @@ MPIXfer::VisIt_MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root,
double idleTime = TOA_THIS_LINE - startedIdlingAt;
if (idleTime > secsOfSpinBeforeSleeps)
{
if (first)
if (first) {
debug5 << "VisIt_MPI_Bcast started using " << nanoSecsOfSleeps / 1.0e9
<< " seconds of nanosleep" << endl;
}
first = false;
#if defined(_WIN32)
SleepEx((DWORD)(nanoSecsOfSleeps/1e6), false);
......
......@@ -251,7 +251,7 @@ NetnodeFilter::ReleaseData(void)
filter->ReleaseData();