Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /tests/vis15-bugs/parlife_sh.in
ViewVC logotype

View of /tests/vis15-bugs/parlife_sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4931 - (download) (annotate)
Thu Feb 16 20:30:44 2017 UTC (2 years, 7 months ago) by jhr
File size: 2000 byte(s)
  remove svnexecutable property
#!/bin/bash
set -o errexit
set -o nounset
shopt -s expand_aliases
JUNK=""
function junk {  JUNK="$JUNK $@"; }
function cleanup { rm -rf $JUNK; }
trap cleanup err exit int term

alias diderotc=@DIDEROTC@
alias unu=@TEEM_BIN@/unu

PROG=parlife

#Two bugs:
#
#1) compiling with --target=parallel and --debug results, via
#  DARGS="--target=parallel --snapshot --debug --exec $PROG.diderot"
# results in a compile failure:
#parlife.cxx:460:32: error: no member named '_nItems' in 'Diderot::strand_array::worker_cache'
#            assert (ix < this->_nItems);
#                         ~~~~  ^
#/usr/include/assert.h:93:25: note: expanded from macro 'assert'
#    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
#                        ^
#1 error generated.
#uncaught exception Fail [Fail: error compiling/linking]
#  raised at common/phase-timer.sml:78.57-78.59
#  raised at common/phase-timer.sml:78.57-78.59
#  raised at cxx-util/run-cc.sml:30.24-30.54
#
#2) without debug, compiling via:
#  DARGS="--target=parallel --snapshot --exec $PROG.diderot"
#creates a program that works, but only saves one snapshot and then exits.

#DARGS="--target=parallel --snapshot --debug --exec $PROG.diderot"  # BUG1
DARGS="--target=parallel --snapshot --exec $PROG.diderot" # BUG2

echo "@DIDEROTC@ $DARGS"
eval diderotc $DARGS

#valgrind \
./$PROG -s 1 -sp parlife-state -l 39 -NN 50 -init parlife-ggg.nrrd  ||:
junk parlife-state-*.nrrd

NUMSNAPS=$(ls -1 parlife-state-*.nrrd | wc -l)
if [[ $NUMSNAPS -ne 40 ]]; then
    echo "TEST FAIL: got $NUMSNAPS snapshots instead of expected 40"
    exit 1
fi

unu join -i parlife-state-*.nrrd -a 2 |
unu quantize -b 8 |
unu resample -s x3 x3 = -k box -c cell |
unu tile -a 2 0 1 -s 8 5 -o parlife-states.pgm
junk parlife-states.pgm

DIFF=$(unu diff parlife-states.pgm parlife-states-ref.pgm)
if [[ $DIFF != "unu diff: nrrds are the same" ]]; then
    echo "TEST FAIL: incorrect output: $DIFF"
    exit 1
fi

echo -e "\nTest passed."

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0