1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
|
<!--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-->
<!-- NEW PAGE -->
<!-- HEADER RIGHT "h5diff" -->
<hr>
<dl>
<dt><div align=right><font color=999999 size=-1><i>
Last modified: 22 August 2012
</i></font></div>
<dt><strong>Tool Name:</strong> <a name="Tools-Diff">h5diff</a>
<dt><strong>Syntax:</strong>
<dd><code>h5diff </code> [<em>OPTIONS</em>]
<em>file1</em> <em>file2</em>
[<em>object1</em> [<em>object2</em> ] ]
<!--
<dd><code>h5diff </code> <em>file1</em> <em>file2</em>
[<em>OPTIONS</em>]
[<em>object1</em> [<em>object2</em> ] ]
-->
<p>
<dd><code>ph5diff </code> [<em>OPTIONS</em>]
<em>file1</em> <em>file2</em>
[<em>object1</em> [<em>object2</em> ] ]
<!--
<dd><code>ph5diff </code> <em>file1</em> <em>file2</em>
[<em>OPTIONS</em>]
[<em>object1</em> [<em>object2</em> ] ]
-->
<p>
<dt><strong>Purpose:</strong>
<dd>Compare two HDF5 files and report the differences.
<p>
<dt><strong>Description:</strong>
<dd><code>h5diff</code> and <code>ph5diff</code> are command line tools
that compare two HDF5 files, <em>file1</em> and <em>file2</em>,
and report the differences between them.
<code>h5diff</code> is for serial use while
<code>ph5diff</code> is for use in parallel environments.
<p>
Optionally, <code>h5diff</code> and <code>ph5diff</code>
will compare two objects within these files.
If only one object, <em>object1</em>, is specified,
<code>h5diff</code> will compare
<em>object1</em> in <em>file1</em>
with <em>object1</em> in <em>file2</em>.
If two objects, <em>object1</em> and <em>object2</em>,
are specified, <code>h5diff</code> will compare
<em>object1</em> in <em>file1</em>
with <em>object2</em> in <em>file2</em>.
<p>
<em>object1</em> and <em>object2</em>
can be groups, datasets, named datatypes, or symbolic links
(soft links or external links)
and must be expressed as absolute
paths from the respective file’s root group.
<ul>
<li>If these objects are groups, <code>h5diff</code>
first compares the names of member objects (the relative path
from the specified group) and generates a report of objects
that appear in only one group or in both groups.
Common objects are then compared recursively.
<li>If these objects are datasets, array rank and dimensions,
datatypes, and data values are compared.
<li>If these objects are named datatypes, the comparison
is based on the return value of
<code><a href="RM_H5T.html#Datatype-Equal">H5Tequal</a></code>.
<li>If these objects are symbolic links, the paths to the target
objects are compared.
<br>
(The option <code>--follow-symlinks</code> overrides the default
behavior when symbolic links are compared.)
</ul>
<p>
<a name="OutputModes">
<b>Output modes:</b>
</a>
<br>
<code>h5diff</code> and <code>ph5diff</code>
have the following output modes:
<dir>
<table border=0>
<tr valign="top"><td>Default</td>
<td><code> </code></td>
<td>Prints the number of differences found
and where they occurred.
<br>
If no differences are found, <code>h5diff</code> and
<code>ph5diff</code> produce no output.
<br>
This <i>normal</i> behavior is achieved by using
none of the following output mode options.
</td></tr>
<tr valign="top"><td>Report mode</td>
<td><code>-r</code></td>
<td>Prints the above plus the differences.
</td></tr>
<tr valign="top"><td>Verbose mode </td>
<td><code>-v</code></td>
<td>Prints all of the above plus a list of objects and warnings.
</td></tr>
<tr valign="top"><td>Verbose mode
<br>
with levels</td>
<td><code>-v<i>n</i></code></td>
<td>Prints a selectable level of detail.
<br>
For details, see “Options and Parameters” below.
</td></tr>
<tr valign="top"><td>Quiet mode</td>
<td><code>-q</code></td>
<td>Prints no output.
<br>
The <code>h5diff</code> exit code will be
the only feedback provided.
</td></tr>
</table>
</dir>
<p>
<a name="ComparisonModes">
<b>Difference controls:</b>
</a>
<br>
<code>h5diff</code> offers several mutually-exclusive criteria for
analyzing differences in raw data:
<ul>
<li><i>Strict equality</i> —
The default comparison mode is to check for strict
equality of data values.
<li><i>Fixed difference</i> —
With the <code>'-d <em>delta</em>'</code> or
<code> '--delta=<em>delta</em>'</code> option,
<code>h5diff</code> considers two data values to be equal
if the absolute value of the difference is less than the
specified <code><em>delta</em></code>.
<li><i>Relative difference</i> —
With the <code>'-p <em>relative</em>'</code> or
<code> '--relative=<em>relative</em>'</code> option,
<code>h5diff</code> considers two data values to be equal
if the absolute value of the relative difference is less
than the value specified in <code><em>relative</em></code>.
<li><i>System epsilon</i> —
With the <code>'--use-system-epsilon'</code> option,
<code>h5diff</code> considers two data values to be equal
if the absolute value of the difference is less than the
computing platform’s system epsilon (or a pre-determined
value if no system epsilon is defined).
</ul>
<p>
<a name="NaNs">
<b><code>h5diff</code> and NaNs:</b>
</a>
<br>
<code>h5diff</code> detects when a value in a dataset is a NaN
(a "not a number" value), but does not differentiate among various
types of NaNs.
Thus, when one NaN is compared with another NaN, <code>h5diff</code>
treats them as equal; when a NaN is compared with a valid number,
<code>h5diff</code> treats them as not equal.
<p>
Note that NaN detection is computationally expensive and slows
<code>h5diff</code> performance dramatically.
If you do not have NaNs in your files, or do not care about NaNs,
use the <code>-N</code> option to turn off NaN detection.
Similarly, if <code>h5diff -N</code> produces unexpected differences,
running <code>h5diff</code> without <code>-N</code> should reveal
whether any of the differences are associated with NaN values.
<p>
<b>Difference between <code>h5diff</code> and <code>ph5diff</code>:</b>
<br>
With the following exception,
<code>h5diff</code> and <code>ph5diff</code> behave identically.
With <code>ph5diff</code>, the comparison of objects is shared across
multiple processors, with the comparison of each pair of objects
assigned to a single processor. This work assignment means that
<code>ph5diff</code> will not speed up the comparison of any
given pair of datasets,
as the comparison of the pair will still occur on a single processor.
<!--
Additional information, with several sample cases,
can be found in the document
<a href="http://www.hdfgroup.org/HDF5/h5diff/h5diff_design.html">
<cite>H5diff Examples</cite></a>.
-->
<p>
<dt><strong>Options and Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><code>-h</code>
or
<code>--help</code></td>
<td valign="top">Print help message.</td></tr>
<tr>
<td valign="top"><code>-V</code>
or
<code>--version</code></td>
<td valign="top">Print version number and exit.</td></tr>
<tr>
<td valign="top"><code>-r</code>
or
<code>--report</code></td>
<td valign="top">Report mode —
Print the differences.</td></tr>
<tr>
<td valign="top"><code>-v</code>
or
<code>--verbose</code></td>
<td valign="top">Verbose mode —
Print difference information, list of objects, warnings, etc.
</td></tr>
<tr>
<td valign="top"><code>-v<em>n</em></code>
or
<br>
<code> --verbose=</code><em>n</em></td>
<td valign="top">Verbose mode with levels—
Print difference information, list of objects,
warnings, etc., with the level of detail determined by
value of <code><em>n</em></code>:
<table width="100%">
<tr valign="top"><td><code> 0 </code></td>
<td>Basic difference information, list of objects,
and warnings.
<br>
Identical to <code>-v, --verbose</code>.
</td></tr>
<tr valign="top"><td><code> 1</code></td>
<td>All level <code>0</code> information
plus a one-line attribute status summary.
</td></tr>
<tr valign="top"><td><code> 2</code></td>
<td>All level <code>1</code> information
plus an extended attribute status report.
</td></tr>
</table>
</td></tr>
<tr>
<td valign="top"><code>-q</code>
or
<code>--quiet</code></td>
<td valign="top">Quiet mode —
Do not print output.
<p>
</td></tr>
<tr>
<td valign="top"><code>--follow-symlinks</code></td>
<td valign="top">Follow symbolic links
(soft links and external links) and compare the links’
target objects.
<p>If symbolic link(s) with the same name exist in the files
being compared, then determine whether the target of each
link is an existing object (dataset, group, or named datatype)
or the link is a dangling link (a soft or external link
pointing to a target object that does not exist).
<ul>
<li>If both symbolic links are dangling links,
they are treated as being the same; by default,
<code>h5diff</code> returns an exit code of <code>0</code>.
If, however,
<code>--no-dangling-links</code> is used with
<code>--follow-symlinks</code>, this situation is treated as
an error and <code>h5diff</code> returns an exit code of
<code>2</code>.
<li>If only one of the two links is a dangling link,
they are treated as being different and <code>h5diff</code>
returns an exit code of <code>1</code>. If, however,
<code>--no-dangling-links</code> is used with
<code>--follow-symlinks</code>, this situation is treated as
an error and <code>h5diff</code> returns an exit code of
<code>2</code>.
<li>If both symbolic links point to existing objects,
<code>h5diff</code> compares the two objects.
</ul>
<p>If any symbolic link specified in the call to
<code>h5diff</code> does not exist,
<code>h5diff</code> treats it as an error and returns
an exit code of <code>2</code>.
</td></tr>
<tr>
<td valign="top"><code>--no-dangling-links</code></td>
<td valign="top">Must be used with the
<code>--follow-symlinks</code> option;
otherwise, h5diff shows error message and
returns an exit code of <code>2</code>.
<p>
Check for symbolic links (soft links or external links)
that do not resolve to an existing object (dataset, group,
or named datatype). If a dangling link is found, this
situation is treated as an error and <code>h5diff</code>
returns an exit code of <code>2</code>.
</td></tr>
<tr>
<td valign="top"><code>-N</code>
or
<code>--nan</code></td>
<td valign="top">Disables NaN detection;
see “<code>h5diff</code> and NaNs” above.
</td></tr>
<tr>
<td valign="top"><code>-n</code> <em>count</em>
or
<br>
<code> --count=</code><em>count</em>
<p>
</td>
<td valign="top">Print difference up to <em>count</em>
differences, then stop.
<em>count</em> must be a positive integer.
<p>
</td></tr>
<tr>
<td valign="top"><code>-d</code> <em>delta</em>
or
<br>
<code> --delta=</code><em>delta</em></td>
<td valign="top">Print only differences that are greater than the
limit <em>delta</em>. <em>delta</em> must be a positive number.
The comparison criterion is whether the absolute value of the
difference of two corresponding values is greater than
<em>delta</em>
(i.e., <code> |a–b| > <em>delta</em></code>,
where <code>a</code> is a value in <em>file1</em> and
<code>b</code> is a value in <em>file2</em>).
<p>
Do not use <code>-d, --delta</code> with
<code>-p, --relative</code> or <code>--use-system-epsilon</code>.
</td></tr>
<tr>
<td valign="top"><code>-p</code> <em>relative</em>
or
<br>
<code> --relative=</code><em>relative</em></td>
<td valign="top">Print only differences that are greater than a
relative error. <em>relative</em> must be a positive number.
The comparison criterion is whether the absolute value of the
ratio of the difference between two values and one of those
values is greater than <em>relative</em> (that is,
<code>|(a–b)/b)| > <em>relative</em></code>
where <code>a</code> is a value in <em>file1</em> and
<code>b</code> is the corresponding value in <em>file2</em>).
<p>
Do not use <code>-p, --relative</code> with
<code>-d, --delta</code> or <code>--use-system-epsilon</code>.
</td></tr>
<tr>
<td valign="top">
<code>--use-system-epsilon</code>
<br>
<code> </code>
</td>
<td valign="top">Return a difference if and only if the difference
between two data values exceeds the system value for epsilon.
That is, if <code><i>a</i></code> is a data value in one dataset,
<code><i>b</i></code> is the corresponding data value in the
dataset with which the first dataset is being compared, and
<code><i>epsilon</i></code> is the system epsilon,
return a difference if and only if
<code>|<i>a</i>-<i>b</i>| > <i>epsilon</i></code>.
<p>
If no system epsilon is defined, <code>h5diff</code>
will use the following values,
which approximate common system epsilon values:
<dir>
<code>FLT_EPSILON=1.19209E-07</code> for
floating-point datatypes
<br>
<code>DBL_EPSILON=2.22045E-16</code> for
double precision datatypes
</dir>
<p>
Do not use <code>--use-system-epsilon</code> with
<code>-d, --delta</code> or <code>-p, --relative</code>.
<p>
</td></tr>
<tr>
<td valign="top">
<code>--exclude-path "<em>path</em>"</code>
</td>
<td valign="top">Exclude the specified <em>path</em> to an object
when comparing files or groups. If a group is excluded,
all member objects will also be excluded.
<p>
The specified path is excluded wherever it occurs.
This flexibility enables the same option to exclude
either objects that exist only in one file
or common objects that are known to differ.
<p>
When comparing files, <em>path</em> is the
absolute path to the excluded object; when comparing
groups, <em>path</em> is similar to the relative path
from the group to the excluded object.
This <em>path</em> can be taken from the first section of
the output of the <code>--verbose</code> option.
For example, if you are comparing the group
<code>/groupA</code> in two files and you want to exclude
<code>/groupA/groupB/groupC</code> in both files,
the exclude option would read as follows:
<br>
<code> </code>
<code>--exclude-path "/groupB/groupC"</code>
<p>
If there are multiple paths to an object, only the
specified path(s) will be excluded; the comparison
will include any path not explicitly excluded.
<p>
This option can be used repeatedly to exclude
multiple paths.
<p>
</td></tr>
<tr>
<td valign="top"><em>file1</em>
<em>file2</em></td>
<td valign="top">The HDF5 files to be compared.</td></tr>
<tr>
<td valign="top"><em>object1</em>
<em>object2</em></td>
<td valign="top">Specific object(s) within the files
to be compared, expressed as absolute paths
from the respective file’s root group.</td></tr>
</table></ul>
<br />
<dt><strong>Exit Status for h5diff:</strong></dt>
<dd><table border="0" width="100%">
<tr valign="top" align="left">
<td width="5%">0</td>
<td width="95%">No differences were found.</td>
</tr>
<tr valign="top" align="left">
<td>1</td>
<td>Some differences were found.</td>
</tr>
<tr valign="top" align="left">
<td>>1 </td>
<td>An error occurred.</td>
</tr>
</table></dd>
<br />
<dt><strong>Exit Status for ph5diff:</strong></dt>
<dd>Because of the limitations in the MPI standard, the return value
is not defined. </dd>
<br />
<dt><strong>Examples:</strong>
<dd>Compare the object <code>/a/b</code> in <code>file1</code>
with the object <code>/a/c</code> in <code>file2</code>:<br>
<code> h5diff file1 file2 /a/b /a/c</code>
<p>
Compare the object <code>/a/b</code> in <code>file1</code>
with the same object in <code>file2</code>:<br>
<code> h5diff file1 file2 /a/b</code>
<p>
Compare all objects in both files:<br>
<code> h5diff file1 file2</code>
<!-- NEW PAGE -->
<p>
Comparisons executed with the verbose options can produce
object and attribute status reports as illustrated below:<br />
<code> h5diff -v file1 file2</code>
<pre>
...
file1 file2
---------------------------------------
x x /
x /dset
x /g2
x x /g3
...
</pre>
The sample output above shows that
the dataset <code>dset</code> exists only in <code>file2</code>,
the group <code>/g2</code> exists only in <code>file1</code>, and
the group <code>/g3</code> and the root group exist in both files.
Only objects that exist in both files will be compared.
More verbose levels can produce more information:<br />
<code> h5diff -v2 file1 file2</code>
<pre>
...
group : ‹/g2› and ‹/g2›
0 differences found
obj1 obj2
--------------------------------------
x x float2
x float3
x x integer1
Attributes status: 2 common, 1 only in obj1, 0 only in obj2
...
</pre>
In this illustration,
both objects, <code>obj1</code> and <code>obj2</code>,
have attributes named <code>float2</code> and <code>integer1</code>,
while only <code>obj1</code> has an attribute named <code>float3</code>.
Only attributes that exist on both objects will be compared.
<p>
The “Attributes status:” line reports that there are
two attributes common to both objects:
one attribute attached only to <code>obj1</code>, and
zero attributes attached only to <code>obj2</code>.</p>
<p>
To see the “Attributes status:” line independently
of the immediately-preceding table, use the -v1 option.<br />
<code> h5diff -v1 file1 file2</code>
<pre>
...
group : ‹/g2› and ‹/g2›
0 differences found
Attributes status: 2 common, 1 only in obj1, 0 only in obj2
...
</pre>
<p>
<dt><strong>History:</strong>
<dd><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>Change</strong></td></tr>
<tr>
<td valign="top">1.6.0</td>
<td valign="top">
<code>h5diff</code> introduced in this release.</td></tr>
<tr>
<td valign="top">1.8.0</td>
<td valign="top">
<code>ph5diff</code> introduced in this release.
<br>
<code>h5diff</code> command line syntax changed in this
release.</td></tr>
<!--
<tr>
<td valign="top">1.8.1</td>
<td valign="top">
Original syntax restored; both the original and the new syntax
are now supported.</td></tr>
-->
<tr>
<td valign="top">1.8.2 and 1.6.8</td>
<td valign="top">
Return value on failure changed in this release.</td></tr>
<tr>
<td valign="top">1.8.4 and 1.6.10 </td>
<td valign="top">
<code>--use-system-epsilon</code> option added in this release.
</td></tr>
<tr>
<td valign="top">1.8.5</td>
<td valign="top">
<code>--follow-symlinks</code> option added in this release.
<br>
<code>--no-dangling-links</code> option added in this release.
</td></tr>
<tr>
<td valign="top">1.8.6</td>
<td valign="top">
<code>--exclude-path</code> option added in this release.
</td></tr>
<tr>
<td valign="top">1.8.7</td>
<td valign="top">
<code>-v<i>n</i>, --verbose=<i>n</i></code> option,
specifying levels of verbose output, added in this release.
</td></tr>
</table></dd>
<!--
<p>
<dt><strong>Current Status:</strong>
<dd>
<p>
<dt><strong>See Also:</strong>
<dd>
-->
</dl>
|