[SCIP] SCIP 8 can read AMPL NL-file but how to write AMPL SOL-file ?

Vladimir V. Voloshinov vladimir.voloshinov at gmail.com
Mon Mar 14 11:09:37 CET 2022


Dear Stefan,
besides "single-threaded" SCIP/SCIPAMPL we use ParaSCIP and/or FiberSCIP.

In the previous versions parallel solvers did not read AMPL NL-files.
So we used interactive shell of SCIPAMPL for conversion (see
http://listserv.zib.de/pipermail/scip/2020-February/003876.html):
1. NL-files to CIP-files (to pass them to Para/FiberSCIP);
2. CIP SOL-files (from parallel solvers) to AMPL SOL-files (to read them by
Pyomo)
    BTW, since SCIP v7, the last conversion doesn't need patch, which was
required for SCIP v6.

Can you, please, tell me if Para/FiberSCIP v8 support AMPL NL/SOL formats?

If not, I see two ways:
1) to use SCIPAMPL v7 as format converter;
2) to patch SCIP as you wrote in the previous email.
BUT, besides activating interactive shell option for "AMPL mode" we'll need
to add "write/amplsol" command to the shell.

Am I right?

Vladimir.

On Mon, Mar 14, 2022 at 11:42 AM Stefan Vigerske <svigerske at gams.com> wrote:

> Hi,
>
> On 3/13/22 23:41, Vladimir V. Voloshinov wrote:
> > Sorry,
> > when I read the Section 7.1 of "The SCIP Optimization Suite 8.0" again I
> > understood that I did not follow your instructions.
> > I erroneously have run SCIP by interactive shell:
> > "SCIP> read problem.nl optimize write/solution"...
> >
> > The command
> > $ scip problem.nl -AMPL
> > gave the AMPL SOL-file as I expected.
> >
> > And still the question remains: is it possible to get AMPL SOL via SCIP
> > interactive shell?
> > I see the function SCIPwriteSolutionNl() in SCIP API (
> > https://scipopt.org/doc/html/reader__nl_8h.php)...
>
> No.
>
> There is no shell command that would trigger SCIPwriteSolutionNl(). I
> also think it isn't a good idea to have this in general, as we can write
> AMPL .sol files only when the problem has been read from an AMPL .nl
> file. If the problem was read from somewhere else, bad things could
> happen when attempting to write an AMPL .sol file.
>
> I don't know (or better, I forgot) what you need the interactive shell
> for when running from Pyomo.
> With this change, you will get a shell when running scip problem -AMPL:
> --- a/src/scip/scipshell.c
> +++ b/src/scip/scipshell.c
> @@ -192,7 +192,7 @@ SCIP_RETCODE fromAmpl(
>      SCIPinfoMessage(scip, NULL, "\nsolve problem\n");
>      SCIPinfoMessage(scip, NULL, "=============\n\n");
>
> -   SCIP_CALL( SCIPsolve(scip) );
> +   SCIP_CALL( SCIPstartInteraction(scip) );
>
>      SCIP_CALL( SCIPgetBoolParam(scip, "display/statistics", &printstat) );
>      if( printstat )
>
>
> The shell would be called after the .nl file has been read. After the
> shell is closed, SCIPwriteSolutionNl() is called. If you used the shell
> to read a problem from a different file format in the meanwhile, things
> may crash.
> But I think we can bring back the -i option to switch between
> SCIPsolve() and SCIPstartInteraction() at this point.
>
> Stefan
>
> >
> > Yours, Vladimir.
> >
> > On Sun, Mar 13, 2022 at 10:36 PM Vladimir V. Voloshinov <
> > vladimir.voloshinov at gmail.com> wrote:
> >
> >> Hi,
> >> I tried SCIP-application (v8) with some AMPL NL-file as input problem
> >> data. It was accepted, the problem has been solved.
> >> But the command "write/solution" wrote the solution in CIP-format !
> >> Is it possible to get the solution in AMPL SOL-format ? (We use Python
> >> Pyomo package to write NL-files and read solutions in AMPL SOL-formats)
> >> I can not find the "write/amplsol" command in SCIP v8 (as it was in
> >> SCIPAMPL application in previous versions)...
> >>
> >> Sincerely yours,
> >> Vladimir
> >>
> >
> >
> > _______________________________________________
> > Scip mailing list
> > Scip at zib.de
> > https://listserv.zib.de/mailman/listinfo/scip
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20220314/89370ff8/attachment.html>


More information about the Scip mailing list