[ADMB Users] Fwd: -lprof -iprint

CHRIS GRANDIN cgrandin at shaw.ca
Wed Sep 17 12:47:27 PDT 2014


I could also change the code to keep the hessian information from being output when -iprint 0 is given if there is interest in that.
Chris

----- Forwarded Message -----
From: "CHRIS GRANDIN" <cgrandin at shaw.ca>
To: "laurie" <lauriekell at gmail.com>
Sent: Wednesday, September 17, 2014 12:40:16 PM
Subject: Re: [ADMB Users] -lprof -iprint

Ok, I fixed it and committed the changes to the ADMB source svn, or if you want you can replace the beginning of the function likeprof_routine in the file src/nh99/mod_pmin.cpp on line 70, then rebuild the admb source.

  void function_minimizer::likeprof_routine(double global_min)
  {
    int on1 = 0;
    int nopt = 0;
    if ( (on1=option_match(ad_comm::argc,ad_comm::argv,"-iprint",nopt))>-1)
    {
      if (!nopt)
      {
        cerr << "Usage -iprint option needs integer  -- ignored" << endl;
        iprint = 10;
      }
      else
      {
        int jj=atoi(ad_comm::argv[on1+1]);
        iprint = jj;
      }
    }
    else
    {
      iprint = 10;
    }

And then the rest of the function...

Best of luck,
Chris

----- Original Message -----
From: "laurie" <lauriekell at gmail.com>
To: "CHRIS GRANDIN" <cgrandin at shaw.ca>
Sent: Wednesday, September 17, 2014 11:04:07 AM
Subject: Re: [ADMB Users] -lprof -iprint

Thanks, yes changing the source code is not a good idea.

I would check with the catage example because that is the one where an 
object of type

likeprof_number

is used that is causing the problem. It isnt declared in simple, so that 
is may explain why the output is OK

Laurie

On 17/09/14 19:56, CHRIS GRANDIN wrote:
> Hi Laurie,
> Thanks but I think changing the source there is a bad idea, it will likely break other things.
> I have the latest source (rev 2364, Sep 16) and I ran:
>
> simple -lfprof -iprint 0
>
> and it gave the output:
>
> Estimating row 1 out of 2 for hessian
> Estimating row 2 out of 2 for hessian
>
> So there is no gradient information being printed out. I traced this through the code using a debugger and everything seems to be working right. Can you run the simple example, and let me know if this is what you get?
> Thanks,
> Chris
>
> ----- Original Message -----
> From: "laurie" <lauriekell at gmail.com>
> To: "CHRIS GRANDIN" <cgrandin at shaw.ca>
> Sent: Wednesday, September 17, 2014 10:11:05 AM
> Subject: Re: [ADMB Users] -lprof -iprint
>
> This what I "think" I changed
>
> void do_dll_housekeeping(int argc,char ** argv)
> {
>     int on;
> #if defined(__SPDLL__)
>     if ( (on=option_match(argc,argv,"-sp"))>-1)
>     {
>       get_sp_printf();
>       ad_exit=spdll_exit;
>     }
>     else if ( (on=option_match(argc,argv,"-spexit"))>-1)
>     {
>       ad_printf=0; //printf;
>       ad_exit=spdll_exit;
>     }
>     else
>     {
>       ad_exit=exit;
>       if (!ad_printf) ad_printf=printf;
>     }
> #else
>     ad_exit=exit;
>
>     if (!ad_printf) ad_printf=printf;
> #endif
> }
>
>
> On 17/09/14 18:11, CHRIS GRANDIN wrote:
>> Hi Laurie,
>>    I'd like to see what you did but my line 154 in model33.cpp has nothing on it. Perhaps you have an older version of the source. Can you send a code snippet including lines around the line you changed so I can find it. Thanks
>> Chris
>>
>> ----- Original Message -----
>> From: "laurie" <lauriekell at gmail.com>
>> To: "Steve Martell" <SteveM at iphc.int>, "CHRIS GRANDIN" <cgrandin at shaw.ca>, "Jim Ianelli" <jim.ianelli at noaa.gov>
>> Cc: "ADMB" <users at admb-project.org>
>> Sent: Wednesday, September 17, 2014 1:01:41 AM
>> Subject: Re: [ADMB Users] -lprof -iprint
>>
>> Thanks for all your help. I am running linux, calling my exe from R and
>> running it in parallel.
>>
>> The print output slows things down and as I am simulation testing the
>> profile method I am never going to read the screen outputs.
>>
>> What I did was to set ad_printf=0 in the admb source code (model33.cpp
>> ln 154) and recompiled the binaries. This shut it up, although there is
>> still a series of numbers being printed.
>>
>> Laurie
>>
>>
>>
>> On 16/09/14 22:59, Steve Martell wrote:
>>> Could we not add the noprintx=1, which is set with the command line option -nox, to the lprof routines?
>>> S
>>> On Sep 16, 2014, at 1:40 PM, CHRIS GRANDIN <cgrandin at shaw.ca> wrote:
>>>
>>>> I simply issue the command like this:
>>>>
>>>> modelname.exe 1> runoutput.log 2>&1
>>>>
>>>> which writes it all out to a file you can look at and search with a proper editor afterwards. It is much faster than having everything written to the terminal. The 1> writes the output to the file runoutput.log and the 2>&1 pipes any errors into the file so you see nothing on the console.
>>>>
>>>> Chris
>>>>
>>>> ----- Original Message -----
>>>> From: "Jim Ianelli - NOAA Federal" <jim.ianelli at noaa.gov>
>>>> To: "laurie" <lauriekell at gmail.com>
>>>> Cc: "ADMB" <users at admb-project.org>
>>>> Sent: Tuesday, September 16, 2014 11:32:04 AM
>>>> Subject: Re: [ADMB Users] -lprof -iprint
>>>>
>>>>
>>>>
>>>>
>>>> This has long been something I've noted and just never complained about it. Knowing I have the ability to fix it now...maybe I should do something about it.
>>>>
>>>>
>>>> Related I think it'd be useful to have something like a "LIKE_PROF_SECTION" where one could write stuff to a file at the mode along each point of the resulting grid. Or perhaps there's another way to do this that I'm unaware of.
>>>>
>>>>
>>>> Cheers,
>>>> Jim
>>>>
>>>>
>>>> On Mon, Sep 15, 2014 at 4:23 AM, laurie < lauriekell at gmail.com > wrote:
>>>>
>>>>
>>>> I would to perform profile likelihood calculations without all the screen output.
>>>>
>>>> However, the -iprint 0 command line option doesn't seem to work if you also use -lprof.
>>>>
>>>> Laurie
>>>>
>>>> ______________________________ _________________
>>>> Users mailing list
>>>> Users at admb-project.org
>>>> http://lists.admb-project.org/ mailman/listinfo/users
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>> James Ianelli
>>>> NMFS/NOAA Building 4
>>>> 7600 Sand Pt Way NE
>>>> Seattle WA 98115
>>>>
>>>>
>>>>
>>>> 206 526 6510
>>>>
>>>> Visit the ADMB project http://admb-project.org/
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at admb-project.org
>>>> http://lists.admb-project.org/mailman/listinfo/users
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at admb-project.org
>>>> http://lists.admb-project.org/mailman/listinfo/users
>>> ________________________________
>>>
>>> This internet e-mail message, and any files transmitted with it, contains confidential, privileged information that is intended only for the addressee. If you have received this e-mail message in error, please call us at (206) 634-1838 collect if necessary) and ask to speak to the message sender. Nothing in this e-mail or the act of transmitting it, is to be construed as a waiver of any rights or privileges enjoyed by the sender or the International Pacific Halibut Commission pursuant to the International Organizations Immunities Act, 22 U.S.C. Sec. 288 et seq.



More information about the Users mailing list