[Csdp] Using cblas and clapack with CSDP

Henri Kjellberg henrikjellberg at gmail.com
Mon Nov 8 15:25:51 EST 2010


I am getting what I believe is partial success. I have modified f2c.h to use
typedef int integer instead of long int integer. Moreover, I am now running
32 bit version of clapack, gsl_cblas, and csdp.

I have discovered strange behavior. Sometimes, I am able to get the test
cases to run. They appear to converge to the correct solution, although it
takes 2 more iterations than in the .correct files.

What is really strange is it only works sometimes and it appears to function
nondeterminsitically. If I do make g50.out it may give me error code 9
(NaN), but if I keep trying after a couple attempts to run it will produce
the output copied below.

So I guess I have a problem where I am going beyond the index somewhere...

C is crazy!

theta1.out

Iter:  0 Ap: 0.00e+00 Pobj:  1.4644661e+04 Ad: 0.00e+00 Dobj:
 0.0000000e+00
Iter:  1 Ap: 9.00e-01 Pobj:  6.0471739e+03 Ad: 1.00e+00 Dobj:
 1.0979973e+02
Iter:  2 Ap: 1.00e+00 Pobj:  1.8041162e+00 Ad: 1.00e+00 Dobj:
 1.0972604e+02
Iter:  3 Ap: 1.00e+00 Pobj:  3.6752211e+00 Ad: 1.00e+00 Dobj:
 5.7636177e+01
Iter:  4 Ap: 1.00e+00 Pobj:  1.1146139e+01 Ad: 1.00e+00 Dobj:
 3.8126614e+01
Iter:  5 Ap: 8.10e-01 Pobj:  1.8820581e+01 Ad: 7.29e-01 Dobj:
 2.5364841e+01
Iter:  6 Ap: 5.90e-01 Pobj:  2.1270050e+01 Ad: 8.10e-01 Dobj:
 2.3424024e+01
Iter:  7 Ap: 4.78e-01 Pobj:  2.2136513e+01 Ad: 9.00e-01 Dobj:
 2.3115843e+01
Iter:  8 Ap: 8.10e-01 Pobj:  2.2525678e+01 Ad: 1.00e+00 Dobj:
 2.3106625e+01
Iter:  9 Ap: 9.00e-01 Pobj:  2.2951291e+01 Ad: 9.00e-01 Dobj:
 2.3009379e+01
Iter: 10 Ap: 1.00e+00 Pobj:  2.2975207e+01 Ad: 1.00e+00 Dobj:
 2.3004247e+01
Iter: 11 Ap: 1.00e+00 Pobj:  2.2987551e+01 Ad: 1.00e+00 Dobj:
 2.3002068e+01
Iter: 12 Ap: 9.00e-01 Pobj:  2.2998755e+01 Ad: 9.00e-01 Dobj:
 2.3000200e+01
Iter: 13 Ap: 1.00e+00 Pobj:  2.2999875e+01 Ad: 1.00e+00 Dobj:
 2.3000013e+01
Iter: 14 Ap: 1.00e+00 Pobj:  2.2999988e+01 Ad: 1.00e+00 Dobj:
 2.3000001e+01
Iter: 15 Ap: 1.00e+00 Pobj:  2.2999999e+01 Ad: 1.00e+00 Dobj:
 2.3000000e+01
Iter: 16 Ap: 9.00e-01 Pobj:  2.3000000e+01 Ad: 9.00e-01 Dobj:
 2.3000000e+01
Success: SDP solved
Primal objective value: 2.3000000e+01
Dual objective value: 2.3000000e+01
Relative primal infeasibility: 1.11e-15
Relative dual infeasibility: 6.84e-10
Real Relative Gap: 2.99e-09
XZ Relative Gap: 3.09e-09
DIMACS error measures: 1.11e-15 0.00e+00 1.74e-08 0.00e+00 2.99e-09 3.09e-09
Elements time: 0.005074
Factor time: 0.004342
Other time: 0.364430
Total time: 0.373846


g50.out

Graph is of size 50 103
Iter:  0 Ap: 0.00e+00 Pobj:  1.0355339e+04 Ad: 0.00e+00 Dobj:
 0.0000000e+00
Iter:  1 Ap: 9.00e-01 Pobj:  4.2765894e+03 Ad: 1.00e+00 Dobj:
 1.0979566e+02
Iter:  2 Ap: 1.00e+00 Pobj:  1.8058147e+00 Ad: 1.00e+00 Dobj:
 1.0969146e+02
Iter:  3 Ap: 1.00e+00 Pobj:  3.6783997e+00 Ad: 1.00e+00 Dobj:
 5.7621219e+01
Iter:  4 Ap: 1.00e+00 Pobj:  1.1150971e+01 Ad: 1.00e+00 Dobj:
 3.8122377e+01
