[Os-project-managers] stdout capture and OSrL

Hotmail (majxuh) majxuh at hotmail.com
Fri Jun 1 19:27:17 EDT 2012


I have updated org.optimizationservices.oscommon.util.StandardOSSolver.java 
to adapt to the need.
Kipp, I tried it locally on the windows and did some test. Looks fine to me.
You should do an update of the java code, and do a build.
Or better, I have attached the built class. You can just replace the 
existing one in your server and restart.
Let me know if it works ok, as it may behave differently on linux or mac.

It turned out the calling of an executable (OSSolverService.exe) is not 
quite simple.
In the code there are two ways to call, one using the simple command line 
launch, which actually is turned off.
The other is using quite complex methods to launch a process object, and the 
Java code actually controls the process input/output steam and read the 
process output through an InputStreamReader.
The reason the complex way is adopted is that, the jave code will have to 
keep connected to the process, so that it can later kill it if needed. (Kill 
service).
If launched as a separate process, the Java code can no longer properly 
retrieve the process and kill it.

Hope it works fine.
Jun

--------------------------------------------------
From: "Horand Gassmann" <Horand.Gassmann at Dal.Ca>
Sent: Wednesday, May 30, 2012 4:38 PM
To: "R. Kipp Martin" <kmartin at chicagobooth.edu>
Cc: "Jun Ma" <majxuh at hotmail.com>; <Os-project-managers at list.coin-or.org>
Subject: Re: stdout capture and OSrL

> "R. Kipp Martin" <kmartin at chicagobooth.edu> wrote:
>
>> Hi Gus:
>>
>>
>>>
>>> just did a quick mock-up of what we were talking about regarding the
>>> capture of stdout. I attach two files, a simple OSoL file and a
>>> hypothetical OSrL file spliced together from the real OSrL file and the
>>> captured screen output.
>>>
>>> The commandline I used was
>>>
>>> ./OSSolverService osil parincLinear.osil osrl temp.osrl >temp.txt
>>>
>>> Does this approach jibe with your recollection?
>>
>> Yes, exactly!
>
> As usual, I am not overly hung up on the names of the <other> elements  in 
> the OSoL and OSrL files. If you have better suggestions, let's hear  them.
>
> Cheers
>
> gus
>
> -------------------------------------------------------
>
> Horand I. Gassmann, Professor
>
> School of Business Administration, Dalhousie University
> 6100 University Avenue, PO Box 15000
> Halifax, Nova Scotia, Canada, B3H 4R2
> ph. (902) 494-1844
> fax (902) 494-1107
>
> http://myweb.dal.ca/gassmann/
>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StandardOSSolver.class
Type: application/octet-stream
Size: 9400 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/os-project-managers/attachments/20120601/e8c497bf/attachment.class>


More information about the Os-project-managers mailing list