Commit 310ae8d5 authored by Lukas Weber's avatar Lukas Weber

test for correct seed saving

parent d515c67c
......@@ -30,3 +30,11 @@ $mc merge $testparams
if [ $? -ne 0 ]; then
exit 1
fi
seed1=$(h5dump -d '/random_number_generator/seed' -O /dev/null silly_job_long.data/task0001/run0001.dump.h5)
seed2=$(h5dump -d '/random_number_generator/seed' -O /dev/null silly_job_long.data/task0001/run0002.dump.h5)
if [ "$seed1" == "$seed2" ]; then
echo "Error: saved seeds are the same between different runs!"
exit 1
fi
......@@ -55,4 +55,13 @@ for obsname, obs in reference.items():
print('{}/{}: {} != {}'.format(obsname, entry, val, mcval))
failcount += 1
# check if seed was saved
dump = h5py.File('silly_job.data/task0001/run0001.dump.h5','r')
seed = dump['/random_number_generator/seed'][0]
seed_param = results[0]['parameters']['seed']
if seed != seed_param:
failcount += 1
print('seed was not saved!')
sys.exit(failcount)
......@@ -9,7 +9,8 @@
"task0001": {
"sweeps": 1000,
"thermalization": 20,
"binsize": 3
"binsize": 3,
"seed": 1461346775
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment