[MITgcm-support] lsopt / optim routines

Matthew Mazloff mmazloff at ucsd.edu
Tue Apr 24 13:06:09 EDT 2018


Hi Andrew

I would make sure your data.optim is compatible with optim_m1qn3. I have pasted an example here:

 more ../../SOCCOM/Optim/data.optim 
#
# ********************************
# Off-line optimization parameters
# ********************************
 &OPTIM
 optimcycle=124,
 numiter=1000,
 nfunc=2,
 fmin= 2000000000.0,
 iprint=10,
 nupdate=3,
 /
#
 &M1QN3
 coldstart = .FALSE.,
 /
#

And then I wouldn’t use a script that takes many steps at once. Try stepping through one step at a time and see where it fails.

Matt



> On Apr 24, 2018, at 2:22 AM, Andrew McRae <andrew.mcrae at physics.ox.ac.uk> wrote:
> 
> What changes do I need to make to get this working with, e.g., tutorial_global_oce_optim?
> 
> I have added
> 
>  &M1QN3
>  &end
> 
> to data.optim, and have updated the cycsh script as the filenames there seem outdated:
> 
> 11c10
> <  cp -p OPTIM/ctrlhflux_tut_MITgcm.opt0$ii .
> ---
> >  cp -p OPTIM/ecco_ctrl_MIT_CE_000.opt0$ii .
> 27,28c26,27
> <  mv ctrlhflux_tut_MITgcm.opt0$ii $fich $direc
> <  mv costhflux_tut_MITgcm.opt0$ii OPTIM/
> ---
> >  mv ecco_ctrl_MIT_CE_000.opt0$ii $fich $direc
> >  mv ecco_cost_MIT_CE_000.opt0$ii OPTIM/
> 
> but, following the instructions from 3.18.5 of the .pdf manual, the optimisation seems to fail from the second iteration onwards:
> 
> Beginning of iteration 001
> Running mitcgm_ad: iteration 001
> STOP NORMAL END
> Cleaning
> rm: No match.
> mkdir: cannot create directory ‘runtutorial001’: File exists
> Line-search: iteration 001
>  optimcycle=1,
> Beginning of iteration 002
> Running mitcgm_ad: iteration 002
> STOP NORMAL END
> Cleaning
> rm: No match.
> mkdir: cannot create directory ‘runtutorial002’: File exists
> Line-search: iteration 002
>  optimcycle=2,
> STOP ABNORMAL in S/R OPTIM_SUB
> Beginning of iteration 003
> Running mitcgm_ad: iteration 003
> [Ctrl+C]
> 
> The file m1qn3_output.txt is attached.  I'm suspicious that lines 28-29 and 49-50 are the same; it looks like the step was never taken?
> 
> Thanks,
> Andrew
> 
> On 16 April 2018 at 11:24, Andrew McRae <andrew.mcrae at physics.ox.ac.uk <mailto:andrew.mcrae at physics.ox.ac.uk>> wrote:
> Thanks, this seems to work (at least, build, and the testbed files run).
> 
> Hopefully this 5-year old code replaces the 10-year old code in master at some point!
> 
> Andrew
> 
> On 20 March 2018 at 19:37, Matthew Mazloff <mmazloff at ucsd.edu <mailto:mmazloff at ucsd.edu>> wrote:
> Hello
> 
> Lately I have been using:
> http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/mlosch/optim_m1qn3/?pathrev=HEAD <http://wwwcvs.mitgcm.org/viewvc/MITgcm/MITgcm_contrib/mlosch/optim_m1qn3/?pathrev=HEAD>
> 
> This is an alternative search algorithm code that I find easier to use (Thanks again Martin!). You may want to give it a try
> 
> -Matt
> 
> 
>> On Mar 20, 2018, at 11:46 AM, Andrew McRae <andrew.mcrae at physics.ox.ac.uk <mailto:andrew.mcrae at physics.ox.ac.uk>> wrote:
>> 
>> Are these run as part of the daily builds?  I can't get it to build.
>> 
>> Following part 3.18.4.2 of the .pdf manual (I don't think this section has been ported online yet)...
>> 
>> In lsopt/, the supplied blas libraries are 10+ years old and my compiler says the Pentium 4 blas1 library is incompatible.
>> 
>> In optim/, "make depend" doesn't work (makedepend undefined).
>> 
>> "make" obviously causes the compiler to complain about -lblas1 not existing.
>> 
>> After changing the makefile to use -lblas instead of -lblas1, "make" gives the output
>> 
>> f77 -o optim.x  optim_main.o optim_sub.o optim_numbmod.o optim_initmod.o optim_readdata.o optim_writedata.o optim_write_control.o xerbla.o simul.o -L. -L../lsopt/ -llsopt_ecco -lblas
>> /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o: In function `_start':
>> (.text+0x20): undefined reference to `main'
>> optim_numbmod.o: In function `optim_numbmod_':
>> optim_numbmod.f:(.text+0x1ff1): undefined reference to `ilnblnk_'
>> optim_numbmod.f:(.text+0x2478): undefined reference to `ilnblnk_'
>> collect2: error: ld returned 1 exit status
>> Makefile:78: recipe for target 'optim.x' failed
>> make: *** [optim.x] Error 1
>> 
>> And this just looks like broken code rather than anything BLAS-related.  An undefined reference to main, and two undefined references to ilnblnk.
>> 
>> ilnblnk is defined with
>> c     == external ==
>>       integer  ilnblnk
>> 
>> Then used twice as
>> il = max(ilnblnk(record),1)
>> 
>> Any ideas?
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support>
> 
> 
> 
> <m1qn3_output.txt>_______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20180424/218c20e7/attachment.html>


More information about the MITgcm-support mailing list