Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The admb executable called with a path should be stripped. #165

Closed
johnoel opened this issue Jan 12, 2021 · 5 comments
Closed

The admb executable called with a path should be stripped. #165

johnoel opened this issue Jan 12, 2021 · 5 comments
Milestone

Comments

@johnoel
Copy link
Contributor

johnoel commented Jan 12, 2021

Currently, if the executable is called with the path, the inputs will be read from the executable path and the outputs would be written to the executable path.

For example,

~/run$ ~/bin/model.exe

model.exe would try to read input files from ~/bin, then write outputs to ~/bin instead of ~/run directory. The executable should read and write to the ~/run directory.

@jimianelli requested this feature.

johnoel added a commit that referenced this issue Jan 12, 2021
@johnoel johnoel added this to the ADMB-12.3 milestone Jan 12, 2021
johnoel added a commit that referenced this issue Jan 12, 2021
@johnoel johnoel changed the title If admb executable is called with a path, the input/output files should be in the calling directory. The admb executable should ignore the path so that input/output files are done in the calling directory. Jan 12, 2021
@johnoel johnoel changed the title The admb executable should ignore the path so that input/output files are done in the calling directory. The admb executable using a path should ignore it so that input and output files are done in the calling directory. Jan 12, 2021
@johnoel johnoel changed the title The admb executable using a path should ignore it so that input and output files are done in the calling directory. The admb executable called with a path that should be removed. Jan 12, 2021
@johnoel
Copy link
Contributor Author

johnoel commented Jan 12, 2021

Hi @jimianelli and @Cole-Monnahan-NOAA, please test the issue165 branch. It should be able to read and write to a directory that is different from where the executable is.

johnoel added a commit that referenced this issue Jan 12, 2021
@johnoel johnoel changed the title The admb executable called with a path that should be removed. The admb executable called with a path should be stripped. Jan 12, 2021
@Cole-Monnahan-NOAA
Copy link
Contributor

I built this branch, compiled simple then tried this:

C:\Users\cole.monnahan\admb\examples\admb>simple\simple.exe
Error trying to read in model data
This is usual caused by a missing DAT file

Is that what you wanted me to test?

@johnoel
Copy link
Contributor Author

johnoel commented Jan 12, 2021

Move simple.exe to another directory (ie C:\Users\cole.monnahan\bin\simple.exe).

Then call simple.exe with it's full path,

C:\Users\cole.monnahan\admb\examples\admb\simple> C:\Users\cole.monnahan\bin\simple.exe

Check that program was able to read input files and write the outputs in the simple directory.

@Cole-Monnahan-NOAA
Copy link
Contributor

Cole-Monnahan-NOAA commented Jan 13, 2021

Still fails. I should note this in Win10.

C:\Users\cole.monnahan\admb\examples\admb\simple>C:\Users\cole.monnahan\test\simple\simple.exe -version
ADMB Program: C:\Users\cole.monnahan\test\simple\simple.exe

ADMB-12.2-git safe libraries compiled with GNU C++ 8.3.0 (64bit)
Copyright (c) 2008-2020 ADMB Foundation and Regents of the University of California
Build date: Jan 12 2021

C:\Users\cole.monnahan\admb\examples\admb>C:\Users\cole.monnahan\test\simple\simple.exe
Error trying to read in model data
This is usual caused by a missing DAT file

C:\Users\cole.monnahan\admb\examples\admb>ls C:\Users\cole.monnahan\test\simple
simple.dat simple.exe simple.tpl

@Cole-Monnahan-NOAA
Copy link
Contributor

I misunderstood your original request. The idea is you have one master .exe file and multiple directories with e.g., different inputs and you want the inputs/outputs to always be in the directory. Yes this works:

C:\Users\cole.monnahan\admb\examples\admb\simple>C:\Users\cole.monnahan\test\simple\simple.exe

Initial statistics: 2 variables; iteration 0; function evaluation 0; phase 1
Function value 2.4980653e+01; maximum gradient component mag -3.6127e+00
Var Value Gradient |Var Value Gradient |Var Value Gradient
1 0.00000 -7.2781e-01 | 2 0.00000 -3.6127e+00 |

  • final statistics:
    2 variables; iteration 7; function evaluation 19
    Function value 3.4513e+00; maximum gradient component mag -7.0014e-05
    Exit code = 1; converg criter 1.0000e-04
    Var Value Gradient |Var Value Gradient |Var Value Gradient
    1 4.07818 -2.0898e-05 | 2 1.90909 -7.0014e-05 |
    Estimating row 1 out of 2 for hessian
    Estimating row 2 out of 2 for hessian

johnoel added a commit that referenced this issue Jan 24, 2021
Merge Issue #165: The admb executable called with a path should be stripped.
@johnoel johnoel closed this as completed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants