Commit b55be6fa authored by hrchilds's avatar hrchilds
Browse files

Update from February 23, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@182 18c085ea-50e0-402c-830e-de6fd14e8384
parent 07c1a17b
......@@ -6,7 +6,7 @@
#include <avtDatasetExaminer.h>
#include <avtParallel.h>
#include <snprintf.h>
// ****************************************************************************
// Method: avtNumNodesQuery constructor
......@@ -47,7 +47,9 @@ avtNumNodesQuery::~avtNumNodesQuery()
// Creation: February 18, 2004
//
// Modifications:
//
// Brad Whitlock, Mon Feb 23 12:11:02 PDT 2004
// I made it use SNPRINTF to get it to build on Linux.
//
// ****************************************************************************
void
......@@ -64,14 +66,14 @@ avtNumNodesQuery::PerformQuery(QueryAttributes *qA)
avtDataset_p input = GetTypedInput();
int totalNodes = 0;
char msg[1024];
char msg[200];
totalNodes = avtDatasetExaminer::GetNumberOfNodes(input);
SumIntAcrossAllProcessors(totalNodes);
if (OriginalData())
sprintf(msg, "The original number of nodes is %d.", totalNodes);
SNPRINTF(msg, 200, "The original number of nodes is %d.", totalNodes);
else
sprintf(msg, "The actual number of nodes is %d.", totalNodes);
SNPRINTF(msg, 200, "The actual number of nodes is %d.", totalNodes);
qA->SetResultsMessage(msg);
qA->SetResultsValue((double)totalNodes);
......
......@@ -6,7 +6,7 @@
#include <avtDatasetExaminer.h>
#include <avtParallel.h>
#include <snprintf.h>
// ****************************************************************************
// Method: avtNumZonesQuery constructor
......@@ -47,6 +47,8 @@ avtNumZonesQuery::~avtNumZonesQuery()
// Creation: February 18, 2004
//
// Modifications:
// Brad Whitlock, Mon Feb 23 12:11:02 PDT 2004
// I made it use SNPRINTF to get it to build on Linux.
//
// ****************************************************************************
......@@ -65,16 +67,16 @@ avtNumZonesQuery::PerformQuery(QueryAttributes *qA)
avtDataset_p input = GetTypedInput();
int totalZones [2] = {0, 0};
char msg[1024];
char msg[200];
if (gt != AVT_HAS_GHOSTS)
{
totalZones[0] = avtDatasetExaminer::GetNumberOfZones(input);
SumIntAcrossAllProcessors(totalZones[0]);
if (OriginalData())
sprintf(msg, "The original number of zones is %d.", totalZones[0]);
SNPRINTF(msg, 200, "The original number of zones is %d.", totalZones[0]);
else
sprintf(msg, "The actual number of zones is %d.", totalZones[0]);
SNPRINTF(msg, 200, "The actual number of zones is %d.", totalZones[0]);
qA->SetResultsValue((double)totalZones[0]);
}
else
......@@ -84,12 +86,12 @@ avtNumZonesQuery::PerformQuery(QueryAttributes *qA)
SumIntArrayAcrossAllProcessors(totalZones, summedTZ, 2);
if (OriginalData())
{
sprintf(msg, "The original number of zones is %d.\n"
SNPRINTF(msg, 200, "The original number of zones is %d.\n"
"The number of ghost zones is %d.", summedTZ[0], summedTZ[1]);
}
else
{
sprintf(msg, "The actual number of zones is %d.\n"
SNPRINTF(msg, 200, "The actual number of zones is %d.\n"
"The number of ghost zones is %d.", summedTZ[0], summedTZ[1]);
}
double results[2] = {(double) summedTZ[0], (double) summedTZ[1]};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment