admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

ADMB 13 model name in console output is always as it was compiled #259

Closed k-doering-NOAA closed 2 years ago

k-doering-NOAA commented 2 years ago

For the admb 13 branch, I noticed that even if I rename the .exe file produced after compiling a model, the console output still reports the name it was compiled under.

For example, if I compile a model ss.tpl with admb 13 to get ss.exe, then rename ss.exe to ss_admb_13.exe and run the model, then the last line of the console output is still:

Finished running model 'ss' after 2 m 50 s.

What I would prefer to see is:

Finished running model 'ss_admb_13' after 2 m 50 s.

Just wondering if there is a way to get this output.

johnoel commented 2 years ago

I just tested this and it prints the right changed executable name. Can you recheck?

k-doering-NOAA commented 2 years ago

I just tested again using the compiled version of admb from https://github.com/admb-project/admb/actions/runs/2420289483 and still see the same original issue.

johnoel commented 2 years ago

Hi @k-doering-NOAA , can you check again with admb-13.0 branch?

k-doering-NOAA commented 2 years ago

Thanks @johnoel , I tested with the compiled version of admb from https://github.com/admb-project/admb/actions/runs/2630900334 and found that the name does get changed: Finished running model 'ss_test' after 2 s.

However, there is a output line that still uses whatever the original name of the exe was when it was compiled: Starting optimization of 'ss' in phase 1 of 1 at Fri Jul 08 09:31:09 2022

Thanks for all the changes! I really appreciate it.

Cole-Monnahan-NOAA commented 2 years ago

This is a function I helped write. It's called in a few places, namely the parts of code I modified. Source is: https://github.com/admb-project/admb/blob/admb-13.0/src/nh99/hmc_functions.cpp#L63

I wrote it for HMC stuff but then used it for the console changes for optimization too. Maybe easiest to fix the function?

johnoel commented 2 years ago

Hi @k-doering-NOAA, can you recheck it?

k-doering-NOAA commented 2 years ago

Thanks @johnoel, I can take a look later today