Skip to content

Return a different error for Line search failure #1309

Open
@jachymb

Description

@jachymb

When I run optimize, it sometimes exits with the error message

Optimization terminated with error: 
  Line search failed to achieve a sufficient decrease, no more progress can be made

returning the error code 1 to the OS.

However, this may happen after a good fit is found and written and actually indicates convergence and the failure is likely due to numerical weirdness near the optimum.

So I am not sure whether this should even be treated as an error. If yes, I would like to propose for cmdstan to return an error code different than 1 to the OS, so the shell calling it may decide to ignore it easily (where now parsing stderr would be required). Now, every error seems to simply return 1.

In fact, returning a different error code for each different possible problem would perhaps be nice, but this one particular case strikes me as actually not-always-a-problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions