Commit 494290c7 authored by allens's avatar allens

adding Uintah versioning and a variable check

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27765 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4197395c
......@@ -185,6 +185,7 @@ VISIT_OPTION_DEFAULT(VISIT_SILO_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP
##
## Uintah
##
SETUP_APP_VERSION(UINTAH 1.7.0)
VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR ${VISITHOME}/uintah/1.6.0/${VISITARCH})
##
......
......@@ -56,6 +56,9 @@ ${VTK_INCLUDE_DIRS}
ADD_DEFINITIONS(-DUINTAH_LIBRARY_DIR=${UINTAH_LIBRARY_DIR})
ADD_DEFINITIONS(-DUINTAH_UDA2VIS_LIB=${UINTAH_UDA2VIS_LIB})
ADD_DEFINITIONS(-DUINTAH_MAJOR_VERSION=${UINTAH_MAJOR_VERSION})
ADD_DEFINITIONS(-DUINTAH_MINOR_VERSION=${UINTAH_MINOR_VERSION})
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} ${UINTAH_LIBRARY_DIR} )
ADD_LIBRARY(IUintahDatabase ${LIBI_SOURCES})
......
......@@ -157,6 +157,8 @@ avtUintahFileFormat::avtUintahFileFormat(const char *filename,
#error "UINTAH_UDA2VIS_LIB has not been defined"
#endif
setenv("THREAD_NO_CATCH_SIGNALS", "True", 1);
// First try to open the library without any paths - assumes the
// user has the Uintah library parth in their *_LIBRARY_PATH.
libHandle = dlopen(lib_name, dlopen_mode);
......@@ -228,32 +230,34 @@ avtUintahFileFormat::avtUintahFileFormat(const char *filename,
// if( libHandle )
// std::cerr << __LINE__ << " Uintah lib " << lib << std::endl;
}
// Try a relative installed path
if (!libHandle)
{
char *lib = (char *) malloc( strlen(pathname) + strlen(lib_name) + 24 );
sprintf( lib, "%s/../../lib/uintah/%s", pathname, lib_name );
// Try a relative installed path
if (!libHandle)
{
char *lib = (char *) malloc( strlen(pathname) + strlen(lib_name) + 24 );
sprintf( lib, "%s/../../lib/uintah/%s", pathname, lib_name );
libHandle = dlopen(lib, dlopen_mode);
libHandle = dlopen(lib, dlopen_mode);
// if( libHandle )
// std::cerr << __LINE__ << " Uintah lib " << lib << std::endl;
}
// if( libHandle )
// std::cerr << __LINE__ << " Uintah lib " << lib << std::endl;
}
// Try a relative installed path
if (!libHandle)
{
char *lib = (char *) malloc( strlen(pathname) + strlen(lib_name) + 16 );
sprintf( lib, "%s/../../lib/%s", pathname, lib_name );
// Try a relative installed path
if (!libHandle)
{
char *lib = (char *) malloc( strlen(pathname) + strlen(lib_name) + 16 );
sprintf( lib, "%s/../../lib/%s", pathname, lib_name );
libHandle = dlopen(lib, dlopen_mode);
// if( libHandle )
// std::cerr << __LINE__ << " Uintah lib " << lib << std::endl;
}
libHandle = dlopen(lib, dlopen_mode);
// if( libHandle )
// std::cerr << __LINE__ << " Uintah lib " << lib << std::endl;
free( pathname );
}
}
......@@ -356,6 +360,13 @@ avtUintahFileFormat::avtUintahFileFormat(const char *filename,
EXCEPTION1(InvalidDBTypeException, "The function getGridData could not be located in the library!!!");
}
#if (1 <= UINTAH_MAJOR_VERSION && 7 <= UINTAH_MINOR_VERSION )
variableExists = (bool (*)(DataArchive*, std::string)) dlsym(libHandle, "variableExists");
if((error = dlerror()) != NULL) {
EXCEPTION1(InvalidDBTypeException, "The function variableExists could not be located in the library!!!");
}
#endif
getParticleData = (ParticleDataRaw* (*)(DataArchive*, GridP*, int, int, std::string, int, int)) dlsym(libHandle, "getParticleData");
if((error = dlerror()) != NULL) {
EXCEPTION1(InvalidDBTypeException, "The function getParticleData could not be located in the library!!!");
......@@ -576,7 +587,6 @@ avtUintahFileFormat::ReadMetaData(avtDatabaseMetaData *md, int timeState)
int totalPatches = 0;
for (int i = 0; i < numLevels; i++)
totalPatches += stepInfo->levelInfo[i].patchInfo.size();
//debug5 << "avtUintahFileFormat::ReadMetaData: Levels: " << numLevels << " Patches: " << totalPatches << endl;
vector<int> groupIds(totalPatches);
vector<string> pieceNames(totalPatches);
......@@ -885,7 +895,7 @@ avtUintahFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md, int timeS
// ****************************************************************************
void
avtUintahFileFormat::GetLevelAndLocalPatchNumber(int global_patch,
int &level, int &local_patch)
int &level, int &local_patch)
{
int num_levels = stepInfo->levelInfo.size();
int num_patches = 0;
......@@ -932,15 +942,24 @@ int avtUintahFileFormat::GetGlobalDomainNumber(int level, int local_patch) {
// within a refinement level, not across refinement levels.
//
//
// NOTE: The cache variable for the mesh MUST be called "any_mesh", which is a problem when
// there are multiple meshes or one of them is actually named "any_mesh" (see
// https://visitbugs.ornl.gov/issues/52). Thus, for each mesh we keep around our own cache
// variable and if this function finds it then it just uses it again instead of recomputing it.
// NOTE: The cache variable for the mesh MUST be called "any_mesh",
// which is a problem when there are multiple meshes or one of them is
// actually named "any_mesh" (see
// https://visitbugs.ornl.gov/issues/52). Thus, for each mesh we keep
// around our own cache variable and if this function finds it then it
// just uses it again instead of recomputing it.
//
// ****************************************************************************
void
avtUintahFileFormat::CalculateDomainNesting(int timestate, const std::string &meshname)
{
//#warning "FIX ME - IS THIS CODE VALID ??????"
#ifdef MDSERVER
return;
#else
//lookup mesh in our cache and if it's not there, compute it
if (*this->mesh_domains[meshname]==NULL || forceMeshReload == true)
{
......@@ -1088,6 +1107,7 @@ avtUintahFileFormat::CalculateDomainNesting(int timestate, const std::string &me
timestate, -1);
if (*vrTmp == NULL || *vrTmp != *this->mesh_domains[meshname])
throw InvalidFilesException("uda domain mesh not registered");
#endif
}
......@@ -1303,7 +1323,11 @@ avtUintahFileFormat::GetMesh(int timestate, int domain, const char *meshname)
//debug5<<"\t(*getParticleData)...\n";
//todo: this returns an array of doubles. Need to return expected datatype to avoid unnecessary conversion.
pd = (*getParticleData)(archive, grid, level, local_patch, "p.particleID", matlNo, timestate);
#if (1 <= UINTAH_MAJOR_VERSION && 7 <= UINTAH_MINOR_VERSION )
if( variableExists(archive, "p.particleID") )
#endif
pd = (*getParticleData)(archive, grid, level, local_patch, "p.particleID", matlNo, timestate);
//debug5 << "got particle data: "<<pd<<"\n";
if (pd)
......
......@@ -135,6 +135,9 @@ protected:
TimeStepInfo* (*getTimeStepInfo)(DataArchive*, GridP*, int, bool);
GridDataRaw* (*getGridData)(DataArchive*, GridP*, int, int, std::string, int, int, int[3], int[3]);
bool (*variableExists)(DataArchive*, std::string);
ParticleDataRaw* (*getParticleData)(DataArchive*, GridP*, int, int, std::string, int, int);
std::string (*getParticlePositionName)(DataArchive*);
......
......@@ -102,6 +102,7 @@ function bv_uintah_host_profile
echo "VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR $UINTAH_INSTALL_DIR)" >> $HOSTCONF
echo "SET(VISIT_USE_SYSTEM_UINTAH TRUE)" >> $HOSTCONF
else
echo "SETUP_APP_VERSION(UINTAH $UINTAH_VERSION)" >> $HOSTCONF
echo \
"VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR \${VISITHOME}/uintah/$UINTAH_VERSION/\${VISITARCH})" \
>> $HOSTCONF
......
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