made all functions local
@@ -337,34 +337,32 @@ avtDatasetExaminer::GetDataExtents(avtDataset_p &ds, double *de,
const char *varname,
bool connectedNodesOnly)
{
- if (*ds == NULL || *(ds->GetDataTree()) == NULL)
- return false;
+ bool foundExtents = false;
- if (varname == NULL)
+ de[0] = +DBL_MAX;
+ de[1] = -DBL_MAX;
+
+ if (*ds != NULL && *(ds->GetDataTree()) != NULL)
{
+ if (varname == NULL)
varname = ds->GetInfo().GetAttributes().GetVariableName().c_str();
- }
avtDataTree_p dataTree = ds->dataTree;
- bool foundExtents = false;
- de[0] = +DBL_MAX;
- de[1] = -DBL_MAX;
-
GetVariableRangeArgs gvra;
gvra.varname = varname;
gvra.extents = de;
gvra.connectedNodesOnly = connectedNodesOnly;
- if (*dataTree != NULL)
- {
+
dataTree->Traverse(CGetDataExtents, (void *) &gvra, foundExtents);
- }
if (!foundExtents)
{
debug1 << "Unable to determine data extents -- dataset needs an "
<< "update" << endl;
}
+ }
+
return foundExtents;
}
@@ -814,14 +812,6 @@ avtDatasetExaminer::GetNumberOfNodes(avtDataset_p &ds, VISIT_LONG_LONG &nReal,
// Programmer: Hank Childs
// Creation: May 21, 2010
//
-// Modifications:
-// Brad Whitlock, Tue Jun 14 13:41:24 PST 2011
-// Don't return early if any processors failed. Those processors will just
-// not contribute to the results. We still return false in the event that
-// any processors failed though so we can test for it. I made this change
-// because I was calling this routine in a filter where some processors
-// had no data and it caused me to have NO histogram information.
-//
// ****************************************************************************
bool
@@ -835,6 +825,7 @@ avtDatasetExaminer::CalculateHistogram(avtDataset_p &ds,
bool err = false;
CalculateHistogramArgs args;
int t1 = visitTimer->StartTimer();
+
if (*dataTree != NULL)
{
args.min = min;
@@ -842,27 +833,13 @@ avtDatasetExaminer::CalculateHistogram(avtDataset_p &ds,
args.variable = var;
args.numVals.resize(numvals.size(), 0);
dataTree->Traverse(CCalculateHistogram, (void *) &args, err);
- }
- visitTimer->StopTimer(t1, "Per-processor histogram calculation");
-
- int t2 = visitTimer->StartTimer();
- int iFailed = (err ? 1 : 0);
- int somebodyFailed = UnifyMaximumValue(iFailed);
- // Create a vector that will serve as input to the global sum. We put
- // zeroes if this processor has no data. Otherwise, we use the histogram.
- std::vector<VISIT_LONG_LONG> input(numvals.size(), 0);
if( !err )
{
for(size_t i = 0; i < numvals.size(); ++i)
- input[i] = args.numVals[i];
+ numvals[i] = args.numVals[i];
}
-
- // Sum the vector element-wise, placing results in numvals.
- SumLongLongArrayAcrossAllProcessors(&input[0], &(numvals[0]),
- static_cast<int>(numvals.size()));
- visitTimer->StopTimer(t2, "Parallel processing of histogram");
-
- return somebodyFailed;
}
+ return err;
+}
