Vdb check.py

VisIt Database Consistency Check (vdb_check.py) tool

This is a new tool for simulation developers to help check the data files their code's produce. It is still under development and may or may not provide enough information for developer's to diagnose issues with their database. The goal is to eventually add enough logic to this tool so that it enables developers of data producer codes to diagnose and correct issues with their code's output.

Use this tool to help identify any problems with a candidate database VisIt should read.

This tool will iterate over all the data objects in the database and perform some limited set of operations in VisIt with them. This process will help to identify and diagnose potential issues with the database. When having some difficulty with your data in VisIt, it is recommended that you first run this tool to see if it will help you identify and correct database problems.

An example of usage:

visit -cli -nowin -s vdb_check.py <db-name> [-t, --times [I0, I1, ...]] [--no-verbose] [--no-images]

For a database with multiple time steps, by default vdb_check.py will check only the first time step.

Note that if you are attempting this on database with large objects, you will need large compute resources. For simulation code developers working on either developing or adjusting database output to VisIt, it is best to work at smaller scales first, using this tool to confirm the database(s) your code is producing are readable by VisIt.

Some comments about vdb_check.py design

We have used a programming technique for vdb_check.py that is a lot like generic programming. We have avoided writing loops over specific object types in python. Instead, we have defined a string-valued object map which holds, for each class of object VisIt reads from a database (e.g. meshes, scalar variables, vector variables, materials, etc.) information about how to interrogate VisIt's Python avtDatabaseMetadata object obtained via a call to GetMetaData() CLI method. This very much simplifies the coding as exemplified below. Adjusting the code to handle new object classes added to VisIt is a simple matter of adding to the object map only.

visitDbObjectMap = {
    "Mesh":{
        "plotName":"Mesh",
        "mdName":"Meshes",
        "exName":"Mesh"
    },
    "Scalar":{
        "plotName":"Pseudocolor",
        "mdName":"Scalars",
        "exName":"ScalarMeshVar"
    },
    "Vector":{
        "plotName":"Vector",
        "mdName":"Vectors",
        "exName":"VectorMeshVar"
   }
.
.
.
}

def checkNotValidVars(md):
    for oClass in visitDbObjectMap:
        mdName = visitDbObjectMap[oClass]["mdName"]
        numObjsInClass = getattr(md, "GetNum%s"%mdName)()
        for i in range(numObjsInClass):
            objMd = getattr(md, "Get%s"%mdName)(i)
            if not objMd.validVariable:
                # print "Object of class %s is not valid"%oClass