[gecode-users] compiler memory problem

Patrik Haslum patrik.haslum at anu.edu.au
Thu Nov 20 09:26:15 CET 2008


Hi,

I've written a custom propagator. It is based on one of the existing 
templates, Gecode:BinaryPropagator, with an array of boolean views as 
the template argument. It works, but the compiler (g++ 4.1.2) is having 
serious trouble with the code: if I try to use any compiler optimisation 
(that is, anything other than -O0), the compiler eats up all memory 
(including swap) and never finishes. I know that using many and/or 
nested templates tends to increase compiler memory use, but this case is 
worse than anything I've encountered before. Is this a known problem? 
(perhaps fixed in some more recent g++ compiler). Is there some way to 
work around it? (other than disabling compiler optimisation, because 
that *really* slows down the solver). The only other option I can think 
of is to write the propagator from scratch, without relying on any base 
template.

Attached is a simplified version of the code (it doesn't contain any 
actual functionality, just the minimum that is needed to cause the 
compiler to behave this way).

Thanks,
			/P at trik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proptest.cc
Type: text/x-c++src
Size: 2224 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081120/e141d3e0/attachment.cc>


More information about the gecode-users mailing list