Commit faf320e9 authored by hrchilds's avatar hrchilds

Update from October 21, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@344 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5c7aaca3
......@@ -336,6 +336,10 @@ $0 = shift @ARGV;
# Mark C. Miller, Tue Oct 5 12:56:54 PDT 2004
# Changed appearance of '-help' option. Added a '-fullhelp' option
#
# Jeremy Meredith, Wed Oct 20 16:31:08 PDT 2004
# Fixed security key for totalview. Made "visit -env" print to
# stdout instead of stderr so it is easier to capture/redirect.
#
###############################################################################
......@@ -1403,7 +1407,7 @@ else
{
# Run totalview
@debugcmd = ("totalview", $exe_name, "-a", "-dograb", @visitargs);
push(@debugcmd, "-key $security_key") if ($security_key_set);
if ($security_key_set) { push @debugcmd, "-key", $security_key; }
print STDERR "Running: @debugcmd\n";
$exec_totalview_failed = 0;
exec @debugcmd or $exec_totalview_failed = 1;
......@@ -1593,7 +1597,7 @@ sub RunComponent {
sub PrintEnvironment {
if ($envonly)
{
print STDERR <<"EOF"
print STDOUT <<"EOF"
LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}
LD_LIBRARY32_PATH=$ENV{LD_LIBRARY32_PATH}
LD_LIBRARYN32_PATH=$ENV{LD_LIBRARYN32_PATH}
......
......@@ -92,6 +92,10 @@
# Kathleen Bonnell, Thu Sep 2 16:45:02 PDT 2004
# Removed queryMultiWindow.py from skipList for parallel and
# scalable,parallel.
#
# Jeremy Meredith, Thu Oct 21 11:54:58 PDT 2004
# Removed reflect2.py from skip list for scalable,parallel.
#
# ----------------------------------------------------------------------------
# list of users who want email every night with the log file
......@@ -220,8 +224,7 @@ modes="serial parallel scalable,parallel"
# set list of tests/modes to skip
skipList="scalable,parallel:tests/hybrid/lineout.py \
scalable,parallel:tests/rendering/volume.py \
scalable,parallel:tests/operators/reflect2.py"
scalable,parallel:tests/rendering/volume.py"
# run the test(s)
error=0
......
......@@ -6377,6 +6377,10 @@ avtGenericDatabase::QueryMaterial(const std::string &varName, const int dom,
// Kathleen Bonnell, Wed Dec 17 15:04:57 PST 2003
// Updated args list to include multiple types of Coordinates.
//
// Kathleen Bonnell, Wed Oct 20 17:01:38 PDT 2004
// Replaced get-cell-center code with single call to
// vtkVisItUtility::GetCellCenter.
//
// ****************************************************************************
bool
......@@ -6543,12 +6547,7 @@ avtGenericDatabase::QueryNodes(const std::string &varName, const int dom,
}
else if (ppt[0] == FLT_MAX)
{
vtkCell *cell = ds->GetCell(zone);
float parametricCenter[3];
float *weights = new float[cell->GetNumberOfPoints()];
int subId = cell->GetParametricCenter(parametricCenter);
cell->EvaluateLocation(subId, parametricCenter, ppt, weights);
delete [] weights;
vtkVisItUtility::GetCellCenter(ds->GetCell(zone), ppt);
}
rv = true;
}
......@@ -6683,6 +6682,9 @@ avtGenericDatabase::QueryMesh(const std::string &varName, const int ts,
// Kathleen Bonnell, Thu Sep 23 17:48:37 PDT 2004
// Added args to support ghost-zone retrieval if requested.
//
// Kathleen Bonnell, Thu Oct 21 18:02:50 PDT 2004
// Correctly test whether a zone is ghost or not.
//
// ****************************************************************************
bool
......@@ -6782,7 +6784,7 @@ avtGenericDatabase::QueryZones(const string &varName, const int dom,
idptr = ids->GetPointer(0);
for (int i = 0;i < nCells; i++)
{
if (ghosts && ghosts[idptr[i]] == 1)
if (ghosts && ghosts[idptr[i]] > 0)
{
if (includeGhosts)
{
......@@ -7408,6 +7410,10 @@ avtGenericDatabase::GetDomainName(const std::string &varName, const int ts,
// Hank Childs, Fri Aug 27 16:16:52 PDT 2004
// Rename ghost data arrays.
//
// Kathleen Bonnell, Wed Oct 20 17:01:38 PDT 2004
// Replaced get-cell-center code with single call to
// vtkVisItUtility::GetCellCenter.
//
// ****************************************************************************
bool
......@@ -7443,11 +7449,7 @@ avtGenericDatabase::QueryCoords(const string &varName, const int dom,
ijk[2] * (dims[0]-1) * (dims[1]-1);
}
}
vtkCell *cell = ds->GetCell(zone);
float parametricCenter[3];
float weights[28];
int subId = cell->GetParametricCenter(parametricCenter);
cell->EvaluateLocation(subId, parametricCenter, coord, weights);
vtkVisItUtility::GetCellCenter(ds->GetCell(zone), coord);
rv = true;
}
else
......
......@@ -41,6 +41,9 @@
# Jeremy Meredith, Wed Jul 7 12:12:52 PDT 2004
# I changed _ser.o to simply be .o.
#
# Jeremy Meredith, Wed Sep 1 09:56:48 PDT 2004
# Added avtTiledImageCompositor.
#
##############################################################################
##
......@@ -54,17 +57,35 @@
##
## Files...
##
SRC=avtCondenseDatasetFilter.C avtContourFilter.C \
avtCoordSystemConvert.C avtCurrentExtentFilter.C avtCurveConstructorFilter.C \
avtFacelistFilter.C avtFeatureEdgesFilter.C avtGhostZoneAndFacelistFilter.C \
avtGhostZoneFilter.C avtImageCommunicator.C avtImageCompositer.C \
avtPointToGlyphFilter.C avtRayCompositer.C avtRayTracer.C \
avtResampleFilter.C avtSamplePointCommunicator.C avtSamplePointExtractor.C \
avtSamplePointToSurfaceFilter.C avtShiftCenteringFilter.C \
avtSimilarityTransformFilter.C avtSmoothPolyDataFilter.C \
avtSummationFilter.C avtTransform.C avtVertexNormalsFilter.C \
avtWholeImageCompositerWithZ.C avtWholeImageCompositerNoZ.C \
avtWorldSpaceToImageSpaceTransform.C
SRC=\
avtCondenseDatasetFilter.C \
avtContourFilter.C \
avtCoordSystemConvert.C \
avtCurrentExtentFilter.C \
avtCurveConstructorFilter.C \
avtFacelistFilter.C \
avtFeatureEdgesFilter.C \
avtGhostZoneAndFacelistFilter.C \
avtGhostZoneFilter.C \
avtImageCommunicator.C \
avtImageCompositer.C \
avtPointToGlyphFilter.C \
avtRayCompositer.C \
avtRayTracer.C \
avtResampleFilter.C \
avtSamplePointCommunicator.C \
avtSamplePointExtractor.C \
avtSamplePointToSurfaceFilter.C \
avtShiftCenteringFilter.C \
avtSimilarityTransformFilter.C \
avtSmoothPolyDataFilter.C \
avtSummationFilter.C \
avtTiledImageCompositor.C \
avtTransform.C \
avtVertexNormalsFilter.C \
avtWholeImageCompositerWithZ.C \
avtWholeImageCompositerNoZ.C \
avtWorldSpaceToImageSpaceTransform.C
CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
......
// ************************************************************************* //
// avtTiledImageCompositor.C //
// ************************************************************************* //
#include <math.h>
#ifdef PARALLEL
#include <mpi.h>
#endif
#include <avtParallel.h>
#include <avtTiledImageCompositor.h>
#include <vtkImageData.h>
#include <ImproperUseException.h>
// ****************************************************************************
// Function: AreaOwned
//
// Purpose:
// Returns the x,y lower (inclusive) limit and the x,y upper (exclusive)
// limit on the region owned by any particular processor when doing
// parallel scalable rendering with transparency and tiled image
// compositing.
//
// NOTE: THIS CODE IS DUPLICATED IN vtkParallelImageSpaceRedistributor.C
//
// Programmer: Jeremy Meredith
// Creation: September 1, 2004
//
// ****************************************************************************
static void AreaOwned(int rank, int size, int w, int h,
int &x1,int &y1, int &x2,int &y2)
{
x1 = 0;
x2 = w;
y1 = (h*rank)/size;
y2 = ((h*(rank+1))/size);
}
// ****************************************************************************
// Constructor: avtTiledImageCompositor::avtTiledImageCompositor
//
// Programmer: Jeremy Meredith
// Creation: August 30, 2004
//
// Modifications:
//
// ****************************************************************************
avtTiledImageCompositor::avtTiledImageCompositor()
{
chunkSize = 1000000;
}
// ****************************************************************************
// Destructor: avtTiledImageCompositor::~avtTiledImageCompositor
//
// Programmer: Jeremy Meredith
// Creation: Mon Aug 30 15:53:33 PDT 2004
//
// ****************************************************************************
avtTiledImageCompositor::~avtTiledImageCompositor()
{
inputImages.clear();
}
// ****************************************************************************
// Method: Execute
//
// Purpose: Perform the composition
//
// Programmer: Jeremy Meredith
// Creation: August 30, 2004
//
// ****************************************************************************
void
avtTiledImageCompositor::Execute(void)
{
#ifdef PARALLEL
int rank = PAR_Rank();
int size = PAR_Size();
if (inputImages.size() != 1)
{
EXCEPTION1(ImproperUseException, "avtTiledImageCompositor expected "
"only a single input image per processor.");
}
// Get the whole image size
int width, height;
inputImages[0]->GetImage().GetSize(&height, &width);
// Figure out how much of the screen I own
int x1,y1,x2,y2;
AreaOwned(rank, size, width, height, x1,y1,x2,y2);
int mywidth = x2 - x1;
int myheight = y2 - y1;
unsigned char *inrgb = inputImages[0]->GetImage().GetRGBBuffer();
// Create an output image if we are the root process
vtkImageData *outputImageData = NULL;
unsigned char *outrgb = NULL;
if (rank == mpiRoot)
{
outputImageData = avtImageRepresentation::NewImage(width, height);
outrgb = (unsigned char *)outputImageData->GetScalarPointer(0,0,0);
}
// Determine how many pixels need to be sent by each process
// Note -- count is for each RGB component separately (thus the "*3")
int pixelSize = mywidth * myheight * 3;
int *pixelSizes = (rank == mpiRoot) ? new int[size] : NULL;
MPI_Gather(&pixelSize, 1, MPI_INT, pixelSizes, 1, MPI_INT,
mpiRoot, MPI_COMM_WORLD);
// Count 'em up
// ... okay, so there's probably no point ....
// Gather the pixels
int *displacements = NULL;
if (rank == mpiRoot)
{
displacements = new int[size];
displacements[0] = 0;
for (int i=1; i<size; i++)
{
displacements[i] = displacements[i-1] + pixelSizes[i-1];
}
}
// NOTE: assumes all pixels are contiguous in memory!
MPI_Gatherv(&inrgb[3*(width*y1+x1)], pixelSize, MPI_UNSIGNED_CHAR,
outrgb, pixelSizes, displacements, MPI_UNSIGNED_CHAR,
mpiRoot, MPI_COMM_WORLD);
// Set the output
avtImageRepresentation theOutput(outputImageData);
SetOutputImage(theOutput);
// Free the memory (yes, it is safe not to check for NULL in C++)
delete[] pixelSizes;
delete[] displacements;
#else
SetOutputImage(inputImages[0]->GetImage());
#endif
}
// ************************************************************************* //
// avtTiledImageCompositor.h //
// ************************************************************************* //
#ifndef AVT_TILED_IMAGE_COMPOSITOR_H
#define AVT_TILED_IMAGE_COMPOSITOR_H
#include <filters_exports.h>
#ifdef PARALLEL
#include <mpi.h>
#endif
#include <avtImageCompositer.h>
// ****************************************************************************
// Class: avtTiledImageCompositor
//
// Purpose:
// Composes images that have disparate spatial regions. In other words,
// it assumes each processor owns some screen-space tile of the whole
// image and compositing need not use the Z-buffer at all.
//
// Programmer: Jeremy Meredith
// Creation: August 30, 2004
//
// ****************************************************************************
class AVTFILTERS_API avtTiledImageCompositor : public avtImageCompositer
{
public:
avtTiledImageCompositor();
virtual ~avtTiledImageCompositor();
const char *GetType(void);
const char *GetDescription(void);
void SetChunkSize(const int chunkSize);
int GetChunkSize() const;
void Execute();
private:
int chunkSize;
};
inline const char* avtTiledImageCompositor::GetType()
{ return "avtTiledImageCompositor";}
inline const char* avtTiledImageCompositor::GetDescription()
{ return "performing tiled-image composite"; }
inline void avtTiledImageCompositor::SetChunkSize(const int _chunkSize)
{ chunkSize = _chunkSize; }
inline int avtTiledImageCompositor::GetChunkSize() const
{ return chunkSize; }
#endif
......@@ -30,6 +30,11 @@
// Mark C. Miller, Tue Oct 19 15:35:12 PDT 2004
// Turned into a base class
//
// Jeremy Meredith, Mon Aug 30 16:14:13 PDT 2004
// I added the ability for the avtWholeImageCompositer to use an
// Allreduce in the event this is used as the end of the first stage
// in a two-pass compositing scheme.
//
// ****************************************************************************
class AVTFILTERS_API avtWholeImageCompositer : public avtImageCompositer
......@@ -46,11 +51,13 @@ class AVTFILTERS_API avtWholeImageCompositer : public avtImageCompositer
void SetBackground(unsigned char r,
unsigned char g,
unsigned char b);
void SetAllProcessorsNeedResult(bool);
virtual void Execute() = 0;
protected:
bool allReduce;
int chunkSize;
unsigned char bg_r;
unsigned char bg_g;
......@@ -69,4 +76,9 @@ inline void avtWholeImageCompositer::SetBackground(unsigned char r,
unsigned char b)
{ bg_r = r; bg_g = g; bg_b = b; }
inline void avtWholeImageCompositer::SetAllProcessorsNeedResult(bool all)
{
allReduce = all;
}
#endif
......@@ -177,11 +177,16 @@ avtWholeImageCompositerNoZ::~avtWholeImageCompositerNoZ()
// Programmer: Mark C. Miller (modified from orig code by Kat Price)
// Creation: February 18, 2003
//
// Modifications:
// Jeremy Meredith, October 20, 2004
// Allowed for the use of an allreduce instead of a simple reduce.
//
// ****************************************************************************
void
avtWholeImageCompositerNoZ::Execute(void)
{ int i, numRows, numCols;
{
int i, numRows, numCols;
unsigned char *iorgb, *riorgb;
vtkImageData *mergedLocalImage, *mergedGlobalImage;
......@@ -226,8 +231,8 @@ avtWholeImageCompositerNoZ::Execute(void)
if (mpiRoot >= 0)
{
// only root allocates output AVT imge
if (mpiRank == mpiRoot)
// only root allocates output AVT image (for a non-allreduce)
if (allReduce || mpiRank == mpiRoot)
{
mergedGlobalImage = avtImageRepresentation::NewImage(outCols, outRows);
riorgb = (unsigned char *) mergedGlobalImage->GetScalarPointer(0, 0, 0);
......@@ -243,7 +248,7 @@ avtWholeImageCompositerNoZ::Execute(void)
mergedLocalImage->Delete();
}
if (mpiRank == mpiRoot)
if (allReduce || mpiRank == mpiRoot)
{
{
avtImageRepresentation theOutput(mergedGlobalImage);
......@@ -278,7 +283,7 @@ avtWholeImageCompositerNoZ::Execute(void)
}
// ****************************************************************************
// Function: MergeBuffers
// Function: avtWholeImageCompositerNoZ::MergeBuffers
//
// Purpose: Merge images represented by separate z and rgb buffers.
// The merge is broken into chunks to help MPI to digest it and
......@@ -292,12 +297,18 @@ avtWholeImageCompositerNoZ::Execute(void)
// one extr ZFPixel for this purpose.
//
//
// Programmer: Mark C. Miller (plagerized from Kat Price's MeshTV version)
// Programmer: Mark C. Miller (plagiarized from Kat Price's MeshTV version)
// Date: 04Mar03
//
// Modifications:
// Jeremy Meredith, October 20, 2004
// Allowed for the use of an allreduce instead of a simple reduce.
//
// ****************************************************************************
void
avtWholeImageCompositerNoZ::MergeBuffers(int npixels, bool doParallel,
const unsigned char *inrgb, unsigned char *iorgb)
const unsigned char *inrgb,
unsigned char *iorgb)
{
int io;
int chunk = npixels < chunkSize ? npixels : chunkSize;
......@@ -316,8 +327,22 @@ avtWholeImageCompositerNoZ::MergeBuffers(int npixels, bool doParallel,
#ifdef PARALLEL
if (doParallel)
MPI_Reduce((void*)&inrgb[3*io], &iorgb[3*io], len, avtWholeImageCompositerNoZ::mpiTypeZFPixel,
avtWholeImageCompositerNoZ::mpiOpMergeZFPixelBuffers, mpiRoot, mpiComm);
{
if (allReduce)
{
MPI_Allreduce((void*)&inrgb[3*io], &iorgb[3*io], len,
avtWholeImageCompositerNoZ::mpiTypeZFPixel,
avtWholeImageCompositerNoZ::mpiOpMergeZFPixelBuffers,
mpiComm);
}
else
{
MPI_Reduce((void*)&inrgb[3*io], &iorgb[3*io], len,
avtWholeImageCompositerNoZ::mpiTypeZFPixel,
avtWholeImageCompositerNoZ::mpiOpMergeZFPixelBuffers,
mpiRoot, mpiComm);
}
}
else
MergeZFPixelBuffers((void*)&inrgb[3*io], &iorgb[3*io], &len, NULL);
#else
......
......@@ -28,7 +28,7 @@ int avtWholeImageCompositerWithZ::objectCount = 0;
// to perform collective buffer merge operations. Merges
// frame and z-buffers.
//
// Programmer: Mark C. Miller (plagerized from Katherine Price)
// Programmer: Mark C. Miller (plagiarized from Katherine Price)
// Date: 26Feb03
// ****************************************************************************
......@@ -203,11 +203,16 @@ avtWholeImageCompositerWithZ::~avtWholeImageCompositerWithZ()
// Programmer: Mark C. Miller (modified from orig code by Kat Price)
// Creation: February 18, 2003
//
// Modifications:
// Jeremy Meredith, October 20, 2004
// Allowed for the use of an allreduce instead of a simple reduce.
//
// ****************************************************************************
void
avtWholeImageCompositerWithZ::Execute(void)
{ int i, numRows, numCols;
{
int i, numRows, numCols;
float *ioz = NULL, *rioz = NULL;
unsigned char *iorgb, *riorgb;
vtkImageData *mergedLocalImage, *mergedGlobalImage;
......@@ -259,8 +264,8 @@ avtWholeImageCompositerWithZ::Execute(void)
if (mpiRoot >= 0)
{
// only root allocates output AVT imge
if (mpiRank == mpiRoot)
// only root allocates output AVT image (for a non-allreduce)
if (allReduce || mpiRank == mpiRoot)
{
mergedGlobalImage = avtImageRepresentation::NewImage(outCols, outRows);
riorgb = (unsigned char *) mergedGlobalImage->GetScalarPointer(0, 0, 0);
......@@ -278,7 +283,7 @@ avtWholeImageCompositerWithZ::Execute(void)
delete [] ioz;
}
if (mpiRank == mpiRoot)
if (allReduce || mpiRank == mpiRoot)
{
if (shouldOutputZBuffer)
{
......@@ -333,7 +338,7 @@ avtWholeImageCompositerWithZ::Execute(void)
}
// ****************************************************************************
// Function: MergeBuffers
// Function: avtWholeImageCompositer::MergeBuffers
//
// Purpose: Merge images represented by separate z and rgb buffers.
// The merge is broken into chunks to help MPI to digest it and
......@@ -347,12 +352,20 @@ avtWholeImageCompositerWithZ::Execute(void)
// one extr ZFPixel for this purpose.
//
//
// Programmer: Mark C. Miller (plagerized from Kat Price's MeshTV version)
// Date: 04Mar03
// Programmer: Mark C. Miller (plagiarized from Kat Price's MeshTV version)
// Date: 04Mar03
//
// Modifications:
// Jeremy Meredith, October 20, 2004
// Allowed for the use of an allreduce instead of a simple reduce.
//
// ****************************************************************************
void
avtWholeImageCompositerWithZ::MergeBuffers(int npixels, bool doParallel,
const float *inz, const unsigned char *inrgb, float *ioz, unsigned char *iorgb)
const float *inz,
const unsigned char *inrgb,
float *ioz,
unsigned char *iorgb)
{
int io;
......@@ -370,22 +383,22 @@ avtWholeImageCompositerWithZ::MergeBuffers(int npixels, bool doParallel,
// In serial, however, it also needs to be populated before the MergeZFBuffers
for (int i = 0, j = io; i < len; i++, j++)
{
int jj = 3*j;
inzf[i].z = inz[j];
inzf[i].r = inrgb[jj+0];
inzf[i].g = inrgb[jj+1];
inzf[i].b = inrgb[jj+2];
int jj = 3*j;
inzf[i].z = inz[j];
inzf[i].r = inrgb[jj+0];
inzf[i].g = inrgb[jj+1];
inzf[i].b = inrgb[jj+2];
}