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.
2.0
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:

3.0
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]
print a.b[3][2]
print a[3].b[2][5].c
print a[3].b[2][3].c[3:4,5:50:10]
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).
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 := integer
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.
For example, this means that a variable defined as:
char **s
is said to have two levels of indirection and can have parts accessed as follows:
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
In the above example a zero based index is assumed.
4.0
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/scheme
to your .cshrc or .profile file.
Usage: pdbdiff [-a] [-b n] [-d] [-i] [-l] [-p f] [-s] [-v] pdb-file1 pdb-file2
Options:
a -
display all elements if any differ
b -
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)
v -
compare PVA files (batch mode only currently)
5.0
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/mammals
cd ../reptiles first
cd
CLOSE
Close the current pair of files.
Usage: desc variable | structure-member [1 | a | first | 2 | b | second]
Examples:
desc Mapping1
desc Mapping1.range 1
desc baz second
DIFF
Compare the values of the named variable(s) or
Usage: diff variable | structure-member [variable | structure-member]
Examples:
diff Mapping3
diff foo.bar
diff abc def
END
End the PDBDiff session.
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.
Examples:
file
file second
FORMAT
Set the
Usage: format integer[1 | 2] | long[1 | 2] | float[1 | 2] |
Examples:
Examples:
double[1 | 2] | short[1 | 2] | char[1 | 2] format
Usage: format default
format double
%12.5 format double2 %10.2e
format char
%s
format default
HELP
Print a list of the available commands or information about the specified command. help
help 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
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
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)
Type display is controlled by:
no-type - turns off the display of types (default)
type - displays the type of each item and branch
Display of recursive structures is controlled by:
recursive - indent each level of recursive structures
iterative - number each level of recursive structures (default)
Display of differing elements is controlled by:
Example:
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. open foo.s00 bar.s00
PRINT
Print out all or part of the specified variable or structure
Usage: print variable | structure-member [1 | a | first | 2 | b | second]
Examples:
Mapping2 first
print 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
Usage: promote [fixed] [float]
Examples:
promote
promote fixed
promote float
promote fixed float
PWD
Print the
Usage: pwd [1 | a | first | 2 | b | second]
Examples:
pwd
pwd first
SET
Set the value of some display
Examples:
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
Usage: set line-length | array-length | bits-precision | decimal-precision value
set line-length 3
set array-length 20
set bits-precision 10
set decimal-precision 1.0e-6
STRUCT
Describe the named
Examples:
struct double 1
struct PM_mapping second
TRANSCRIPT
Toggle a transcript of the PDBDiff session. The name of the
Usage: transcript [filename]
Examples:
transcript
transcript 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.
Examples: Default State The initial state of PDBDiff is:
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 (this document)
PDBView Users Manual, UCRL-MA-108968 Rev.1
SX Users Manual, UCRL-MA-112315