[MITgcm-support] ensuring multiproc adfc=1 with tapenade
Daniel Goldberg
Dan.Goldberg at ed.ac.uk
Tue Jul 29 12:23:32 EDT 2025
Hello All
I am working with Laurent Hascoet, Krishna Narayanan and Shreyas Gaikwad to improve Tapenade functionality.
I am unsure if MITgcm-tapenade has been looked at closely with multiple cores. I am having an issue where the adjoint scales with the number of cores, and Laurent suggested this might be because the "seed" adfc (which should be 1) is duplicated across cores, and it should be set to 1 on process zero, and 0 elsewhere.
I am looking at cost_dependent_init.F at the following lines<https://github.com/MITgcm/MITgcm/blob/214bfe91bf8caee3cf215213baad672483c85b49/pkg/cost/cost_dependent_init.F#L49>:
#ifdef ALLOW_TAPENADE
fcb = 1.0
#endif
#ifdef ALLOW_OPENAD
adfc = 1.0
#else
if ( myProcId .EQ. 0 ) then
adfc = 1. _d 0
endif
#endif
I do not understand how OpenAD addresses this issue, but it seems like with TAF, adfc is set as above. I cannot use TAF but i can infer this gets the desired result. Therefore, similar should be done with Tapenade, and the above changed to:
#ifdef ALLOW_TAPENADE
fcb = 0.0
#endif
#ifdef ALLOW_OPENAD
adfc = 1.0
#else
if ( myProcId .EQ. 0 ) then
#ifdef ALLOW_TAPENADE
fcb = 1.0
#endif
adfc = 1. _d 0
endif
#endif
Is there any reason this would NOT be a good idea??
Many thanks
Dan
--
Daniel Goldberg, PhD (he/him)
Reader in Glaciology
School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP
https://dngoldberg.github.io/
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th' ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20250729/234700c1/attachment.html>
More information about the MITgcm-support
mailing list