Closed seblabbe closed 4 years ago
There are also a lot of doctest examples in src/sage/geometry/polyhedron/base.py that could be split into separate chunks with ::
rather than grouped together, sharing a context. That may help encourage garbage collection of the objects defined in earlier examples.
Replying to @seblabbe:
I just checked the most recent branch and
sage -t --long --memlimit=3500 src/sage/geometry/polyhedron/base.py
now works ok on my machine. But unfortunately,
--memlimit=3400
does not (error is raised at thequadrangle
line again). But, I guess my computer is an exception?I would have suggested the following change which is more in the spirit of Python3:
- new_vertices = map(lambda v : tuple(scalar*x for x in v._vector), self.vertex_generator()) - new_rays = map(lambda r : tuple(sign*x for x in r._vector), self.ray_generator()) + new_vertices = (tuple(scalar*x for x in v._vector) for v in self.vertex_generator()) + new_rays = (tuple(sign*x for x in r._vector) for r in self.ray_generator())
I agree, you can go ahead and push that change.
More wild speculation: this is also the only module I've seen that has doctests within a WARNING block. There is a tiny chance that a series of unfortunate events leads to those doctests not being GC'ed. But that still wouldn't explain why you're seeing different results than we are.
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
93237d6 | 28866: avoid map of a lambda function |
Yeah, but this still shouldn't be this hard to figure out. How much RAM does your system have and is swap enabled?
I'm sorry, can you teach me how I can figure this out?
One difference that I suspect between you and (Jonathan and I) is the optimization flags passed to the compiler while building sage. I think we both use
-march=native
for everything, and you could be getting some SPKG built non-optimally to the point where one of these methods wastes a ton of memory. If you're up for it, you could try
Ok, I will test that.
Replying to @seblabbe:
I'm sorry, can you teach me how I can figure this out?
There's probably nothing unusual here, but:
$ cat /proc/meminfo
should show the relevant stuff on linux. On mac or windows I would have to resort to google.
$ cat /proc/meminfo
should show the relevant stuff on linux. On mac or windows I would have to resort to google.
This is the output on the machine having trouble:
$ cat /proc/meminfo
MemTotal: 16356316 kB
MemFree: 3011884 kB
MemAvailable: 14369868 kB
Buffers: 1356356 kB
Cached: 7550684 kB
SwapCached: 1856 kB
Active: 4893152 kB
Inactive: 5302360 kB
Active(anon): 398700 kB
Inactive(anon): 971972 kB
Active(file): 4494452 kB
Inactive(file): 4330388 kB
Unevictable: 48 kB
Mlocked: 48 kB
SwapTotal: 2928636 kB
SwapFree: 2868372 kB
[...]
(Note that when I pushed the branch on the ticket, it automatically set the ticket to needs_review again (it seems to be a new feature), so I let you review my commit)
Changed reviewer from Michael Orlitzky to Sébastien Labbé, Michael Orlitzky
Replying to @seblabbe:
This is the output on the machine having trouble:
Nothing unusual.
Another thing I thought of: if recompiling everything with -march=native -O2
doesn't help... maybe there's some system package being used that was built without optimizations...
$ grep 'will use system' config.log
should show which which system packages are being used.
On Python 2:
File "src/sage/geometry/polyhedron/base.py", line 160, in sage.geometry.polyhedron.base.Polyhedron_base.__init__
Failed example:
p = Polyhedron_field(parent, Vrep, 'nonsense',
Vrep_minimal=True, Hrep_minimal=True, pref_rep='Vrep')
Expected:
Traceback (most recent call last):
...
TypeError: _init_Hrepresentation() takes 3 positional arguments but 9 were given
Got:
<BLANKLINE>
Traceback (most recent call last):
File "/var/lib/buildbot/slave/sage2_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/var/lib/buildbot/slave/sage2_git/build/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.geometry.polyhedron.base.Polyhedron_base.__init__[13]>", line 2, in <module>
Vrep_minimal=True, Hrep_minimal=True, pref_rep='Vrep')
File "/var/lib/buildbot/slave/sage2_git/build/local/lib/python2.7/site-packages/sage/geometry/polyhedron/base.py", line 172, in __init__
self._init_from_Vrepresentation_and_Hrepresentation(Vrep, Hrep)
File "/var/lib/buildbot/slave/sage2_git/build/local/lib/python2.7/site-packages/sage/geometry/polyhedron/backend_field.py", line 163, in _init_from_Vrepresentation_and_Hrepresentation
self._init_Hrepresentation(*Hrep)
TypeError: _init_Hrepresentation() takes exactly 3 arguments (9 given)
**********************************************************************
1 item had failures:
1 of 15 in sage.geometry.polyhedron.base.Polyhedron_base.__init__
[1443 tests, 1 failure, 37.42 s]
----------------------------------------------------------------------
sage -t --long src/sage/geometry/polyhedron/base.py # 1 doctest failed
----------------------------------------------------------------------
Changed reviewer from Sébastien Labbé, Michael Orlitzky to Sébastien Labbé, Michael Orlitzky, Matthias Koeppe
Looks good to me
Changed branch from public/28866-reb to c701c31
I introduced a bug in this ticket: The double description for intervals is completely wrong.
Please review #29904.
On a clean develop branch running
SageMath version 9.1.beta9, Release Date: 2020-03-29
, I get:while
or
gives
CC: @mkoeppe @jplab @orlitzky
Component: geometry
Author: Jonathan Kliem
Branch:
c701c31
Reviewer: Sébastien Labbé, Michael Orlitzky, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/28866