[Symphony] [ MATLAB interface to SYMPHONY 5.1.8 ]

carlosm.upm at gmail.com carlosm.upm at gmail.com
Fri Sep 19 07:32:18 EDT 2008


Hello Mr. Ralphs,

I have made some progress with regards to SYMPHONY and its integration
with MATLAB through its MEX-files mechanisms.

To summarize, we needed to solve a not-so-small MILP problem from
and due to the MATLAB Optimization Toolbox being pretty useless we
decided to use other optimization engines.

Although OS Matlab interface indeed existed and I was pointed to it by
Mr Kipp Martin this feature was quite abandoned and I could not make
many a progress while no diving inside OS source.

So in short I wrote an interface MEX file (which is plain C/C++ with a
special interface for MATLAB to hook) to pass MILP problems from
MATLAB to SYMPHONY. Although there is not a substantial benefit to
be gained from using MATLAB instead of the C interface our private
funded project required it to be done in that fashion.


The features are the following:

- Tested to take advantage of SYMPHONY's parallel shared memory mode
when compiled with an OpenMP compiler.
- The number of tasks can be set via the call parameters.
- Tested to compile and work in MATLAB 2008a Windows and MATLAB 2007a
GNU/Linux (Ubuntu) -I cannot describe the details of how to do it here, would
take too long. I would mention the compilers though: custom-build GCC-4.3
with gOpenMP and Visual Studio v9.0 (2008 release), with many kinks to iron
out in the latter.

If my work could be of any use for anyone please let me know
and I will happily send the source code, and you can feel ree to
modify it as well, of course.

Since I am not a software engineer you cannot expect too much
style or efficiency in the source code, but well, it could prove helpful
so that one doesn't start from scratch :) By the way, the example
structure was inspired by the brilliant example by Menal Guzelsoy
in SYMPHONY/Examples/milp2.c

And just if you were curious, we are using SYMPHONY to solve a
~10k variables MILP transportation problem.

Many thanks for your help,

Best regards,

  Carlos Martinez



On 18/09/2008, Ted Ralphs <ted at lehigh.edu> wrote:
> Hi Carlos,
>
> I'm sorry for the long delay in responding.[...]
> I should let you know that there is already a way to use
> SYMPHONY through Matlab, though it is perhaps a bit round-about, and
> that is through the OS project. I don't really know the details, but the
> OS project offers some kind of hook for calling any solver with an Osi
> interface from Matlab. You might check out that possibility before you
> proceed any further. I'm sorry if this information is not very timely.
> If you can let me know whether you've been able to solve the other issue
> noted below, that would be great.
>
> Cheers,
>
> Ted
>
> Carlos Martínez wrote:
>> Hello Mr. Ralphs,
>>
>> Thank a lot you for your suggestion: you were totally right.
>>
>> By the way, I would like to briefly comment on what I am
>> trying to do with SYMPHONY in case you found that it would
>> be of your interest (even though I am working for a private
>> industrial organization I would be able to release my works
>> under FOSS licenses).
>>
>> I am integrating SYMPHONY as a MIP solver for one of our
>> projects into Matlab and for that purpose I have created a
>> currently not-so-small mex file. Although it is relatively simple
>> there are some tricks to do here and there.
>>
>> I have already got it working pretty well but there is one
>> point that I have not been able to progress with: for the
>> moment I have not succeeded at parallelizing SYMPHONY
>> when being called from my mex file.
>>
>> I am working on that and eventually I will manage to do it but
>> I wanted to comment on this since I do not know if my works
>> are too situational for the COIN-OR and the SYMPHONY
>> community to find it of any use.
>>
>> Best regards,
>>
>>     Carlos Martinez
>>
>>
>> On 22/08/2008, Ted Ralphs <ted at lehigh.edu> wrote:
>>> Hi Carlos,
>>>
>>> I just tried building with
>>>
>>> ../configure --enable-openmp --with-application
>>>
>>> with gcc 4.2.3 and it worked fine. I think the reason you are having
>>> trouble is because of the addition of --with-lp=yes, which should not be
>>> needed and may in fact mess things up. Can you try without that option
>>> and see if it works?
>>>
>>> Cheers,
>>>
>>> Ted
>>>
>>> Carlos Martínez wrote:
>>>> Hello,
>>>>
>>>> I am trying to build SYMPHONY with OpenMP support for using it
>>>> in a shared memory 16-cores server but it seems like I am running
>>>> into problems at some point.
>>>>
>>>>
>>>> I compiled SYMPHONY using gcc 4.2.3 and I am using your nice and very
>>>> clear C API. This is the configure command I used after reading the
>>>> user guide, SYMPHONY/Applications/USER/INSTALL and some other READMEs.
>>>>
>>>> configure --prefix=/opt/SYMPHONY --enable-openmp --enable-static
>>>> --with-application --enable-debug --with-lp=yes
>>>>
>>>> Running
>>>>
>>>>        symphony -p 2 -F sample.mat
>>>>
>>>> will output the following warning:
>>>>
>>>>       "Trying to use multiple processors with sequential build..."
>>>>
>>>>
>>>> For the problem I am solving my laptop will just use one of its two
>>>> cores
>>>> as well, so I think there is something amiss somewhere. I am sorry I am
>>>> totally new to SYMPHONY and thus I am a bit lost still.
>>>>
>>>> Particularly I found in 5.5 that there are three configurations:
>>>>
>>>> - Sequential
>>>> - Parallel distributed
>>>> - Parallel shared
>>>>
>>>> but I could only find information on how to build my applications
>>>> with the first two configurations. From the user guild I thought that
>>>> using "--with-openmp" would suffice.
>>>>
>>>> Any help will be much appreciated,
>>>>
>>>>   Carlos
>>>>
>>>>
>>>> Carlos Martinez Belinchon
>>>> carlos.martinez at ieee.org
>>>> _______________________________________________
>>>> Symphony mailing list
>>>> Symphony at list.coin-or.org
>>>> http://list.coin-or.org/mailman/listinfo/symphony
>>>
>>> --
>>> Dr. Ted Ralphs
>>> Associate Professor
>>> Industrial and Systems Engineering
>>> Lehigh University
>>> (610)758-4784
>>> ted 'at' lehigh 'dot' edu
>>> coral.ie.lehigh.edu/~ted
>>>
>>
>>
>
>
> --
> Dr. Ted Ralphs
> Associate Professor, Lehigh University (permanent)
> Fellow, Institute for Advanced Studies, Universita di Bologna (current)
> (610)628-1280
> ted 'at' lehigh 'dot' edu
> coral.ie.lehigh.edu/~ted
>


-- 
Carlos Martinez Belinchon
carlos.martinez at ieee.org




More information about the Symphony mailing list