Iter:  5 Ap: 8.10e-01 Pobj:  1.8822542e+01 Ad: 7.29e-01 Dobj:
 2.5364631e+01
Iter:  6 Ap: 5.90e-01 Pobj:  2.1270563e+01 Ad: 8.10e-01 Dobj:
 2.3423587e+01
Iter:  7 Ap: 4.78e-01 Pobj:  2.2136879e+01 Ad: 9.00e-01 Dobj:
 2.3115985e+01
Iter:  8 Ap: 8.10e-01 Pobj:  2.2843391e+01 Ad: 9.00e-01 Dobj:
 2.3019796e+01
Iter:  9 Ap: 4.78e-01 Pobj:  2.2881745e+01 Ad: 1.00e+00 Dobj:
 2.3011779e+01
Iter: 10 Ap: 1.00e+00 Pobj:  2.2944728e+01 Ad: 1.00e+00 Dobj:
 2.3009742e+01
Iter: 11 Ap: 9.00e-01 Pobj:  2.2994466e+01 Ad: 9.00e-01 Dobj:
 2.3000961e+01
Iter: 12 Ap: 1.00e+00 Pobj:  2.2997206e+01 Ad: 1.00e+00 Dobj:
 2.3000450e+01
Iter: 13 Ap: 1.00e+00 Pobj:  2.2999721e+01 Ad: 1.00e+00 Dobj:
 2.3000039e+01
Iter: 14 Ap: 1.00e+00 Pobj:  2.2999972e+01 Ad: 1.00e+00 Dobj:
 2.3000000e+01
Iter: 15 Ap: 1.00e+00 Pobj:  2.2999997e+01 Ad: 1.00e+00 Dobj:
 2.3000000e+01
Iter: 16 Ap: 9.00e-01 Pobj:  2.3000000e+01 Ad: 9.00e-01 Dobj:
 2.3000000e+01
Success: SDP solved
Primal objective value: 2.3000000e+01
Dual objective value: 2.3000000e+01
Relative primal infeasibility: 7.22e-16
Relative dual infeasibility: 2.29e-09
Real Relative Gap: 6.57e-09
XZ Relative Gap: 6.92e-09
DIMACS error measures: 7.22e-16 0.00e+00 5.84e-08 0.00e+00 6.57e-09 6.92e-09
The Lovasz Theta Number is 2.3000000e+01




Kind regards,
Henri

On Mon, Nov 8, 2010 at 12:00 AM, Henri Kjellberg
<henrikjellberg at gmail.com>wrote:

> One source of the issue may be that I am on a 64 bit system currently. I
> wonder if that is causing the long int situation to be particularly
> gruesome.
>
> Best,
> Henri
>
>
> On Sun, Nov 7, 2010 at 11:59 PM, Henri Kjellberg <henrikjellberg at gmail.com
> > wrote:
>
>> I just tried to change the typdef long int integer to typedef int integer.
>> However, now I a get a segmentation fault when attempting to run the
>> ./example
>>
>> Changing it back returns me to the previous issue where upon freeing the
>> workvec5 it gets the glibc error.
>>
>> Does the Success: SDP Solved in the ./example program indicate something
>> is functioning?
>>
>>
>> On Sun, Nov 7, 2010 at 11:33 PM, Brian Borchers <borchers at nmt.edu> wrote:
>>
>>> On Sun, Nov 7, 2010 at 7:35 PM, Henri Kjellberg
>>> <henrikjellberg at gmail.com> wrote:
>>> > In order to get my clapack to function I had to do a bunch of this sort
>>> of
>>> > thing:
>>> > integer mIn = (integer)m;
>>> > integer ldamIn = (integer)ldam;
>>> >
>>> > dpotrf_("U",&mIn,O,&ldamIn,&infoOut);
>>> > info = (int)infoIn;
>>> > Where integer is a typdef for long int in f2c.h
>>> > Could that be causing the problem?
>>>
>>> Yes.  the integer parameters that CSDP is passing into the
>>> CLAPACK/CBLAS routines are all four byte integers (regular int, not
>>> long int)    When you pass &n to a subroutine that is expecting it's
>>> input to be a pointer to a long int, but the calling routine only has
>>> an int, then things will break.
>>>
>>> Your output from the csdp solver seems to indicate that something is
>>> horribly wrong- I'd guess it's the same issue.
>>>
>>> As I recall this can be worked around by changing the typedef of
>>> "integer" in f2c.h to be a regular int.
>>>
>>> --
>>> Brian Borchers                          borchers at nmt.edu
>>> Department of Mathematics      http://www.nmt.edu/~borchers/
>>> New Mexico Tech                       Phone: (575) 322-2592
>>> Socorro, NM 87801                   FAX: (575) 835-5366
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/csdp/attachments/20101108/de82f63a/attachment.html 


More information about the Csdp mailing list