Skip to content

Smoothness Parameter Ignored in Test Script #9

@ben-e-whitney

Description

@ben-e-whitney

The test script src/mgard_test.c does not use the s parameter. Two illustrations:

  1. The output does not vary with s. Try running the following script. It is possible, but very unlikely, that this is due to the data.
#!/bin/bash

S_VALUES="-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 inf"

for s in $S_VALUES
do
	./mgard_test data/zort_111_160_15.{dat,mgard.$s} 111 160 15 1e-3 $s
done

for s in $S_VALUES
do
	diff --report-identical-files data/zort_111_160_15.mgard.{0.0,$s}
done
  1. As far as I can tell, s is used this way:
    1. main in mgard_test.c passes s to mgard_compress.

    2. mgard_compress passes s to mgard::refactor_qz.

    3. mgard::refactor_qz doesn't use s! To see this, compile with -Wunused-parameter:

      $ g++ -std=c++11 -c  -Wall -Wfatal-errors -Wunused-parameter -Iinclude  -Iblosc/include  -O3 -fPIC   -c src/mgard.cpp -o obj/mgard.o 2>&1 | grep --after-context 1 "unused parameter ‘s’"
      src/mgard.cpp:45:94: warning: unused parameter ‘s’ [-Wunused-parameter]
       refactor_qz (int nrow, int ncol, int nfib, const double *u, int &outsize, double tol, double s)
      --
      src/mgard.cpp:110:97: warning: unused parameter ‘s’ [-Wunused-parameter]
      	 double* recompose_udq(int nrow, int ncol, int nfib, unsigned char *data, int data_len, double s)
      

Additionally, the script improperly compares the tolerance tol (which, if I understand correctly, is on the relative error in the s norm) with the relative error in the L^∞ norm. Hopefully as a result, it reports a failure with this dataset (run after applying the commits in #8).

$ ./mgard_test data.{bin,mgard} 64 64 64 0.1 0
compress_memory_blosc: 1048584
compressor = zstd ;csize = 1946
compress_memory_blosc done: 137 milliseconds

In size:     2097152  Out size:       1946  Compression ratio:       1077 
Rel. L^2 error tolerance: 1.00000E-01 
Rel. L^infty error: 1.61896E-01 
FAILURE: Error tolerance NOT met!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions