[Users] hdf5 output for testsuites

Yosef Zlochower yosef at astro.rit.edu
Wed Aug 1 14:44:41 CDT 2012


On 07/31/2012 12:29 PM, Erik Schnetter wrote:
> This is a good idea. Either h5diff, or h5dump followed by diff should
> do the trick.
>
> Note that we build h5diff as part of the HDF5 thorn; it is available
> e.g. as exe/sim/h5diff.
>

I tried a simple hack of the testsuite mechanism, which seems to work
(in the sense that it tells you if the test passes or fails, but not
more precise information).



[yosef at quasar sbin]$ svn diff
Index: RunTestUtils.pl
===================================================================
--- RunTestUtils.pl     (revision 4848)
+++ RunTestUtils.pl     (working copy)
@@ -1278,6 +1278,8 @@
        my ($filereltol, $fileabstol);

        $newfile = "$test_dir$sep$file";
+      my $its_an_hdf5_file = ($newfile =~ /\.h5$/);
+
        # This is the standard location of test data files
        $oldfile = "$testdata->{\"$thorn 
TESTSDIR\"}${sep}${test}${sep}$file";
        # If there is no data in the standard location, see if it got 

@@ -1298,9 +1300,18 @@ 

        $rundata->{"$thorn $test $file NFAILWEAK"}=0; 

 

        ($fileabstol, 
$filereltol)=&GetFileTolerances($test,$thorn,$runconfig,$file); 

- 

-      if ( -s $newfile && -s $oldfile)
+      if ($its_an_hdf5_file)
        {
+        my $failures=`h5diff -d $fileabstol  $oldfile $newfile |
+             awk 'BEGIN {n=0} /differences found/{n=n+\$1} END{print n}'`;
+        $rundata->{"$thorn $test $file NFAILWEAK"}+=$failures;
+        $rundata->{"$thorn $test $file NFAILSTRONG"}+=$failures;
+        $rundata->{"$thorn $test $file MAXABSDIFF"} = 1;
+        $rundata->{"$thorn $test $file MAXRELDIFF"} = 1;
+        $rundata->{"$thorn $test $file NUMLINES"} = 1;
+      }
+      elsif ( -s $newfile && -s $oldfile)
+      {
          open (INORIG, "<$oldfile") || print "Warning: Archive file 
$oldfile not found";
          open (INNEW,  "<$newfile") || print "Warning: Test file 
$newfile not found";



> -erik
>
> On Tue, Jul 31, 2012 at 8:48 AM, Yosef Zlochower<yosef at astro.rit.edu>  wrote:
>> I was thinking about how to generate better testsuite for
>> the CCE code, in particular, SphericalHarmonicDecomp thorn. The
>> code generates an hdf5 file with coefficients for a
>> Chebyshev/spherical harmonic expansions of the metric
>> functions. Ideally, I would like to test that this hdf5
>> has the correct data. I could have the thorn also produce
>> ascii output, but it seems to be a stronger test to
>> examine the hdf5 file itself. Would it be possible to
>> do this as an extension to the testsuite mechanism?
>>
>> It seems like the h5diff (with the -d or -p option) program
>> could be used for the comparison itself.
>>
>> --
>> Dr. Yosef Zlochower
>> Center for Computational Relativity and Gravitation
>> Assistant Professor
>> School of Mathematical Sciences
>> Rochester Institute of Technology
>> 85 Lomb Memorial Drive
>> Rochester, NY 14623
>>
>> Office:74-2067
>> Phone: +1 585-475-6103
>>
>> yosef at astro.rit.edu
>>
>> CONFIDENTIALITY NOTE: The information transmitted, including
>> attachments, is intended only for the person(s) or entity to which it
>> is addressed and may contain confidential and/or privileged material.
>> Any review, retransmission, dissemination or other use of, or taking
>> of any action in reliance upon this information by persons or entities
>> other than the intended recipient is prohibited. If you received this
>> in error, please contact the sender and destroy any copies of this
>> information.
>> _______________________________________________
>> Users mailing list
>> Users at einsteintoolkit.org
>> http://lists.einsteintoolkit.org/mailman/listinfo/users
>
>
>


-- 
Dr. Yosef Zlochower
Center for Computational Relativity and Gravitation
Assistant Professor
School of Mathematical Sciences
Rochester Institute of Technology
85 Lomb Memorial Drive
Rochester, NY 14623

Office:74-2067
Phone: +1 585-475-6103

yosef at astro.rit.edu

CONFIDENTIALITY NOTE: The information transmitted, including
attachments, is intended only for the person(s) or entity to which it
is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking
of any action in reliance upon this information by persons or entities
other than the intended recipient is prohibited. If you received this
in error, please contact the sender and destroy any copies of this
information.


More information about the Users mailing list