Commit 14ffc31c authored by hrchilds's avatar hrchilds

Update from December 3, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@772 18c085ea-50e0-402c-830e-de6fd14e8384
parent 08bca734
......@@ -278,7 +278,7 @@ $fullusage = "$usage
-machinefile <file> Machine file.
-expedite Makes DPCS give priority scheduling.
Hardware acceleration options
Hardware accelerated parallel (scalable) rendering options
---------------------------------------------------------------------------
Notes: These options should only be used with parallel clusters that
have graphics cards. If you are using a serial version of VisIt, you
......@@ -349,6 +349,7 @@ $fullusage = "$usage
-private xml2makefile: force install plugins privately
-clobber Permit xml2... tools to overwrite old files
-noprint do not print any debugging output
-arch print supported architecture(s) and exit
Debugging options
---------------------------------------------------------------------------
......@@ -461,6 +462,7 @@ $use_new_console = 0;
$visit_sets_up_environment = 0;
$pre_command = "";
$post_command = "";
$print_arch = 0;
# Parse the arguments
@visitargs = ();
......@@ -500,6 +502,7 @@ while (scalar(@ARGV) > 0) {
elsif ($arg eq "--fullhelp") { print STDERR "\nUSAGE: visit [options]
$fullusage\n"; exit(0); }
elsif ($arg eq "-norun") { $nr = shift; push @norun, $nr; push @visitargs, "-norun", $nr; }
elsif ($arg eq "-arch") { $print_arch = 1; }
elsif ($arg eq "-env") { $envonly = 1; }
elsif ($arg eq "-launchengine") { if (scalar(@ARGV)>0) {$launchengine = shift;}
if ($launchengine eq "") { $launchengine="localhost"; }
......@@ -818,6 +821,17 @@ EOF
#
$defaultarch = $supportedarchs[0];
#
# If -arch was requested, just print architecture info and exit
#
if ($print_arch)
{
print STDOUT <<"EOF";
@supportedarchs
EOF
exit 1;
}
#
# Set any unfinished defaults
#
......@@ -1373,7 +1387,7 @@ else
# Note: could use --tool=addrcheck because it uses much less memory
# and runs twice as fast, but it doesn't catch UMRs
# Note: could add --leak-check=yes to either tool
@debugcmd = ("valgrind", "--tool=memcheck", "--error-limit=no", "--num-callers=32", "$visitbindir/$exe_name", @visitargs);
@debugcmd = ("valgrind", "--tool=memcheck", "--error-limit=no", "--num-callers=64", "$visitbindir/$exe_name", @visitargs);
if ($security_key_set) { push @debugcmd, "-key", $security_key; }
print STDERR "Running: @debugcmd\n" if (! $quiet);
exec @debugcmd or die "Could not execute $exe_name under valgrind\n";
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// PointerNotInCacheException.C //
// ************************************************************************* //
#include <snprintf.h>
#include <PointerNotInCacheException.h>
// ****************************************************************************
// Method: PointerNotInCacheException constructor
//
// Programmer: Mark C. Miller
// Creation: November 30, 2006
//
// ****************************************************************************
PointerNotInCacheException::PointerNotInCacheException(const void *p)
{
char str[1024];
SNPRINTF(str, sizeof(str), "Unable to find object with pointer %X in cache", p);
msg = str;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// PointerNotInCacheException.h //
// ************************************************************************* //
#ifndef POINTER_NOT_IN_CACHE_EXCEPTION_H
#define POINTER_NOT_IN_CACHE_EXCEPTION_H
#include <avtexception_exports.h>
#include <DatabaseException.h>
// ****************************************************************************
// Class: PointerNotInCacheException
//
// Purpose:
// The exception that should be thrown whenever transform manager is
// unable to find items in variable cache given object pointer
//
// Programmer: Mark C. Miller
// Creation: November 30, 2006
//
// ****************************************************************************
class AVTEXCEPTION_API PointerNotInCacheException : public DatabaseException
{
public:
PointerNotInCacheException(const void *);
virtual ~PointerNotInCacheException() VISIT_THROW_NOTHING {;};
};
#endif
......@@ -117,6 +117,9 @@
# Mark C. Miller, Wed Nov 16 10:46:36 PST 2005
# Added LibPipelineStubs
#
# Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
# Added Database/PointerNotInCacheException
#
##############################################################################
@SET_MAKE@
......@@ -134,6 +137,7 @@ Database_src= \
Database/InvalidTimeStepException.C \
Database/InvalidVariableException.C \
Database/InvalidZoneTypeException.C \
Database/PointerNotInCacheException.C \
Database/SiloException.C
Pipeline_src= \
......
......@@ -41,6 +41,7 @@
#include <VisItException.h>
#include <DebugStream.h>
#include <Init.h>
// ****************************************************************************
// Method: VisItException constructor
......@@ -69,12 +70,17 @@ VisItException::VisItException()
// Programmer: Kathleen Bonnell
// Creation: April 27, 2001
//
// Modifications:
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added component name to exception string
//
// ****************************************************************************
VisItException::VisItException(const std::string &m)
{
filename = "Unknown";
msg = m;
msg = std::string(Init::GetComponentName()) + ": " + m;
type = "VisItException";
line = -1;
log = &debug1_real;
......@@ -244,6 +250,8 @@ typedef struct
// Mark C. Miller, Mon Apr 19 11:41:07 PDT 2004
// Added PlotterException base class for plotter exceptions
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added PointerNotInCacheException for transform manager
static const exception_info exception_tree[] =
{
......@@ -304,7 +312,8 @@ static const exception_info exception_tree[] =
{"StubReferencedException", "PipelineException"},
{"UnexpectedValueException", "PipelineException"},
{"VisItException", NULL},
{"VisWindowException", "VisItException"}
{"VisWindowException", "VisItException"},
{"PointerNotInCacheException", "DatabaseException"}
};
//
......
......@@ -57,6 +57,10 @@
// Programmer: Hank Childs
// Creation: September 24, 2002
//
// Modifications:
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added operator==
// ****************************************************************************
typedef void (*DestructorFunction)(void *);
......@@ -70,6 +74,7 @@ class UTILITY_API void_ref_ptr
~void_ref_ptr();
void Assign(void *rhs, DestructorFunction);
void operator=(const void_ref_ptr &rhs);
bool operator==(const void_ref_ptr &rhs) const;
void *operator*();
int *GetN() const;
void Print(ostream&);
......@@ -186,6 +191,12 @@ void_ref_ptr::operator*()
return p;
}
inline bool
void_ref_ptr::operator==(const void_ref_ptr &rhs) const
{
return (p == rhs.p);
}
inline int *
void_ref_ptr::GetN() const
{
......
......@@ -8628,4 +8628,55 @@ avtDatabaseMetaData::IssueWarning(const char *msg)
}
}
// ****************************************************************************
// Function: ConvertCSGDomainId
//
// Purpose: Handle spoofing of CSG domain ids
//
// A vtkCSGGrid object served up by a plugin is a bunch of CSG regions, not
// just one region. It is most intuitive to have each region treated as a
// VisIt "domain." However, that means that VisIt's notion of domains DOES
// NOT map 1:1 to vtkCSGGrid objects because a single vtkCSGGrid object
// represents multiple domains. The problem is further complicated by the
// "multi-block" case where we have multiple vtkCSGGrid objects knitted together
// to form a multi-block CSG mesh.
//
// To deal with this, we adopt the convention to treat each region of a single
// vtkCSGGrid object as a VisIt domain and multiple vtkCSGGrid objects as
// "groups" of domains.
//
// This function maps VisIt's domain ids into a block number (e.g. which of
// the multiple vtkCSGGrid objects) and a region number within the block
// (e.g. which region within the vtkCSGGrid object)
//
// Programmer: Mark C. Miller
// Creation: June 28, 2006
//
// ****************************************************************************
bool
avtDatabaseMetaData::ConvertCSGDomainToBlockAndRegion(const char *const var,
int *domain, int *region) const
{
int domainAsVisItSeesIt = *domain;
std::string meshname = MeshForVar(var);
const avtMeshMetaData *mmd = GetMesh(meshname);
if (mmd->meshType == AVT_CSG_MESH)
{
const intVector& groupIds = mmd->groupIds;
if (groupIds.size() > domainAsVisItSeesIt)
{
int i, j = groupIds[domainAsVisItSeesIt];
for (i = domainAsVisItSeesIt; i >= 0 && groupIds[i] == j; i--)
; // no-op
*domain = j;
if (region) *region = domainAsVisItSeesIt - i + 1;
}
else
{
*domain = 0;
if (region) *region = domainAsVisItSeesIt;
}
return true;
}
return false;
}
......@@ -604,6 +604,9 @@ public:
// Add a Boolean array to "DetermineVarType", since the database does not
// want results from expressions.
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added ConvertCSGDomainToBlockAndRegion due to manner in which CSG
// mesh "domains" are handled
//----------------------------------------------------------------------------
class DBATTS_API avtDatabaseMetaData : public AttributeSubject
......@@ -790,6 +793,9 @@ public:
const Expression *GetExpression(int) const;
int GetNumberOfExpressions(void) const;
bool ConvertCSGDomainToBlockAndRegion(
const char *const var, int *domain, int *region) const;
int GetNDomains(std::string) const;
avtVarType DetermineVarType(std::string, bool = true) const;
avtSubsetType DetermineSubsetType(const std::string &) const;
......
......@@ -384,5 +384,3 @@ avtDatasetCollection::AssembleDataTree(std::vector<int> &domains)
return new avtDataTree(nDomains, avtds);
}
......@@ -47,6 +47,7 @@
#include <vector>
#include <string>
#include <array_ref_ptr.h>
#include <void_ref_ptr.h>
#include <avtDataTree.h>
......@@ -77,6 +78,8 @@ class avtMixedVariable;
// Hank Childs, Sun Mar 13 10:41:17 PST 2005
// Fixed problem with memory leak.
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added code for setting/getting Var and Vars2nd
// ****************************************************************************
struct DATABASE_API avtDatasetCollection
......@@ -90,6 +93,14 @@ struct DATABASE_API avtDatasetCollection
std::vector<std::vector<std::string> > matnames;
std::vector<bool> needsMatSelect;
std::vector<int> numMats;
void SetVar(const char *cvar)
{ var = cvar; };
const std::string GetVar() const
{ return var; };
void SetVars2nd(const std::vector<CharStrRef> &v2nd)
{ vars2nd = v2nd; };
const std::vector<CharStrRef> &GetVars2nd() const
{ return vars2nd; };
void SetNumMaterials(int dom,int nmats);
int GetNDomains(void)
{ return nDomains; };
......@@ -120,8 +131,10 @@ struct DATABASE_API avtDatasetCollection
std::vector<void_ref_ptr> &GetAllMixVars(int i);
void ReplaceMixVar(int i,
void_ref_ptr mix);
private:
std::string var;
std::vector<CharStrRef> vars2nd;
int nDomains;
vtkDataSet ***vtkds;
avtMaterial **materials;
......
......@@ -51,6 +51,7 @@
#include <avtMaterial.h>
#include <avtSpecies.h>
#include <avtVariableCache.h>
#include <avtTransformManager.h>
#include <vectortypes.h>
......@@ -295,6 +296,8 @@ class PickVarInfo;
// Jeremy Meredith, Mon Aug 28 16:39:17 EDT 2006
// Added support for enumerated scalars.
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added transform manager. Added data spec to GetMaterial method.
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -332,6 +335,8 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
vtkDataArray *nonCachableVariableReference;
vtkDataSet *nonCachableMeshReference;
avtTransformManager *xformManager;
int lastTimestep;
virtual void PopulateSIL(avtSIL *, int=0);
......@@ -416,7 +421,7 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
void_ref_ptr GetMIR(int, const char *, int, vtkDataSet*,
avtMaterial *, int, bool, bool, bool,
bool, int, int, float, bool, bool&, bool&,bool);
avtMaterial *GetMaterial(int, const char *, int);
avtMaterial *GetMaterial(int, const char *, int, const avtDataSpecification_p = 0);
avtSpecies *GetSpecies(int, const char *, int);
void GetMaterialIndices(avtMaterial *,
stringVector &,
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2006, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtTransformManager.h //
// ************************************************************************* //
#ifndef AVT_TRANSFORM_MANAGER_H
#define AVT_TRANSFORM_MANAGER_H
#include <database_exports.h>
#include <string>
#include <vector>
#include <avtDataSpecification.h>
#include <avtMaterial.h>
#include <avtVariableCache.h>
struct avtDatasetCollection;
class avtDatabaseMetaData;
class avtSourceFromDatabase;
#include <vectortypes.h>
// ****************************************************************************
// Class: avtTransformManager
//
// Purpose: Manage data transformation services. Native data as read from the
// plugin is cached in Generic DB's cache. Transformed data is cached here.
//
// The transform manager's primary function is to replace items in the
// dataset collection in their native form (as read or cached in Generic DB)
// with their transformed counterparts (as computed or cached here). Because
// not all data returned to VisIt from Generic DB comes through the
// the dataset collection, there are some specialized services.
//
// Programmer: Mark C. Miller
// Creation: September 9, 2006
//
// ****************************************************************************
class DATABASE_API avtTransformManager
{
public:
avtTransformManager(avtVariableCache *gdbCache);
~avtTransformManager();
void FreeUpResources(int lastts);
bool TransformDataset(avtDatasetCollection &ds,
intVector &domains, avtDataSpecification_p &spec,
avtSourceFromDatabase *src,
boolVector &selectionsApplied,
avtDatabaseMetaData *md);
bool TransformMaterialDataset(const avtDatabaseMetaData *const md,
const avtDataSpecification_p &spec, avtMaterial **mat);
private:
vtkDataSet *NativeToFloat(const avtDatabaseMetaData *const md,
const avtDataSpecification_p &spec,
vtkDataSet *ds);
vtkDataSet *CSGToDiscrete(const avtDatabaseMetaData *const md,
const avtDataSpecification_p &spec,
vtkDataSet *ds);
avtVariableCache cache;
avtVariableCache *gdbCache;
};
#endif
......@@ -60,14 +60,7 @@ const char *avtVariableCache::SYMMETRIC_TENSORS_NAME = "SYMMETRIC_TENSORS";
const char *avtVariableCache::LABELS_NAME = "LABELS";
const char *avtVariableCache::ARRAYS_NAME = "ARRAYS";
const char *avtVariableCache::DATASET_NAME = "DATASET";
const char *avtVariableCache::NATIVE_SCALARS_NAME = "NATIVE_SCALARS";
const char *avtVariableCache::NATIVE_VECTORS_NAME = "NATIVE_VECTORS";
const char *avtVariableCache::NATIVE_TENSORS_NAME = "NATIVE_TENSORS";
const char *avtVariableCache::NATIVE_SYMMETRIC_TENSORS_NAME =
"NATIVE_SYMMETRIC_TENSORS";
const char *avtVariableCache::NATIVE_ARRAYS_NAME = "NATIVE_ARRAYS";
const char *avtVariableCache::NATIVE_DATASET_NAME = "NATIVE_DATASET";
const char *avtVariableCache::DATA_SPECIFICATION = "DATA_SPECIFICATION";
// ****************************************************************************
// Method: avtVariableCache::DestructVTKObject
......@@ -238,6 +231,11 @@ avtVariableCache::GetVTKObject(const char *var, const char *type, int timestep,
// Programmer: Hank Childs
// Creation: May 22, 2001
//
// Modifications:
//
// Mark C. Miller, Sun Dec 3 12:20:11 PST 2006
// Added RemoveObjectPointerPair to ensure we don't have a pair with obj
// already recorded
// ****************************************************************************
void
......@@ -263,10 +261,192 @@ avtVariableCache::CacheVTKObject(const char *name, const char *type,
vtkVars.push_back(v);
}
RemoveObjectPointerPair(obj);
avtCachedVTKObject *cvo = new avtCachedVTKObject(obj);
v->CacheItem(material, timestep, domain, cvo);
}
// ****************************************************************************
// Method: avtVariableCache::OneDomain::GetItem
//
// Purpose: Like GetItem, except only tests for existence of item's pointer
// and, if found, returns the dom associated with the item, if requested.
//