Disclaimer
Introduction
Data Files with PDBDiff
- PVA Files
PDBDiff Syntax
Starting PDBDiff
PDBDiff Commands
Default State
Other PACT Documents
Disclaimer
This document was prepared as an account of work sponsored by an agency of the United States Government. Nneither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, including the warranties of merchantability and fitness for a particular purpose, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes.Part of this work performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract W-7405-Eng-48.
Introduction
The PACT system provides a number of tools for working with PDB files in a fairly generic fashion. In particular, PDBDiff compares the contents of two PDB files and displays the differences (in a manner similar but not identical to the UNIX utility diff). PDBDiff can also be run in an interactive mode which allows you to compare two PDB files on a variable by variable or even leaf by leaf basis.PDBDiff is an SX program. SX is the SCHEME dialect of the LISP programming language with PACT extensions. The extensions provide functionality for graphics, binary data handling, and other areas of functionality.
PDBDiff has a help command which provides information about available commands.
Note: The files compared may have been created on or for different target machines. Consequently, a given data type may be represented differently in the two files. In this event values are compared to the precision in the first file, or the precision in the second file, or the precision you specify, whichever is least.
Data Files with PDBDiff
PDBDiff can be used to compare the contents of any two PDB files. It compares files entry by entry. In the most commonly used mode of use it has no knowledge of the semantics of the data in the files it compares.
2.1 PVA Files
There is a special kind of PDB file called a PVA (Portable Visualization and Analysis) file which contains data sets structured in a particular way so as to completely specify all information necessary to visualize the data set or to perform mathematical operations such as differentiation and integration on it. PANACEA codes produce PVA files as the PACT supported option for data output. PDBDiff can compare these files in a special way. Since it has complete information about the data sets, it can compare data sets which represent the same quantity but, potentially, with different amounts of information. For example, two runs of a numerical simulation code might compute a given quantity but with different resolution on the computational mesh. PDBDiff can compare these data sets by interpolating them to a common domain and computing the difference measure:
If the difference measure is less than a specified threshold (specified by the -t option), PDBDiff goes on to the next mapping in the file. However, if the difference measure exceeds the threshold, the two mappings, a and b, are displayed in separate windows along with the integrand above in its own window. The user is prompted to specify whether or not the differences are acceptable. In this way PDBDiff can be used as an aide to developing simulation codes and testing them.
PDBDiff Syntax
PDBDiff uses a slightly different data description syntax than PDBLib. With PDBLib variable names and names of members of structures cannot contain the characters: ., (, ), [, and ]. The characters (, ), [, and ] are used in array reference and dimension definition expressions. In PDBDiff, ( and ) CANNOT be used in variable reference expressions because they are special characters for PDBDiff. For example,
print a(2)is illegal and results in an error. The legal expression is:
print a[2]Other examples of legal expressions are:
print a.b[3,2]The first two forms are not identical. In the first form an element of a two dimensional array is being referenced. In the second form, the third element of the fourth array of arrays is being referenced (assuming zero based indexing in the definition of the b member of a).print a.b[3][2]
print a[3].b[2][5].c
print a[3].b[2][3].c[3:4,5:50:10]
For completeness and clarity in the following discussion, an index expression is defined as:
If an index expression uses either of the two starred forms it is said to be a hyper-index expression. A hyper-index expression implies more than one data item. Only the terminating index expression in a data reference may be a hyper-index expression. An index expression is said to dereference an indirection (or pointer or array). For each level of indirection a suitable index expression dereferences the desired data.index expression := [index list] index list := index | index, index list index := simple index | index-min : index-max | (*) index-min : index-max : increment (*) simple index := integer index-min := integer index-max := integer increment := integerFor example, this means that a variable defined as:
char **sis said to have two levels of indirection and can have parts accessed as follows:
In the above example a zero based index is assumed.
print s prints the entire item print s[2] prints the third character array of s print s[3][10] prints the eleventh character of the fourth character array of s When referring to part of a variable, especially a structured variable, the terminal node must be of primitive type or a structure containing no indirections and whose descendant members contain no indirections. Furthermore, the path to the desired part must contain one array reference for each level of indirection traversed.
Starting PDBDiff
On UNIX systems a shell script called pdbdiff is provided; it starts up SX and loads the PDBDiff SCHEME forms. You must add a line to your .cshrc or .profile file that defines the environment variable SCHEME. This variable tells SX where to find the PDBDiff program. Consult your system administrator or some other knowledgeable source to find where this is kept. If, for example, the directory /usr/local/scheme contains the PDBDiff program file, add the line:
setenv SCHEME /usr/local/schemeto your .cshrc or .profile file.
Usage:
pdbdiff [-a] [-b n] [-d] [-i] [-l] [-p f] [-s] [-t #] [-v] pdb-file1 pdb-file2
Options:
a - display all elements if any differb - number of mantissa bits to use in floating point comparisons
d - compare floating point types of differing precision
i - enter interactive mode
l - compare fixed point types of differing precision
p - fractional decimal precision to use in floating point comparisons
s - display only differing elements (default)
t - comparison tolerance for -v option defaults to 1.0e-8
v - compare PVA files (batch mode only currently)
PDBDiff Commands
In this section the PDBDiff commands are listed alphabetically. Each command is given with a brief description of its function and examples of its usage. The examples are intended to illustrate the various ways of invoking each command.
CD
Change the current file directory in the designated file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. If neither file is specified the file directory is changed for both files. The new directory may be specified by either a relative path or a full path.Usage: cd [directory] [1 | a | first | 2 | b | second]
Examples:
cd /zoo/mammalscd ../reptiles first
cd
CLOSE
Close the current pair of files.Usage: close
DESC
Describe the named variable or structure member in the designated file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. To get a description of part of a variable or structure member, qualify the name with index expressions (see the PDBDiff Syntax section for a discussion of index expressions).Usage: desc variable | structure-member [1 | a | first | 2 | b | second]
Examples:
desc Mapping1desc Mapping1.range 1
desc baz second
DIFF
Compare the values of the named variable(s) or structure member(s) in the two open files. If two variable names are provided, the values of the first variable in the first file will be compared with the values of the second variable in the second file. To compare part of a variable or structure member, qualify the name with index expressions (see the PDBDiff Syntax section for a discussion of index expressions). You may specify the format of the output with the mode and set commands.Usage: diff variable | structure-member [variable | structure-member]
Examples:
diff Mapping3diff foo.bar
diff abc def
END
End the PDBDiff session.Usage: end
FILE
Describe a PDB file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second.Usage: file [1 | a | first | 2 | b | second]
Examples:
filefile second
FORMAT
Set the printing format for a specified data type. If the argument specifying the type has 1 or 2 appended, then the new format is applied only to arrays shorter than array-length or to arrays longer than or equal to array-length, respectively. Otherwise, the format applies to both. Invoking the format command with the single argument, default, causes the formats for all types to be reset to their default values. The format argument must be a Standard C I/O Library format string. Double quotes are only necessary if the format string contains embedded blanks. See the set command for more information about the array-length display control parameter. This command overrides the settings of the decimal-precision and bits-precision display control parameters.
Usage: format integer[1 | 2] | long[1 | 2] | float[1 | 2] | double[1 | 2] | short[1 | 2] | char[1 | 2] format Usage: format default Examples:
format double %12.5eformat double2 %10.2e
format char %s
format default
HELP
Print a list of the available commands or information about the specified command.Usage: help [command]
Examples:
helphelp open
LS
List the names of variables, links, and directories in the designated file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. If neither file is specified the information is listed for both files. Directories have a terminal slash. An optional selection pattern may be specified. Each ? in the pattern matches any single character. Each * in the pattern matches any string of zero or more characters. An optional type qualifier may also be specified in order restrict the list to a given type. A type qualifier of * may be used to match all types. Both a selection pattern and a type qualifier must be specified if you wish to designate a file.Usage: ls [pattern [type [1 | a | first | 2 | b | second]]]
Examples:
ls dir1/curve*ls var? integer second
ls * Directory
ls * * first
MODE
Set the print mode for arrays and structures.Display modes are:
Type display is controlled by:
full-path - the full path name is printed at each branch, e.g. foo.bar[3].baz indent - indent 4 spaces at each branch (default) tree - display as a tree (lines connecting branches)
no-type - turns off the display of types (default)Display of recursive structures is controlled by:type - displays the type of each item and branch
recursive - indent each level of recursive structuresDisplay of differing elements is controlled by:iterative - number each level of recursive structures (default)
individual - display only differing elements (default)display-all - display all elements if even one differs
Usage: mode full-path | indent | tree | no-type | type | recursive | iterative | individual | display-all
Example:mode no-type
OPEN
Open a new pair of files.Usage: open filename1 filename2
Example:
open foo.s00 bar.s00
Print out all or part of the specified variable or structure member from the first or second file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. To print part of a variable or structure member, qualify the name with index expressions (see the PDBDiff Syntax section for a discussion of index expressions).Usage: print variable | structure-member [1 | a | first | 2 | b | second]
Examples:
Mapping2 firstprint Mapping2.range.elements[1] 2
a[5,10:20,1:8:3]
print a.b[3].c[5,10:20,1:8:3] b
PROMOTE
Promote lower precision types in the specified class or classes to higher precision to permit comparison, if necessary. Turn off promotion for classes not specified. The default is no promotion.Usage: promote [fixed] [float]
Examples:
promotepromote fixed
promote float
promote fixed float
PWD
Print the current file directory for the designated file.The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. If neither file is specified the current file directory will be printed for both files. NOTE: If the current file directory is the same for both files, it will only be printed once.Usage: pwd [1 | a | first | 2 | b | second]
Examples:
pwdpwd first
SET
Set the value of some display parameters. Parameters:
Usage: set line-length | array-length | bits-precision | decimal-precision value
line-length - number of array elements per line array-length - for arrays shorter than value, label each element individually bits-precision - number of mantissa bits compared in floating point numbers decimal-precision - limit on the fractional difference reported Examples:
set line-length 3set array-length 20
set bits-precision 10
set decimal-precision 1.0e-6
STRUCT
Describe the named data type in the specified file. The first file is designated by 1, a, or first and the second file is designated by 2, b, or second.Usage: struct data-type [1 | a | first | 2 | b | second]
Examples:
struct double 1struct PM_mapping second
TRANSCRIPT
Toggle a transcript of the PDBDiff session. The name of the transcript file may be specified when the transcript is activated. A file named pdbdiff.trn will contain the transcript of the session if no name is given.Usage: transcript [filename]
Examples:
transcripttranscript foo.bar
TYPES
List the data types in the designated file.The first file is designated by 1, a, or first and the second file is designated by 2, b, or second. If neither file is specified the data types will be printed for both files.Usage: types [1 | a | first | 2 | b | second]
Examples:
typestypes second
Default State
The initial state of PDBDiff is:
- mode indent
- mode no-type
- mode iterative
- mode individual
- set line-length 2
- set array-length 4
- set bits-precision 128 (i.e. use all mantissa bits in floating point comparisons)
Other PACT Documents
Interested readers may wish to refer to the other PACT documents which describe the data structures and functionality underlying the more common PDB files upon which PDBDiff operates. The PANACEA, PGS, and PDBLib manuals are of special interest to people who wish to generate and view data files with PACT.The list of PACT Documents is:
PACT Users Guide UCRL-MA-112087 SCORE Users Manual UCRL-MA-108976 Rev.1 PPC Users Manual UCRL-MA-108964 Rev.1 PML Users Manual UCRL-MA-108965 Rev.1 PDBLib Users Manual M-270 Rev.2 PGS Users Manual UCRL-MA-108966 Rev.1 PANACEA Users Manual M-276 Rev.2 ULTRA II Users Manual UCRL-MA-108967 Rev.1 PDBDiff Users Manual UCRL-MA-108975 Rev.1 Current Document PDBView Users Manual UCRL-MA-108968 Rev.1 SX Users Manual UCRL-MA-112315
Modified by: rodrigues2@llnl.gov