Commit 80408934 authored by Keith Bennett's avatar Keith Bennett

Merge branch 'release/1.4.0'

parents 61d23ba6 278abe22
......@@ -58,6 +58,11 @@
#include <vtkCellArray.h>
#include <vtkPolyData.h>
#include <avtGhostData.h>
#include <vtkUnsignedCharArray.h>
#include <vtkCellData.h>
#include <vtkStreamingDemandDrivenPipeline.h>
#include <avtDatabaseMetaData.h>
#include <avtIntervalTree.h>
#include <avtVariableCache.h>
......@@ -156,6 +161,9 @@ avtSDFFileFormat::OpenFile(int open_only)
h->use_random = use_random;
h->sdf_extension_version = SDF_EXTENSION_VERSION;
h->sdf_extension_revision = SDF_EXTENSION_REVISION;
#ifdef PARALLEL
h->internal_ghost_cells = 1;
#endif
// If nblocks is negative then the file is corrupt
if (h->nblocks <= 0) {
......@@ -282,7 +290,7 @@ void
avtSDFFileFormat::FreeUpResources(void)
{
debug1 << "avtSDFFileFormat::FreeUpResources(void) " << this << endl;
sdf_stack_free(h);
stack_free(stack_handle);
sdf_free_blocklist_data(h);
}
......@@ -784,6 +792,8 @@ avtSDFFileFormat::GetMesh(int domain, const char *meshname)
SetUpDomainConnectivity();
FillGhost(domain, rgrid);
#ifdef SDF_DEBUG
debug1 << "avtSDFFileFormat:: SDF debug buffer: ";
debug1 << h->dbg_buf; h->dbg = h->dbg_buf; *h->dbg = '\0';
......@@ -842,6 +852,8 @@ avtSDFFileFormat::GetMesh(int domain, const char *meshname)
SetUpDomainConnectivity();
FillGhost(domain, sgrid);
#ifdef SDF_DEBUG
debug1 << "avtSDFFileFormat:: SDF debug buffer: ";
debug1 << h->dbg_buf; h->dbg = h->dbg_buf; *h->dbg = '\0';
......@@ -853,6 +865,85 @@ avtSDFFileFormat::GetMesh(int domain, const char *meshname)
}
void
avtSDFFileFormat::FillGhost(int domain, vtkDataSet *ds)
{
#ifdef PARALLEL
// Set up ghost cells at parallel domain boundaries
sdf_block_t *b = h->current_block;
if (b->no_internal_ghost)
return;
int starts[3], local_dims[3];
sdf_get_domain_bounds(h, domain, starts, local_dims);
int nCells = ds->GetNumberOfCells();
int *blanks = new int[nCells];
int i, j, k, ilo, jlo, klo, ihi, jhi, khi, n, nx, ny;
nx = ny = ilo = jlo = klo = 0;
ihi = jhi = khi = 1;
n = 0;
if (b->ndims > n) {
nx = ihi = b->local_dims[n] - 1;
if (b->proc_min[n] != MPI_PROC_NULL) ilo++;
if (b->proc_max[n] != MPI_PROC_NULL) ihi--;
}
n = 1;
if (b->ndims > n) {
ny = jhi = b->local_dims[n] - 1;
if (b->proc_min[n] != MPI_PROC_NULL) jlo++;
if (b->proc_max[n] != MPI_PROC_NULL) jhi--;
}
n = 2;
if (b->ndims > n) {
khi = b->local_dims[n] - 1;
if (b->proc_min[n] != MPI_PROC_NULL) klo++;
if (b->proc_max[n] != MPI_PROC_NULL) khi--;
}
for (i = 0; i < nCells; i++)
blanks[i] = 0;
for (k = klo; k < khi; k++)
for (j = jlo; j < jhi; j++)
for (i = ilo; i < ihi; i++)
blanks[i + nx * (j + ny * k)] = 1;
unsigned char realVal = 0, ghost = 0;
avtGhostData::AddGhostZoneType(ghost, DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
vtkUnsignedCharArray *ghostCells = vtkUnsignedCharArray::New();
ghostCells->SetName("avtGhostZones");
ghostCells->Allocate(nCells);
for (i = 0; i < nCells; i++) {
if (blanks[i])
ghostCells->InsertNextValue(realVal);
else
ghostCells->InsertNextValue(ghost);
}
ds->GetCellData()->AddArray(ghostCells);
vtkStreamingDemandDrivenPipeline::SetUpdateGhostLevel(
ds->GetInformation(), 0);
ghostCells->Delete();
delete [] blanks;
#endif
}
// ****************************************************************************
// Method: avtSDFFileFormat::GetCurve
//
......
......@@ -208,6 +208,7 @@ class avtSDFFileFormat : public avtSTMDFileFormat
vtkDataSet *GetCurve(int domain, sdf_block_t *b);
sdf_block_t *GetArray(int, const char *);
void OpenFile(int);
void FillGhost(int domain, vtkDataSet *ds);
void *sdf_extension_handle;
sdf_extension_t *ext;
......
......@@ -16,6 +16,7 @@ PRIVATE="-private"
VERBOSE=""
OPTS=""
err=0
stop=0
while getopts crdpnuvh123 name
do
......@@ -50,9 +51,9 @@ VisIt build script options:
-3: Perform only a serial VisIt build.
EOF
exit ;;
1) build_type=1 ;;
2) build_type=2 ;;
3) build_type=3 ;;
1) build_type=1 ; stop=1 ;;
2) build_type=2 ; stop=1 ;;
3) build_type=3 ; stop=1 ;;
esac
done
......@@ -81,6 +82,8 @@ export PATH="$visitpath:$PATH"
export CXXFLAGS="-Wno-deprecated $DBG"
export CFLAGS="$DBG"
stdlib="$CXXFLAGS"
# Auto-detect C++ compiler
cpp=$CXX
[ "$cpp"x = x ] && cpp=$(which c++)
......@@ -88,7 +91,7 @@ cpp=$CXX
[ "$cpp"x = x ] && cpp=$(which g++)
$cpp --version | grep -i clang > /dev/null 2>&1
if [ $? -eq 0 ]; then
export CXXFLAGS="-stdlib=libstdc++ $CXXFLAGS"
stdlib="-stdlib=libstdc++ $CXXFLAGS"
fi
buildit () {
......@@ -136,17 +139,32 @@ CC=mpicc," Makefile > .Makefile.tmp
fi
else
xml2cmake -clobber $PRIVATE ${fmt}${version}.xml
setup=$(grep -w PluginVsInstall.cmake CMakeLists.txt | cut -f2 -d\")
grep -w clang $setup > /dev/null
if [ $? -ne 0 ]; then
# If using clang when original was compiled with gcc, then we need
# to add a flag for stdlib
export CXXFLAGS="$stdlib"
fi
for f in `grep -w INCLUDE CMakeLists.txt | cut -f2 -d\( | \
cut -f1 -d\) | tr -d \"`; do
base=`basename $f`
sed 's,/[^;]*libmpi[^;]*;,,g; s,/[^;]*libopen-[^;]*;,,g;
s,[^;]*}general;,,g' $f > $tmpdir/$base
com1=vtkCommonDataModel
com2=vtkCommonExecutionModel
sed 's/\([;"]'$com1'-\)\([^;]*\)/\1\2;'$com2'-\2/' \
$f > $tmpdir/$base
if [ $build_type -eq 2 ]; then
sed 's/\([;"]\)[^;]*libmpi[^;]*;/\1/g;
s/\([;"]\)[^;]*libopen-[^;]*;/\1/g;
s/\([;"]\)[^;]*general[^;]*;/\1/g' $f > $tmpdir/$base
grep -v 'CMAKE_CXX_COMPILER ' $tmpdir/$base | \
grep -v 'CMAKE_C_COMPILER ' | \
grep -v 'VISIT_PARALLEL_LIBS ' > $tmpdir/tmp
mv $tmpdir/tmp $tmpdir/$base
elif [ $build_type -eq 3 ]; then
sed 's/\([;"]\)[^;]*libmpi[^;]*;/\1/g;
s/\([;"]\)[^;]*libopen-[^;]*;/\1/g;
s/\([;"]\)[^;]*general[^;]*;/\1/g' $f > $tmpdir/$base
grep -v 'VISIT_PARALLEL ' $tmpdir/$base > $tmpdir/tmp
mv $tmpdir/tmp $tmpdir/$base
fi
......@@ -167,6 +185,15 @@ CC=mpicc," Makefile > .Makefile.tmp
if [ $clean -ge 1 ] ; then make clean ; fi
make $VERBOSE
err=$?
if [ $err -eq 0 ]; then
echo
echo "VisIt ${fmt} reader successfully built.${srl}"
fi
if [ $stop -ne 0 ] ; then exit ; fi
return $err
}
build_default () {
......@@ -244,7 +271,4 @@ elif [ $build_visit_reader -eq 1 ]; then
echo "ERROR: Failed to build VisIt reader."
exit 1
fi
echo
echo "VisIt ${fmt} reader successfully built.${srl}"
fi
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