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

Using tech:optionfile in mosek_options #231

Open
4er4er4er opened this issue Jan 17, 2024 · 6 comments
Open

Using tech:optionfile in mosek_options #231

4er4er4er opened this issue Jan 17, 2024 · 6 comments
Assignees
Labels

Comments

@4er4er4er
Copy link
Contributor

A user would like to specify the value of the MSK_DPAR_INTPNT_TOL_PFEAS parameter for MOSEK. I thought that should be possible using this option:

tech:optionfile (optionfile, option:file)
Name of solver option file to read (surrounded by 'single' or "double"
quotes if the name contains blanks). Lines that start with # are
ignored. Otherwise, each nonempty line should contain "name=value".

I created a file mosekopt.txt containing this line,

MSK_DPAR_INTPNT_TOL_PFEAS=1e-6

and I gave this command to AMPL before solving:

option mosek_options 'optionfile=mosekopt.txt';

It appears that MOSEK found the file, but rejected the contents:

MOSEK 10.0.43: Unknown option or invalid key "MSK_DPAR_INTPNT_TOL_PFEAS"

Can MSK_DPAR_INTPNT_TOL_PFEAS be specified using this option? And if so, how should it be written?

@glebbelov
Copy link
Contributor

tech:optionfile means file with driver options (outlev etc.)

What you mean are the solver native options: https://mp.ampl.com/features-guide.html#native-solver-options. This is not implemented for Mosek, I can add this, and hope we can release today or tomorrow.

Any suggestions on clearer option names and help text to distinguish driver options vs native options?

glebbelov added a commit that referenced this issue Jan 18, 2024
These were renamed from tech:param[:read/:write]

Doc: AMPL vs native solver options
@glebbelov
Copy link
Contributor

Currently native parameters can be controlled via exporting the model as LP/MPS/JTASK etc. and solving by Mosek command-line tool.

Implemented and documented the following options for Mosek (and for Gurobi, which had them already, names were changed accordingly):

tech:optionfile (optionfile, option:file)
      Name of an AMPL solver option file to read (surrounded by 'single' or
      "double" quotes if the name contains blanks). Lines that start with #
      are ignored. Otherwise, each nonempty line should contain "name=value",
      e.g., "lim:iter=500".

tech:optionnative (optionnative, optnative, tech:param)
      General way to specify values of both documented and undocumented Mosek
      parameters; value should be a quoted string (delimited by ' or ")
      containing a parameter name, a space, and the value to be assigned to
      the parameter. Can appear more than once. Cannot be used to query
      current parameter values.

tech:optionnativeread (optionnativeread, tech:param:read, param:read)
      Name of Mosek parameter file (surrounded by 'single' or "double" quotes
      if the name contains blanks) to be read.

tech:optionnativewrite (optionnativewrite, tech:param:write, param:write)
      Name of Mosek parameter file (surrounded by 'single' or "double" quotes
      if the name contains blanks) to be written.

Among other solvers, only SCIP and GCG have tech:optionnativeread (tech:param:read).

@4er4er4er
Copy link
Contributor Author

Thanks! Using tech:optionnativeread with MOSEK, what format is recognized for lines in the file that is read? I have tried

MSK_IPAR_LOG=1
MSK_DPAR_MIO_MAX_TIME=3

and

MSK_IPAR_LOG 1
MSK_DPAR_MIO_MAX_TIME 3

but I get a No parameters found warning and the options don't appear to take effect. (I do not get a Could not open the parameter file warning, so I think the file is being found.)

@glebbelov
Copy link
Contributor

easiest is to say optionnativewrite=opt_default.prom and modify that.

Moses docs has no file format description. Basically it adds some header and footer.

@4er4er4er
Copy link
Contributor Author

OK, now I see it. I can specify, say,

option mosek_options 'tech:optionnativeread=mosekopt.txt';

and then in the file mosekopt.txt I can put

BEGIN MOSEK
MSK_IPAR_LOG 1
MSK_DPAR_MIO_MAX_TIME 3
END MOSEK

The MOSEK docs could describe this format, with a reference to one of the MOSEK parameter listing pages, maybe https://docs.mosek.com/latest/cmdtools/param-groups.html.

@glebbelov
Copy link
Contributor

Changed option text as follows (to appear in the next release):

tech:optionnativeread (optionnativeread, tech:param:read, param:read)
      Name of Mosek parameter file (surrounded by 'single' or "double" quotes
      if the name contains blanks) to be read. File format:

      BEGIN MOSEK
      MSK_DPAR_MIO_MAX_TIME 3
      END MOSEK

      Parameter descriptions:
      docs.mosek.com/latest/cmdtools/param-groups.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants