[MITgcm-devel] testreport for AD
Patrick Heimbach
heimbach at MIT.EDU
Thu Nov 13 03:54:49 EST 2003
Hi Ed,
here are some suggestions for AD-related testreport.
1. General
##########
I would distinguish between testing the adjoint
and testing the tangent linear; thus have an option
testreport (-adm|-tlm)
We could actually have the default to do both
with the option -ad (for 'automatic differentiation').
2. Build processes:
###################
(assuming either access to taf or staf is available;
we may think about whether we'd also want to test
compatibility w.r.t. tamc)
>>> -adm <<<
genmake2 -mods=../code_ad
make depend
make adall
>>> -tlm <<<
genmake2 -mods=../code_ad
make depend
make ftlall
>>> both <<<
genmake2 -mods=../code_ad
make depend
make adall
make ftlall
3. Running:
###########
To each directory code_ad(_extension)
there is an input_ad(_extension)
and a result_ad(_extension)
Note that the input_ad(_extension) does not usually
contains the input fields themselves (they don't change)
in order not to blow up the size of the download.
Also, each result_ad(_extension) now contains
* output.txt_adm
* output.txt_tlm
adm and tlm use the exact same inputs
./mitgcmuv_ad >&! output.txt_adm
./mitgcmuv_ftl >&! output.txt_tlm
4. Comparing:
############
Grep for
grep precision_grdchk_result output.txt_(adm|tlm)
In each case you'll get a set similar to
(PID.TID 0000.0001) precision_grdchk_result ADM 1.84044933456284E+14 1.74865283966910E+08
(PID.TID 0000.0001) precision_grdchk_result ADM 1.84044933456284E+14 1.31884844820653E+08
(PID.TID 0000.0001) precision_grdchk_result ADM 1.84044933456284E+14 1.96420903150567E+07
(PID.TID 0000.0001) precision_grdchk_result ADM 1.84044933456284E+14 -9.99869528291716E+06
or
(PID.TID 0000.0001) precision_grdchk_result TLM 1.84044933456284E+14 1.74865283966909E+08
(PID.TID 0000.0001) precision_grdchk_result TLM 1.84044933456284E+14 1.31884844820653E+08
(PID.TID 0000.0001) precision_grdchk_result TLM 1.84044933456284E+14 1.96420903150604E+07
(PID.TID 0000.0001) precision_grdchk_result TLM 1.84044933456284E+14 -9.99869528291790E+06
The precision/format is the same as the one for cg2d_init_res
The second-last term in each row is the cost function, the last one is the AD-derived gradient
(might think about adding the finite differnce gradient as well).
PASS/FAIL should be based on accuracy of last column.
In addition info on accuracy of the cost function can be given.
That's it I guess. Le me know if you have any questions.
Cheers
-Patrick
--
Patrick Heimbach ........................... M.I.T
FON: +1/617/253-5259 .......... EAPS, Room 54-1518
FAX: +1/617/253-4464 ..... 77 Massachusetts Avenue
mailto:heimbach at mit.edu ....... Cambridge MA 02139
http://www.mit.edu/~heimbach/ .............. U.S.A
More information about the MITgcm-devel
mailing list