[gecode-users] compiler memory problem

Christian Schulte cschulte at kth.se
Thu Nov 20 09:45:25 CET 2008


Hi Patrik,

Going by your example code, this should very definitely not pose any problem, Gecode itself uses way more elaborate constructions with patterns.

One reason for the problem could be the part you do not tell us: if you have code that uses a lot of inlining, then that could be a problem.


Otherwise, that particular version of gcc might be at fault. As I do not use gcc that much I don't know whether this version is a bad one.

Cheers
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Patrik Haslum
Sent: Thursday, November 20, 2008 9:26 AM
To: users at gecode.org
Subject: [gecode-users] compiler memory problem


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





More information about the gecode-users mailing list