[MITgcm-support] Issue compiling offline model with TAF on ARCHER

Dan Jones dcjones.work at gmail.com
Tue Nov 24 15:05:11 EST 2015


Hi Jean-Michel,

Thanks for your reply, and sorry for the delay.  I commented out the
"adexch" subroutine calls that were producing errors.  They were located in
the following files:

   addummy_in_stepping.F
   copy_ad_uv_outp.F
   monitor_ad.F

That did get rid of the 'adexch' related error messages, but I have a new
error that is a bit troubling:

----

   the_model_main.o: In function `the_model_main_':

   the_model_main.f:(.text+0x147): undefined reference to `mdthe_main_loop_'

----

when I grep 'mdthe_main_loop', I see it here:

----

   model_ad.flow:CADJ SUBROUTINE the_main_loop MODNAME = mdthe_main_loop

   model_ad.flowdir:CADJ SUBROUTINE the_main_loop MODNAME = mdthe_main_loop

   the_model_main.F:         IF (debugMode) CALL
DEBUG_CALL('MDTHE_MAIN_LOOP',myThid)

   the_model_main.F:         CALL TIMER_START('MDTHE_MAIN_LOOP
[MD RUN]', myThid)

   the_model_main.F:         CALL MDTHE_MAIN_LOOP ( myTime, myIter, myThid )

   the_model_main.F:         CALL TIMER_STOP ('MDTHE_MAIN_LOOP
[MD RUN]', myThid)

   the_model_main.f:         IF (debugMode) CALL
DEBUG_CALL('MDTHE_MAIN_LOOP',myThid)

   the_model_main.f:         CALL TIMER_START('MDTHE_MAIN_LOOP
[MD RUN]', myThid)

   the_model_main.f:         CALL MDTHE_MAIN_LOOP ( myTime, myIter, myThid )

   the_model_main.f:         CALL TIMER_STOP ('MDTHE_MAIN_LOOP
[MD RUN]', myThid)

----
Can I just remove 'mdthe_main_loop' from the flow directives in
model_ad.flow and model_ad.flowdir?

Thanks!
Dan

On Sun, Nov 8, 2015 at 5:00 PM, <mitgcm-support-request at mitgcm.org> wrote:

> Send MITgcm-support mailing list submissions to
>         mitgcm-support at mitgcm.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mitgcm.org/mailman/listinfo/mitgcm-support
> or, via email, send a message with subject or body 'help' to
>         mitgcm-support-request at mitgcm.org
>
> You can reach the person managing the list at
>         mitgcm-support-owner at mitgcm.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MITgcm-support digest..."
>
>
> Today's Topics:
>
>    1. Re: Issue compiling offline model with TAF on     ARCHER
>       (Jean-Michel Campin)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 7 Nov 2015 15:53:54 -0500
> From: Jean-Michel Campin <jmc at ocean.mit.edu>
> To: mitgcm-support at mitgcm.org
> Subject: Re: [MITgcm-support] Issue compiling offline model with TAF
>         on      ARCHER
> Message-ID: <20151107205354.GB40513 at ocean.mit.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Dan,
>
> My impression is that your adjoint set-up (cost-function and controls)
> is simpler enough that TAF does not need to generate the adjoint
> code of few EXCH routines (such as exch_uv_3d_rl, exch_uv_3d_rs,
> exch_xy_rs ...)
> and since we rely on these adjoint routines to output adjoint variables
> (in the hand-written output code in addummy_in_stepping.F)
> this produces this compiler error.
>
> The way we tried to make sure TAF will generate adjoint version of these
> EXCH routines was to call them for basic state variables (that are
> generally
> active), like in model/src/do_stagger_fields_exchanges.F, with the comment:
> > C- note: use less common EXCH S/R here (instead of usual ones) to
> > C        force TAF to also generate AD version for these rare ones
>
> Now a quick fix in our case could be
> a) simply to comment out these calls in addummy_in_stepping.F
>  - or -
> b) to set "#undef ALLOW_AUTODIFF_MONITOR" in AUTODIFF_OPTIONS.h
>    or in ECCO_CPPOPTIONS.h if you are using this one.
>   but in this case you will not get any AD-variables output
>
> Cheers,
> Jean-Michel
>
> On Wed, Nov 04, 2015 at 11:32:30PM +0000, Dan Jones wrote:
> > Hi all,
> >
> > I am trying to compile an offline adjoint configuration of MITgcm using
> TAF
> > on the ARCHER HPC system.  I received some errors that I don't know how
> to
> > address.  I was able to get a very similar set of errors compiling the
> > verification exercise "tutorial_dic_adjoffline", which I thought would be
> > easier to discuss an diagnose than my own configuration.
> >
> > Here is the error:
> >
> > addummy_in_stepping.o: In function `addummy_in_stepping_':
> >
> > addummy_in_stepping.f:(.text+0x101a): undefined reference to
> > `adexch_uv_3d_rl_'
> >
> > addummy_in_stepping.f:(.text+0x1033): undefined reference to
> > `adexch_uv_xy_rs_'
> >
> > addummy_in_stepping.f:(.text+0x1042): undefined reference to
> `adexch_xy_rs_'
> >
> > addummy_in_stepping.f:(.text+0x1051): undefined reference to
> `adexch_xy_rs_'
> >
> > copy_ad_uv_outp.o: In function `copy_ad_uv_outp_':
> >
> > copy_ad_uv_outp.f:(.text+0x36e): undefined reference to
> `adexch_uv_3d_rl_'
> >
> > monitor_ad.o: In function `admonitor_':
> >
> > monitor_ad.f:(.text+0xc0d): undefined reference to `adexch_uv_3d_rl_'
> >
> > the_model_main.o: In function `the_model_main_':
> >
> > the_model_main.f:(.text+0x147): undefined reference to `mdthe_main_loop_'
> >
> > make[1]: *** [mitgcmuv_ad] Error 1
> >
> > make[1]: Leaving directory
> >
> `/home1/n01/n01/dannes1/MITgcm_c65i/verification/tutorial_dic_adjoffline/build_ad'
> >
> > make: *** [ad_exe_target] Error 2
> >
> > It's true...some of the requested 'adexch' subroutines are not defined in
> > MITgcm.  For example, let's grep one of the function names in the
> > fully-linked build directory:
> >
> > ~/MITgcm_c65i/verification/tutorial_dic_adjoffline/build_ad> grep -i
> > adexch_uv_3d_rl *
> >
> > ad_input_code.f:c$taf SUBROUTINE exch_uv_3d_rl   ADNAME = adexch_uv_3d_rl
> >
> > addummy_in_stepping.F:         CALL ADEXCH_UV_3D_RL( aduVel,advVel,
> .TRUE.,
> > Nr, myThid )
> >
> > addummy_in_stepping.f:         CALL ADEXCH_UV_3D_RL( aduVel,advVel,
> .TRUE.,
> > Nr, myThid )
> >
> > Binary file addummy_in_stepping.o matches
> >
> > copy_ad_uv_outp.F:        CALL ADEXCH_UV_3D_RL( wSign,nNz,myThid,
> > uFldOut,vFldOut )
> >
> > copy_ad_uv_outp.F:        CALL ADEXCH_UV_3D_RL( uFldOut,vFldOut,
> > wSign,nNz,myThid )
> >
> > copy_ad_uv_outp.f:        CALL ADEXCH_UV_3D_RL( uFldOut,vFldOut,
> > wSign,nNz,myThid )
> >
> > Binary file copy_ad_uv_outp.o matches
> >
> > exch1_ad.flow:c$taf SUBROUTINE exch_uv_3d_rl   ADNAME = adexch_uv_3d_rl
> >
> > exch1_ad.flowdir:c$taf SUBROUTINE exch_uv_3d_rl   ADNAME =
> adexch_uv_3d_rl
> >
> > monitor_ad.F:          CALL ADEXCH_UV_3D_RL( aduVel, advVel, .TRUE., Nr,
> > myThid )
> >
> > monitor_ad.f:          CALL ADEXCH_UV_3D_RL( aduVel, advVel, .TRUE., Nr,
> > myThid )
> >
> > Binary file monitor_ad.o matches
> >
> > I see TAF directives and calls, but not subroutine definitions.  Why do
> > some of these definitions seem to be missing?
> >
> > Note that these errors *only* show up if the 'offline' package is turned
> on
> > in code_ad/packages.conf.
> >
> > A little configuration info:
> > - Source:  MITgcm c65i
> > - TAF version 2.9.13
> > - Tried with Intel ifort compiler 14.0.4 and current ARCHER default GNU
> > compiler
> > - Using default adjoint build options file
> > ($ROOTDIR/tools/adjoint_options/adjoint_default)
> >
> > Thanks,
> > Dan
> >
> > ----------------------------------------------------------
> > Dr Dan Jones
> >
> > Oceanographer
> > British Antarctic Survey <http://www.bas.ac.uk/>, NERC
> >
> > ----------------------------------------------------------
>
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
>
>
> ------------------------------
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
> End of MITgcm-support Digest, Vol 149, Issue 7
> **********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20151124/66a69eb7/attachment.htm>


More information about the MITgcm-support mailing list