New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Parma Polyhedra Library a standard library #10039
Comments
comment:1
Rather than retire cddlib, it would be better I think to have cddlib as an optional backend, along with lrs. If ppl is consistently better than those then it could be the default. |
comment:2
If there will be a Cython interface to PPL, it definitely should become the default backend as it must be drastically faster on simple cases then the current situation. And for "complicated" cases users should be willing to spend some time to learn about advantages of different systems and pick the right one, if speed becomes an issue. |
comment:3
This package installed fine on Kubuntu 10.04 and OS X 10.6. It does take a while to compile - 10 minutes on the first machine and 15 on the other. |
comment:4
Yes, templated C++ code is really giving the compiler something to do. But if you think thats slow then don't run the testsuite (SAGE_CHECK=yes)... |
comment:5
One reason I gave up any hope of making polymake standard was the compilation time; it was one reason I began writing polyhedra.py instead of improving the polymake interface. Are there many things in PPL that go beyond cddlib? I am having trouble wading through their documentation so its unclear to me. |
This comment has been minimized.
This comment has been minimized.
comment:7
I read the module documentation and it looks quite nice, although the PPL interface and their documentation do not seem to be very clear to an unfamiliar user (as Marshall has already noted above). So if eventually Sage front-end is structured more like current geometric classes, it would be better - I guess that's exactly your plan in 4. Can PPL compute integral points inside a bounded polytope? |
comment:8
Just to be clear, the PPL wrapper is not going to be exposed to the end user by default. She/he is supposed to use the higher-level The PPL sports grids (lattices defined through generators or congruences) and a MIP solver but, as far as I know, no function that directly enumerates grid points (i.e. the intersection of a grid with a polyhedron). Though it probably would not be too difficult to write one with these building blocks. In any case, I haven't cython-wrapped grids or MIPs so far. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:11
This does build successfully on Cygwin, but it does take
|
comment:12
I take it you are not running the test suite? That one is quite extensive... The 22 minutes in user space could be realistic for a slow machine. The 26min is sys is a bit suspicious, are you running on swap? But the real question is, why did your computer spend 6h walltime for 40 minutes of work? I just tried the ppl spkg in an opensolaris virtual machine (single core) and it takes about 7 minutes walltime, 5m user, 1m sys. |
comment:13
I've removed all language interfaces (except the native C++), this shaves off a few minutes. Now on my Fedora 13 box normal compilation takes 1 minute and the testsuite 20 minutes:
Testing:
|
comment:14
Replying to @mwhansen:
That sure is a long time. I think it's because autoconf scripts takes ages on Cygwin, because Windows has no fork. On my Sun Ultra 27, it takes less than 82 seconds to install.
However, it fails the test suite. To be more precise, the tests it runs pass, but it fails to build some of the code needed for the tests. I'm not sure what the gcc option BTW, this should be called ppl-0.11 and not ppl-0.11.p0. Only once a version has appeared in Sage, and patches have been applied, should it be called .p0. A couple more points.
That needs to be in both spkg-install and spkg-check.
|
Log showing how some of the test code failed to build when SPKG_CHECK=yes. Without that, it builds OK in < 82 seconds. This is on a Sun Ultra 27 running OpenSolaris 06/2009 |
This comment has been minimized.
This comment has been minimized.
comment:15
Attachment: ppl-0.11.p0.log The testsuite fails on Solaris gcc 4.5.0, most likely due to a gcc bug. For reference, the real error is
Everything should work fine with gcc 4.5.1. In particular, I could compile and run the testsuite on OpenSolaris/i386 with gcc 4.5.1. Also note that the offending floating point code is currently not used in the Cython wrapper. A similar bug report is here: https://www.cs.unipr.it/mantis/view.php?id=110 About the
I have addressed the other issues that you raised. The updated spgk is here: |
comment:16
Sorry, I was too quick. The testsuite does not like "MAKE=make -j8", there is a missing shell escape. So I'll leave it at "make check" in the I'm also getting the testsuite "no matching function call" from Opensolaris/gcc 4.5.1. |
comment:17
I have patched out the PPL testsuite for Box<>, BD_Shape<>, and Octagonal_Shape<>. I think these templated classes are newer and not as well-tested. Note that the polyhedron code does not use templates. In any case, they are not currently exposed by the Cython wrapper and they don't provide any functionality that we need in the near future. The updated spgk now compiles a) in parallel and b) under Solaris/gcc 4.5.1 without errors, including the testsuite. As usual, get it here: http://www.stp.dias.ie/~vbraun/Sage/spkg/ppl-0.11.spkg |
comment:18
Some notes based on the posted documentation:
|
comment:19
I fixed the documentation according to your suggestions.
The internal representation of dimensions is an unsigned int. So PPL returns 0 instead of something negative. Using signed integer would half the
Yes. I just copy/pasted the C++ documentation. I've added a line that this is the Cartesian product.
All that is guaranteed is that the result is non-strictly contained in the original polyhedron and that integral vertices survive. Its not the most useful function, but it is there and was easy to wrap ;-)
I removed this one, it is only useful for grids (spanned lattices / congruences).
Removed.
Yes, should be enough for most applications ;)
I didn't define these, they were imported from |
comment:20
I have tried building with the new spkg and sagelib patch, but I get the following error:
|
Changed merged from sage-4.7.alpha3 to none |
comment:78
On RHEL 5.3-64 (cleo), SUSE ES10-64 (iras), OpenSolaris 06.2009-32 (hawk), SunOS 5.10-32 (t2):
|
comment:79
On SunOS 5.10-32 (t2), OpenSolaris 06.2009-32 (hawk):
|
comment:80
See #11100 for the timeout problem. |
This comment has been minimized.
This comment has been minimized.
comment:81
I finally got the problem with the maximize/minimize doctest failure. If the linear function is not bounded on the polyhedron then it doesn't make sense to ask for whether its a maximum or minimum. And PPL then does not return a consistent value for the corresponding field. In the attached patch I changed return value of the maximize/minimize methods to only return The new patch |
comment:82
That's good news and that wasn't just me then! I have my hands full at the moment so I won't be able to review it quickly but I am sure you have another reviewer around :) |
Changed reviewer from Marshall Hampton to Marshall Hampton, Jeroen Demeyer |
comment:83
New patch looks good to me. Still needs to be tested on the buildbots, but positive review in the hope that everything works fine. |
comment:84
Volker, you just need to put a proper commit message on your patch... |
Attachment: trac_10039_ppl_fix_extremize.2.patch.gz Updated patch |
Attachment: trac_10039_ppl_fix_extremize.patch.gz Updated patch |
comment:85
Oops, sorry. New |
Merged: sage-4.7.alpha4 |
This comment has been minimized.
This comment has been minimized.
comment:87
|
The Parma Polyhedra Library (ppl) is for many workloads the fastest library for polyhedral computations. It is also high-quality code, for example GCC uses it (optionally) to optimize loops.
_and_
passes its own testsuite (in contrast to some other polydedral library that shall remain unnamed)Official webpage: http://www.cs.unipr.it/ppl/
My plan is to
sage.geometry.cone.Cone
on PPL instead ofPolyhedron/cddlib
sage.geometry.polyhedra.Polyhedron
into an abstract base class and derived classes that use different polyhedral computation libraries.Current status:
ValueError
.For convenience I mirrored the reference manual page here: http://www.stp.dias.ie/~vbraun/Sage/html/en/reference/sage/libs/ppl.html
To apply this ticket:
$SAGE_ROOT/spkg/standard
$SAGE_LOCAL/bin
repositoryCC: @novoselt @jdemeyer @kiwifb
Component: geometry
Keywords: ppl spkg
Author: Volker Braun
Reviewer: Marshall Hampton, Jeroen Demeyer
Merged: sage-4.7.alpha4
Issue created by migration from https://trac.sagemath.org/ticket/10039
The text was updated successfully, but these errors were encountered: