Hi Ted:<br><br>Thank you very much for your quick response.<br>BTW, I just find out another problem<br>When I have match linked to libSym, I got a result as described in the manual<br>However, when I have match linked to libSymAppl, the system crashes, (Segmentation fault) <br>
So, I go on to debug the source code. <br>What I found out is there is a structure cut _data <br>which is sort of polymorphism data <br>where <br>char * coef; can be casted to any kind of data <br>and the interpretation (performed by void unpack_cuts_u in lp_wrapper.c) will depend on the field type)<br>
What I saw is that:<br>lines 1925-1927 <br> nzcnt = ((int *) (cuts[i]->coef))[0];<br> matval = (double *) (cuts[i]->coef + DSIZE);<br> matind = (int *) (cuts[i]->coef + (nzcnt + 1)*DSIZE);<br>So, I supposed with cut type is EXPLICIT_ROW then the data pointed out by coef should be <br>
(ISIZE buyes = 4 in my computer) int number_of_non_zero; <br>(4 bytes = unused - this ise the difference between DSIZE = 8 and ISIZE=4) <br>... unused (or something else) => the difference between DSIZE (= 8 bytes in ) <br>
(DSIZE*number of non zero) double non_zero_values<br>(ISIZE*number of non zero) double non_zero_indexes<br><br>However, when I examine the memory at address cuts[i]->coef, I saw <br>(4 bytes) integer number of non zero <br>
(3*4 bytes) integer non zero indexes <br>(3*8 bytes) double non_zero_values <br><br>$ gdb --args ./match -F sample.mat <br>...<br>(gdb) l lp_wrapper.c:1925<br>1920 case EXPLICIT_ROW:<br>1921 real_nzcnt = 0;<br>
1922 row_list[explicit_row_num] =<br>1923 (waiting_row *) malloc(sizeof(waiting_row));<br>1924 row_list[explicit_row_num]->cut = cuts[i];<br>1925 nzcnt = ((int *) (cuts[i]->coef))[0];<br>
1926 matval = (double *) (cuts[i]->coef + DSIZE);<br>1927 matind = (int *) (cuts[i]->coef + (nzcnt + 1)*DSIZE);<br>1928 row_matval = row_list[explicit_row_num]->matval = <br>1929 (double *) malloc(nzcnt * DSIZE);<br>
(gdb) b lp_wrapper.c:1925<br>Breakpoint 1 at 0x8093e96: file LP/lp_wrapper.c, line 1925.<br>gdb) run<br>Starting program: /home/an/SYMPHONY-5.3.3/SYMPHONY/Applications/MATCH/match -F sample.mat<br><br>== Welcome to the SYMPHONY MILP Solver <br>
== Copyright 2000-2010 Ted Ralphs and others <br>== All Rights Reserved. <br>== Distributed under the Common Public License 1.0 <br>== Version: 5.3.3 <br>== Build Date: May 29 2011 <br><br>Solving...<br><br>solving root lp relaxation<br>
The LP value is: 3.000 [0,6]<br><br><br>Breakpoint 1, unpack_cuts_u (p=0x83bd898, from=0, type=0, cut_num=2, <br> cuts=0x83db350, new_row_num=0xbfffef50, new_rows=0xbfffef34)<br> at LP/lp_wrapper.c:1925<br>1925 nzcnt = ((int *) (cuts[i]->coef))[0];<br>
<br>(gdb) x/40xb cuts[i]->coef<br>0x83c2988: 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00<br>0x83c2990: 0x05 0x00 0x00 0x00 0x01 0x00 0x00 0x00<br>0x83c2998: 0x00 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f<br>
0x83c29a0: 0x00 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f<br>0x83c29a8: 0x00 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f<br><br><br>Obviously, the program crashes just after it picks up these data <br>
<br>I couln't find any document describing each type of cut_data, so I could n't really fix it. <br>However, in the file cg_func.c, I saw the two functions<br>create_explicit_cut & cg_add_explicit_cut <br>with the following code<br>
<br> ((int *) cut->coef)[0] = nzcnt;<br> memcpy(cut->coef + ISIZE, (char *)indices, nzcnt*ISIZE);<br> memcpy(cut->coef + (nzcnt + 1) * ISIZE, (char *)values, nzcnt * DSIZE);<br><br>Therefore, I assume that these lines should be changed to <br>
in function unpack_cuts_u<br> nzcnt = ((int *) (cuts[i]->coef))[0];<br> //matval = (double *) (cuts[i]->coef + DSIZE);<br> //matind = (int *) (cuts[i]->coef + (nzcnt + 1)*DSIZE);<br> // try to see what happens here <br>
// this is OK with create_explicit_cut & cg_add_explicit_cut <br> matind = (int *) (cuts[i]->coef + ISIZE);<br> matval = (double *) (cuts[i]->coef + (nzcnt+1)*ISIZE);<br> // end <br><br><br>and try again, but the program crashes again, at another places (still something to do with cuts) <br>
<br>As I really in need of this software, if you don't mind to share a little bit of the design, I would like to contribute to fix some of the bugs<br><br>Thanks<br>An <br><br><br><br><br><br><br><br> <br><br><div class="gmail_quote">
On Sun, May 29, 2011 at 10:55 AM, Ted Ralphs <span dir="ltr"><<a href="mailto:ted@lehigh.edu">ted@lehigh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thanks for the report and my apologies for the trouble. I had actually<br>
already discovered this issue and fixed it in trunk. I'll port it the<br>
fix to stable create a new release as soon as I can.<br>
<br>
Cheers,<br>
<br>
Ted<br>
<div><div></div><div class="h5"><br>
On Sat, May 28, 2011 at 7:52 PM, an ngo <<a href="mailto:ngothean1@gmail.com">ngothean1@gmail.com</a>> wrote:<br>
> Hi all:<br>
> Sorry, I don't know how to continue the same thread, so I send another email<br>
> to clarify the question I sent yesterday.<br>
> My problem is that while configure my installation by<br>
> ./configure --with-application<br>
> when I make the application MATCH the results look like USE_SYM_APPLICATION<br>
> is not defined as no call backs functions are called.<br>
> However, I did verify that the flag was set properly. Finally, this error is<br>
> caused by:<br>
> In the file<br>
> SYMPHONY-5.3.3/SYMPHONY/Applications/Makefile.Applications<br>
> as COIN_HAS_PKGCONFIG = true<br>
> match will be linked the library determined by<br>
> LIBS += `PKG_CONFIG_PATH=/home/thuy/SYMPHONY-5.3.3/lib/pkgconfig:<br>
> /usr/bin/pkg-config --libs symphony`<br>
> However, the package config file symphony.pc will lead to libSym instead of<br>
> libSymAppl<br>
><br>
> As a quick fix, I duplicate the file symphony.pc to symphonyappl.pc and<br>
> change libSym to libSymAppl in the new config.<br>
> Then in Makefile.Applications, the config file will be symphonyappl instead<br>
> of symphony<br>
><br>
> The issue with USE_GLPMPL is not fixed yet.<br>
> Thanks<br>
> A.<br>
><br>
</div></div>> _______________________________________________<br>
> Symphony mailing list<br>
> <a href="mailto:Symphony@list.coin-or.org">Symphony@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/symphony" target="_blank">http://list.coin-or.org/mailman/listinfo/symphony</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Dr. Ted Ralphs<br>
Associate Professor, Lehigh University<br>
<a href="tel:%28610%29%20628-1280" value="+16106281280">(610) 628-1280</a><br>
ted 'at' lehigh 'dot' edu<br>
<a href="http://coral.ie.lehigh.edu/%7Eted" target="_blank">coral.ie.lehigh.edu/~ted</a><br>
</font></blockquote></div><br>