Commit 964925ec authored by hrchilds's avatar hrchilds

Update from March 20, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@641 18c085ea-50e0-402c-830e-de6fd14e8384
parent 64b3e536
......@@ -48,6 +48,11 @@
# Brad Whitlock, Mon Nov 21 16:57:39 PST 2005
# I made it copy libbz2.{dll,lib}.
#
# Brad Whitlock, Thu Mar 16 11:59:27 PDT 2006
# I added code to copy the NERSC and ORNL config files. I also added an
# optional -nodist argument that can make the script use an existing
# source distribution.
#
#------------------------------------------------------------------------------
if(`pwd` != "/data_vobs/VisIt") then
......@@ -55,6 +60,22 @@ if(`pwd` != "/data_vobs/VisIt") then
exit(-1)
endif
# Parse the comand line arguents.
set create_src_dist = true
set option_found = true
while ($option_found == true)
switch ($1)
case -nodist:
# Use an existing source distribution.
set create_src_dist = false
shift
breaksw
default:
set option_found = false
breaksw
endsw
end
# Set some directory variables.
set TOPDIR = "/data_vobs/VisIt"
set SCRIPTDIR = "/data_vobs/VisIt/clearcase_bin"
......@@ -64,8 +85,10 @@ set VisItDev = "$TOPDIR/VisItDev$VERSION"
set VISITSRC="visit"
# Run the visit-dist script so it creates a source distribution
echo "Creating intermediate source package..."
$SCRIPTDIR/visit-dist -withhelp $VISITSRC
if ($create_src_dist == true) then
echo "Creating intermediate source package..."
$SCRIPTDIR/visit-dist -withhelp $VISITSRC
endif
# Create a directory to contain the VisIt source distribution.
echo "Creating $VisItDev directory..."
......@@ -185,6 +208,8 @@ foreach configdir (Debug Release MSVC7.Net/Debug MSVC7.Net/Release)
# Copy the host config files to the right bin dir.
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-open.ini bin/$configdir/visit-config-open.ini
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-closed.ini bin/$configdir/visit-config-closed.ini
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-nersc.ini bin/$configdir/visit-config-nersc.ini
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-ornl.ini bin/$configdir/visit-config-ornl.ini
mkdir bin/$configdir/help
cp $VISITSRC/help/*.{html,helpml} bin/$configdir/help
mkdir bin/$configdir/databases
......
#ifndef CONSTRUCTDDFATTRIBUTES_H
#define CONSTRUCTDDFATTRIBUTES_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>
......@@ -18,7 +19,7 @@
//
// ****************************************************************************
class ConstructDDFAttributes : public AttributeSubject
class STATE_API ConstructDDFAttributes : public AttributeSubject
{
public:
enum BinningScheme
......
<?xml version="1.0"?>
<Attribute name="ConstructDDFAttributes" purpose="Attributes for constructing DDFs" persistent="true" exportAPI="" exportInclude="">
<Attribute name="ConstructDDFAttributes" purpose="Attributes for constructing DDFs" persistent="true" exportAPI="STATE_API" exportInclude="state_exports.h">
<Enum name="BinningScheme">
Uniform
Unknown
......
# Copyright 1991 - 2005
# Copyright 1991 - 2006
# The Regents of the University of California.
# All rights reserved.
#
......@@ -57,8 +57,9 @@ CPPFLAGS=-I../../include/visit @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libavtddf
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(X_LIBS)
PARLIBS=-ldbatts -lpipeline_par -lavtmath_par -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(X_LIBS)
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS)
SERLIBS=-ldbatts -lpipeline_ser -lavtmath_ser -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
PARLIBS=-ldbatts -lpipeline_par -lavtmath_par -lavtexceptions -lvisit_vtk -llightweight_visit_vtk -lmisc -lstate -lcomm -lexpr -lparser -lutility $(VTK_LIBS) $(LIBS_FOR_MACOSX_PREBINDING) $(X_LIBS)
##
## Standard targets...
......
......@@ -28,7 +28,7 @@ avtUniformBinningScheme::avtUniformBinningScheme(int nt, const float *r,
// Must be a positive number of tuples
EXCEPTION0(ImproperUseException);
}
for (int i = 0 ; i < nt ; i++)
for (i = 0 ; i < nt ; i++)
{
if (r[2*i+1] <= r[2*i])
{
......@@ -46,7 +46,7 @@ avtUniformBinningScheme::avtUniformBinningScheme(int nt, const float *r,
ranges = new float[2*nt];
nvals = new int[nt];
nBins = 1;
for (int i = 0 ; i < ntuples ; i++)
for (i = 0 ; i < ntuples ; i++)
{
ranges[2*i] = r[2*i];
ranges[2*i+1] = r[2*i+1];
......
......@@ -474,7 +474,7 @@ avtDatabaseFactory::VisitFile(const char *visitFile, int timestep,
// the whole path to the file. We don't need to prepend a
// path if it already contains one.
if((fileName.find(":") != std::string::npos) ||
(fileName.size() > 0 && fileName[0] == '!')
(fileName.size() > 0 && fileName[0] == '!'))
continue;
// If the filename begins with "./", remove it.
......
......@@ -300,8 +300,8 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libexpressions
SERLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtfilters_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtfilters_par
SERLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtfilters_ser -lavtddf_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtfilters_par -lavtddf_par
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lexpr -lparser -lutility -lplugin -lvisit_vtk -llightweight_visit_vtk -lavtview
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser -ldatabase_ser -lmir_ser $(VTK_LIBS) $(SERLIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par -ldatabase_par -lmir_par $(VTK_LIBS) $(PARLIBS_FOR_MACOSX_PREBINDING) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
......
......@@ -418,11 +418,11 @@ avtExpressionEvaluatorFilter::PerformRestriction(
for (int i = 0 ; i < nVars ; i++)
{
std::string name = info->GetDomainTupleName(i);
debug5 << "EEF::PerformRestriction: " << name << endl;
debug5 << "EEF::PerformRestriction: " << name.c_str() << endl;
candidates.insert(name);
}
std::string name = info->GetCodomainName();
debug5 << "EEF::PerformRestriction: " << name << endl;
debug5 << "EEF::PerformRestriction: " << name.c_str() << endl;
candidates.insert(name);
}
else // (expr != NULL)
......
# Copyright 2000 - 2005
# Copyright 2000 - 2006
# The Regents of the University of California.
# All rights reserved.
#
......@@ -88,7 +88,7 @@
@VARIABLES@
@DIRTARGETS@
SUBDIRS=DBAtts DDF Math Pipeline MIR \
SUBDIRS=DBAtts Math Pipeline DDF MIR \
View Filters Database Expressions Queries Plotter FileWriter \
@VISWINDOW@ QtVisWindow
......
......@@ -201,10 +201,11 @@ CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
LIB=libquery
LIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS)
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lexpr -lparser -lutility -lplugin -lavtview -lvisit_vtk -llightweight_visit_vtk $(LIBS_FOR_MACOSX_PREBINDING)
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser -lavtfilters_ser -lexpressions_ser -ldatabase_ser -lmir_ser $(VTK_LIBS) $(X_LIBS) @LIBS@
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par -lavtfilters_par -lexpressions_par -ldatabase_par -lmir_par $(VTK_LIBS) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
SERLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtddf_ser
PARLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS) -lavtddf_par
COMMONLIBS=-ldbatts -lavtexceptions -lstate -lcomm -lmisc -lexpr -lparser -lutility -lplugin -lavtview -lvisit_vtk -llightweight_visit_vtk
SERLIBS=$(COMMONLIBS) -lpipeline_ser -lavtmath_ser -lavtfilters_ser -lexpressions_ser -ldatabase_ser -lmir_ser $(SERLIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS) @LIBS@
PARLIBS=$(COMMONLIBS) -lpipeline_par -lavtmath_par -lavtfilters_par -lexpressions_par -ldatabase_par -lmir_par $(PARLIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(X_LIBS) @LIBS@ @SHLIB_MPI_LIBS@
##
## Standard targets...
......
......@@ -46,6 +46,9 @@ static int FormatLine(char *line);
// Hank Childs, Fri Mar 4 16:02:03 PST 2005
// Do not read in the entire TOC in this file any more.
//
// Brad Whitlock, Thu Mar 16 14:56:37 PST 2006
// Initialized byteOffset to 0 and set divideBrick to false.
//
// ****************************************************************************
avtBOVFileFormat::avtBOVFileFormat(const char *fname)
......@@ -105,6 +108,8 @@ avtBOVFileFormat::avtBOVFileFormat(const char *fname)
hasBoundaries = false;
nodalCentering = true;
byteData = true;
byteOffset = 0;
divideBrick = false;
haveReadTOC = false;
}
......@@ -297,6 +302,86 @@ avtBOVFileFormat::GetMesh(int dom, const char *meshname)
return rv;
}
#define BRICKLET_READ
#ifdef BRICKLET_READ
// ****************************************************************************
// Method: ReadBricklet
//
// Purpose:
// This is a template function that knows how to use fseek to access
// a smaller brick of data within a BOV file.
//
// Arguments:
// fp : The file pointer to use.
// dest : The destination buffer for the data that gets read.
// full_size : The whole size (x,y,z) of the brick in the file.
// start : The starting x,y,z that we want to read.
// end : The ending x,y,z that we want to read.
// offset : An additional amount (in bytes) to offset from the start
// of the file.
// Returns:
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Fri Mar 17 15:17:19 PST 2006
//
// Modifications:
//
// ****************************************************************************
template<class T>
void
ReadBricklet(FILE *fp, T *dest, const int *full_size, const int *start,
const int *end, int offset)
{
T *ptr = dest;
// Seek to the right Z page
long zPage = start[2]*full_size[0]*full_size[1];
long seekOffset = zPage * sizeof(T) + offset;
if(seekOffset > 0)
fseek(fp, seekOffset, SEEK_SET);
// Now start reading the data
int dx = end[0] - start[0];
long extraseek = 0;
for(int z = start[2]; z < end[2]; ++z)
{
// Get to the starting data location in the zPage.
long corner = start[1]*full_size[0] + start[0];
seekOffset = (corner + extraseek) * sizeof(T);
if(seekOffset > 0)
fseek(fp, seekOffset, SEEK_CUR);
extraseek = 0;
for(int y = start[1]; y < end[1]; ++y)
{
// Read in a line of data in x.
fread((void *)ptr, sizeof(T), dx, fp);
ptr += dx;
// Seek to the next line
if(y < end[1]-1)
{
long right = full_size[0] - end[0];
long left = start[0];
seekOffset = (right + left) * sizeof(T);
if(seekOffset > 0)
fseek(fp, seekOffset, SEEK_CUR);
}
}
// Seek to the next page
if(z < end[2]-1)
{
long right = full_size[0] - end[0];
long bottom = (full_size[1] - end[1]) * full_size[0];
extraseek = right + bottom;
}
}
}
#endif
// ****************************************************************************
// Method: avtBOVFileFormat::GetVar
......@@ -315,6 +400,9 @@ avtBOVFileFormat::GetMesh(int dom, const char *meshname)
// add support for gzipped vs non-gzipped. Also do a better job of closing
// file descriptors and freeing memory.
//
// Brad Whitlock, Wed Mar 15 17:30:52 PST 2006
// Added more support for reading in a piece of a brick (divideBrick).
//
// ****************************************************************************
// FROM FConvert.C
......@@ -385,8 +473,9 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
}
vtkFloatArray *rv = vtkFloatArray::New();
if (hasBoundaries)
{
if(hasBoundaries)
{
int dx = bricklet_size[0] + 2;
int x_start = (x_off == 0 ? 1 : 0);
int x_stop = (x_off >= nx-1 ? dx-1 : dx);
......@@ -418,9 +507,21 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
// Read in based on whether or not we have a gzipped file.
//
if (gzipped)
{
// Read past the specified offset.
if(byteOffset > 0)
gzseek(gz_handle, byteOffset, SEEK_SET);
gzread(gz_handle, buff2, total_vals*unit_size);
}
else
{
// Read past the specified offset.
if(byteOffset > 0)
fseek(file_handle, byteOffset, SEEK_SET);
fread(buff2, unit_size, total_vals, file_handle);
}
int ptId = 0;
for (int i = z_start ; i < z_stop ; i++)
......@@ -439,7 +540,132 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
if (f_buff != NULL)
delete [] f_buff;
}
else
else if(divideBrick)
{
// Allocate enough memory for 1 bricklet.
unsigned int nvals = bricklet_size[0] *
bricklet_size[1] *
bricklet_size[2];
rv->SetNumberOfTuples(nvals);
float *buff = (float *) rv->GetVoidPointer(0);
int x_start = x_off * bricklet_size[0];
int y_start = y_off * bricklet_size[1];
int z_start = z_off * bricklet_size[2];
int x_stop = x_start + bricklet_size[0];
int y_stop = y_start + bricklet_size[1];
int z_stop = z_start + bricklet_size[2];
#ifdef BRICKLET_READ
if(!gzipped)
{
int start[3] = {x_start, y_start, z_start};
int stop[3] = {x_stop, y_stop, z_stop};
if(!byteData)
{
// Read the float data.
ReadBricklet(file_handle, buff, full_size, start, stop,
byteOffset);
}
else
{
// Read the char data into a temp array.
unsigned char *cdata = new unsigned char[nvals];
ReadBricklet(file_handle, cdata, full_size, start, stop,
byteOffset);
// Convert the char data into floats.
float *fptr = buff;
unsigned char *cptr = cdata;
for(unsigned int i = 0; i < nvals; ++i)
*fptr++ = min + (max-min) * (*cptr++ / 255.);
delete [] cdata;
}
}
else
#endif
{
//
// In this case, we have 1 big brick and we're going to chunk it
// up into bricklets so we can do some parallel processing upstream.
//
// Allocate enough memory to read the whole brick.
unsigned int whole_size = full_size[0] * full_size[1] *full_size[2];
float *whole_buff = 0;
if(byteData)
whole_buff = (float *)(new unsigned char[whole_size]);
else
whole_buff = new float[whole_size];
float *f_buff = (float *)whole_buff;
unsigned char *uc_buff = (unsigned char *)whole_buff;
#ifndef BRICKLET_READ
if(gzipped)
{
#endif
// Read past the specified offset.
if(byteOffset > 0)
gzseek(gz_handle, byteOffset, SEEK_SET);
// Read the whole dataset
gzread(gz_handle, whole_buff, whole_size * unit_size);
#ifndef BRICKLET_READ
}
else
{
// Read past the specified offset.
if(byteOffset > 0)
fseek(file_handle, byteOffset, SEEK_SET);
fread(whole_buff, unit_size, whole_size, file_handle);
}
#endif
//
// Copy the piece that we want into the buffer.
//
int ptId = 0;
if (byteData)
{
for (int i = z_start ; i < z_stop ; i++)
{
unsigned int Z = i*full_size[0]*full_size[1];
for (int j = y_start ; j < y_stop ; j++)
{
unsigned int Y = j * full_size[0];
for (int k = x_start ; k < x_stop ; k++)
{
unsigned int index = Z + Y + k;
buff[ptId++] = min + (max-min)*(uc_buff[index]/255.);
}
}
}
// Delete the array containing the whole BOV
delete [] uc_buff;
}
else
{
for (int i = z_start ; i < z_stop ; i++)
{
unsigned int Z = i*full_size[0]*full_size[1];
for (int j = y_start ; j < y_stop ; j++)
{
unsigned int Y = j * full_size[0];
for (int k = x_start ; k < x_stop ; k++)
{
unsigned int index = Z + Y + k;
buff[ptId++] = f_buff[index];
}
}
}
// Delete the array containing the whole BOV
delete [] f_buff;
}
}
}
else // read the whole BOV
{
int nvals = bricklet_size[0] * bricklet_size[1] * bricklet_size[2];
rv->SetNumberOfTuples(nvals);
......@@ -460,9 +686,21 @@ avtBOVFileFormat::GetVar(int dom, const char *var)
// Read in based on whether or not we have a gzipped file.
//
if (gzipped)
{
// Read past the specified offset.
if(byteOffset > 0)
gzseek(gz_handle, byteOffset, SEEK_SET);
gzread(gz_handle, buff, nvals*unit_size);
}
else
{
// Read past the specified offset.
if(byteOffset > 0)
fseek(file_handle, byteOffset, SEEK_SET);
fread(buff, unit_size, nvals, file_handle);
}
if (byteData)
{
......@@ -711,6 +949,10 @@ avtBOVFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Do not re-read the TOC for each call to this method. Also added error
// checking previously in the constructor.
//
// Brad Whitlock, Thu Mar 16 14:55:52 PST 2006
// I added support for byteOffset, which lets us skip a header. I also
// added support for divideBrick.
//
// ****************************************************************************
void
......@@ -879,6 +1121,17 @@ avtBOVFileFormat::ReadTOC(void)
if (strstr(line, "zon") != NULL)
nodalCentering = false;
}
else if (strcmp(line, "BYTE_OFFSET:") == 0)
{
line += strlen("BYTE_OFFSET:") + 1;
byteOffset = atoi(line);
byteOffset = byteOffset < 0 ? 0 : byteOffset;
}
else if (strcmp(line, "DIVIDE_BRICK:") == 0)
{
line += strlen("DIVIDE_BRICK:") + 1;
divideBrick = (strcmp(line, "true") == 0);
}
}
if (file_pattern == NULL)
......@@ -918,6 +1171,15 @@ avtBOVFileFormat::ReadTOC(void)
debug1 << "Full size must be a multiple of bricklet size" << endl;
EXCEPTION1(InvalidFilesException, fname);
}
if(divideBrick &&
(full_size[0] == bricklet_size[0] &&
full_size[1] == bricklet_size[1] &&
full_size[2] == bricklet_size[2]))
{
debug1 << "Turning off DIVIDE_BRICK because DATA_SIZE and "
"DATA_BRICKLETS are the same size" << endl;
divideBrick = false;
}
}
......
......@@ -22,6 +22,10 @@
// Hank Childs, Fri Mar 4 16:02:03 PST 2005
// Added support for deferring reading in all of the TOC.
//
// Brad Whitlock, Thu Mar 16 14:54:01 PST 2006
// Added byte offset so we can skip past a header. I also added a new
// flag for dividing a brick into bricklets.
//
// ****************************************************************************
class avtBOVFileFormat : public avtSTMDFileFormat
......@@ -53,12 +57,14 @@ class avtBOVFileFormat : public avtSTMDFileFormat
int cycle;
int full_size[3];
int bricklet_size[3];
int byteOffset;
char *varname;
bool hasBoundaries;
bool declaredEndianess;
bool littleEndian;
bool nodalCentering;
bool byteData;
bool divideBrick;
float min, max;
float origin[3];
float dimensions[3];
......
......@@ -653,7 +653,7 @@ avtVTKFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
else
{
avtMeshCoordType mct =(avtMeshCoordType)
dataset->GetFieldData()->GetArray("MeshCoordType")->GetComponent(0, 0);
int(dataset->GetFieldData()->GetArray("MeshCoordType")->GetComponent(0, 0));
avtMeshMetaData *mesh = new avtMeshMetaData;
mesh->name = MESHNAME;
mesh->meshType = type;
......
......@@ -96,6 +96,9 @@ QvisCommandWindow::~QvisCommandWindow()
// Brad Whitlock, Wed Jan 11 09:53:23 PDT 2006
// I fixed an errant tooltip.
//
// Brad Whitlock, Fri Mar 17 09:46:58 PDT 2006
// Added UpdateMacroCheckBoxes.
//
// ****************************************************************************
void
......@@ -206,6 +209,9 @@ QvisCommandWindow::CreateWindowContents()
// Load the saved Python scripts.
LoadScripts();
// Update the window's check boxes.
UpdateMacroCheckBoxes();
}
// ****************************************************************************
......@@ -255,7 +261,9 @@ QvisCommandWindow::CreateNode(DataNode *node)
// Creation: Fri Jan 6 17:01:57 PST 2006
//
// Modifications:
//
// Brad Whitlock, Fri Mar 17 09:43:25 PDT 2006
// Moved code to update widgets into UpdateMacroCheckBoxes.
//
// ****************************************************************************
void
......@@ -277,13 +285,42 @@ QvisCommandWindow::SetFromNode(DataNode *parentNode, const int *borders)
if((n = winNode->GetNode("macroAppend")) != 0)