Skip to content
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

Modular group cohomology, version 2.1.4 #14492

Closed
simon-king-jena opened this issue Apr 26, 2013 · 98 comments
Closed

Modular group cohomology, version 2.1.4 #14492

simon-king-jena opened this issue Apr 26, 2013 · 98 comments

Comments

@simon-king-jena
Copy link
Member

Because of several backward incompatible internal changes in Sage (e.g., removing SAGE_DATA and moving it to SAGE_SHARE), the current version of the optional group cohomology package p_group_cohomology did not work.

Moreover, tmp_dir used to return a string, but now it also creates a directory; for this reason, many tests failed.

And also some random generators (in GAP?) seem to have changed. For this reason, some ring presentations have changed (i.e., the rings are isomorphic, but a different presentation is obtained with an old or with a new Sage version). Hence, doctests needed to change.

In any case: The new group cohomology spkg copes with these changes. However, it will therefore not work with old Sage versions.

Further implementation changes

  • Since this spkg is the upstream source, the source code is still contained in the mercurial repository. Change: Now, mercurial queues are used (this made it a bit easier for me to manage the changes while developing).
  • urllib2 is used, which to me seems to work a bit better than urllib.
  • The new version uses os.path.join and os.path.split, rather than string concatenation using a non-portable path separator '/'.
  • The old version had a bug related with pickling: In order to keep the data base created by a user separate from the data base that is shared by all users of an installation, soft links were used. But when one saves new data into a file that used to be the name of a soft link, one should unlink the link first. This is fixed in the new version.
  • The protocol output has changed. In a typical cohomology computation, several cohomology rings are involved (the ring to-be-computed, the cohomology ring of a Sylow subgroup, or of a maximal elementary abelian subgroup, etc). The new protocol output tells in which ring the current computation happens.

Change of algorithms

The first change: If no new relation has been found in degree n-1, then a complete Gröbner basis of the relation ideal is computed, even if a completeness criterion can not be applied yet. This simple change reduces the computation time for the mod-3 cohomology of J3 by several days.

The second change: By mistake, the old version would attempt to prove completeness with the Hilbert-Poincaré criterion, even if the Symonds criterion has already shown that the ring is incomplete. Now, the Hilbert-Poincaré criterion is only used if the Symonds criterion has not been conclusive.

The third change: In the old version, it was first tested that the current ring approximation contains parameters for the complete cohomology ring, and then such parameters have been constructed using the relations in the ring approximation. These relations can be rather complicated. Therefore, we now compute parameters via restriction to maximal elementary abelian subgroups. It is known that a set of elements of the ring approximation yields parameters for the cohomology ring, if and only if the cohomology of the maximal elementary abelian subgroups is finite over the restriction of these elements.

Hence, we can detect parameters even if the ring approximation is far from being complete, and we can compute in rings that are much easier to deal with. By consequence, it is now in most cases possible to prove completeness by the Symonds criterion, which relies on the explicit construction of parameters in small degrees. Our other criteria, which are able to use an existence proof for parameters of small degrees (without the need of their explicit construction) are of course still part of the package, but it became difficult to show examples in which they are actually used.

New features

There is no substantially new functionality. However, depending on how fast the reviewing goes, I could imagine to soon add a method so that gap(H) returns an algebra in the GAP interface, isomorphic to a cohomology ring H.

Documentation

The documentation can be built locally. It should look as here

SPKG

p_group_cohomology-2.1.4.spkg

CC: david.green@uni-jena.de @jhpalmieri

Component: packages: optional

Keywords: group cohomology

Author: Simon King

Reviewer: Volker Braun, Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/14492

@simon-king-jena
Copy link
Member Author

comment:1

I did not test the package on OS X yet, but only on my openSuse laptop.

The new package version should be able to compute the mod-3 cohomology of the third Janko group without manual intervention, but the verification will take a couple of more days.

In any case, it needs review!

@simon-king-jena

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented Apr 26, 2013

comment:3

I get this error with the doctests:

$ sage -bt local/lib/python/site-packages/pGroupCohomology/
...
File "local/lib/python/site-packages/pGroupCohomology/factory.py", line 897, in pGroupCohomology.factory.CohomologyRingFactory._get_p_group_from_cache_or_db
Failed example:
    CohomologyRing._get_p_group_from_cache_or_db('8gp3',(8,3), from_scratch=True)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: You requested a computation from scratch. Please remove .../8gp3
Got:
    <BLANKLINE>

Maybe something wrong with the temp directory? The actual functionality seems to work, though.

@simon-king-jena
Copy link
Member Author

comment:4

Hm. This should work. But there is something much more urgent concerning "should work":

I tested the package on my laptop by running the test script explicitly, which worked. But When I run it as part of the installation procedure (i.e., by export SAGE_CHECK=yes before sage -i ...), I get a total failure! There was not even a single test that passed.

Reason:

sage-runtests: error: no such option: -o
list index out of range
Usage: sage -t [options] filenames

I don't know where the "-o" comes from. To be investigated.

@simon-king-jena
Copy link
Member Author

Work Issues: Fix test script

@simon-king-jena
Copy link
Member Author

comment:5

Replying to @vbraun:

I get this error with the doctests:

$ sage -bt local/lib/python/site-packages/pGroupCohomology/
...
File "local/lib/python/site-packages/pGroupCohomology/factory.py", line 897, in pGroupCohomology.factory.CohomologyRingFactory._get_p_group_from_cache_or_db
Failed example:
    CohomologyRing._get_p_group_from_cache_or_db('8gp3',(8,3), from_scratch=True)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: You requested a computation from scratch. Please remove .../8gp3
Got:
    <BLANKLINE>

Maybe something wrong with the temp directory? The actual functionality seems to work, though.

Aha. So, here I check against an error that is supposed to occur in certain settings. Hm.

I don't understand why the result is just a blank line, not the error that is actually due in this case. The line preceding this test removes the existing cohomology ring from memory but not from disk; and a computation from scratch should then fail, because it does not like to find the data in a location in which new data are supposed to be written.

@simon-king-jena
Copy link
Member Author

comment:6

I think here is the problem:

    Res = os.popen('sage -t -optional -long '+f.name).read()

Could it be that in the most recent Sage version one should instead write sage -t --optional --long?

@simon-king-jena
Copy link
Member Author

Changed work issues from Fix test script to none

@simon-king-jena
Copy link
Member Author

comment:7

OK, I have just posted a new spkg which uses double-minus for the command line options, and just started re-installation and test.

@simon-king-jena
Copy link
Member Author

comment:8

No. Still all tests fail. This is with sage-5.9.rc0.

@simon-king-jena
Copy link
Member Author

comment:9

The failures that I get for every single test looks like this:

pGroupCohomology.resolution.makeSpecialGroupData:
Running doctests with ID 2013-04-26-16-31-00-2eee1fc7.
Doctesting 1 file.
sage -t /home/simon/.sage/temp/linux-sqwp.site/11900/dir_vpH6Jb/file_5.py
    [0 tests, 0.00 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.0 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.0 seconds

So, does this look like an error in the doctest framework? I can reproduce it when I directly run the spkg-check script under sage-5.9.rc0.

I tried to run the tests verbously, but it didn't help, the tests won't even start, but no reason is given.

@simon-king-jena
Copy link
Member Author

comment:10

The tests of each function are written into a temporary file. One of the files looks like this:

# -*- coding: utf-8 -*-
r"""
        Return a hash value of self

        TESTS:

        The example produces files. For safety reasons, we choose files
        in a temporary directory; it will be removed as soon as Sage is quit::

            sage: tmp_root = tmp_dir()
            sage: from pGroupCohomology import CohomologyRing
            sage: CohomologyRing.set_user_db(tmp_root)
            sage: H = CohomologyRing(8,3)
            sage: H.make()
            sage: C = H.2
            sage: hash(C)==hash(copy(C))   # indirect doctest
            True
            sage: hash(C)==hash(loads(dumps(C)))
            True
            sage: D = {C:1, C^2:2}
            sage: D[copy(C)]
            1
            sage: D[copy(C)*C]
            2

"""

without a line break at the end. I am testing now if the missing line break is to blame.

@simon-king-jena
Copy link
Member Author

comment:11

No, adding the line break did change nothing.

@simon-king-jena
Copy link
Member Author

comment:12

One could say that I was misusing the "# optional" tag: The tests were supposed to be part of the test suite, but the tag was only in order to tell the user (not to tell the test bot): "If you don't have internet access then this test is supposed to fail; don't worry".

In the new version, that I just put on-line, the tag is replaced by "# needs internet access", which is informative to the user in case of an error, but will not interfere with the test framework.

@simon-king-jena
Copy link
Member Author

comment:13

And I forgot to mention one thing: In contrast to previous versions of the spkg, it is now not required to have internet access for running the test suite. The only exceptions are the tests of two methods whose actual purpose is internet access.

@jhpalmieri
Copy link
Member

comment:14

In spkg-check, SAGE_NUMBER_THREADS should be changed to SAGE_NUM_THREADS.

@simon-king-jena
Copy link
Member Author

comment:15

Replying to @jhpalmieri:

In spkg-check, SAGE_NUMBER_THREADS should be changed to SAGE_NUM_THREADS.

Thank you for spotting this! I have already been wondering why setting MAKE="make -j4" had no effect on the number of parallel threads in the tests.

@simon-king-jena
Copy link
Member Author

comment:16

OK, fixed, and setting MAKE="make -j2" is now enough to start tests in parallel.

@jhpalmieri
Copy link
Member

comment:17

On my OS X 10.8 machine, all tests passed!

@simon-king-jena
Copy link
Member Author

comment:18

Replying to @vbraun:

I get this error with the doctests:

$ sage -bt local/lib/python/site-packages/pGroupCohomology/
...
File "local/lib/python/site-packages/pGroupCohomology/factory.py", line 897, in pGroupCohomology.factory.CohomologyRingFactory._get_p_group_from_cache_or_db
Failed example:
    CohomologyRing._get_p_group_from_cache_or_db('8gp3',(8,3), from_scratch=True)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: You requested a computation from scratch. Please remove .../8gp3
Got:
    <BLANKLINE>

Is it reproducible?

@simon-king-jena
Copy link
Member Author

comment:19

Replying to @jhpalmieri:

On my OS X 10.8 machine, all tests passed!

And on my openSuse laptop, all tests passed both with sage-5.8 and sage-5.9.rc0.

@jdemeyer
Copy link

jdemeyer commented May 9, 2013

Changed reviewer from Volker Braun to Volker Braun, Jeroen Demeyer

@simon-king-jena
Copy link
Member Author

comment:83

It has turned out that, with the increased optimization level, the package won't build with old compiler versions (e.g., not with gcc 4.4.5).

Since this spkg version does not seem to be copied to the "official" list of optional spkgs: Is there still time to add a test that makes sure to install the package only when it works with the available gcc? In later versions (but not in 2.1.4 yet), I could imagine to make the optimization level depend on the available compiler.

@simon-king-jena
Copy link
Member Author

comment:84

I did preserve a copy of the spkg that has been reviewed here. But I am now posting a new version that tests whether some underlying programs appear to work. If they don't, I am printing a hint concerning gcc version, and exit with an error.

If you think that this should better be done on a new ticket, then I'll do so. But I think it would be simpler to keep it here, because p_group_cohomology-2.1.4.spkg has not been put in the official repository of optional packages, yet.

@simon-king-jena
Copy link
Member Author

comment:85

It seems to work (i.e., to fail) correctly.

When installing the updated spkg version in a Sage version that was built with gcc 4.4.5, it ends with

...
Testing makeNontips
makeNontips -ORLL 2 /mnt/local/king/SAGE/prereleases/sage-5.9.rc0.system-gcc/spkg/build/p_group_cohomology-2.1.4/src/present/src/test
sh: maketab: not found
sh: maketab: not found
p002.zzz: No such file or directory
make[1]: *** [makeNontips] Gleitkomma-Ausnahme
make[1]: *** Datei »makeNontips« wird gelöscht
make[1]: Leaving directory `/mnt/local/king/SAGE/prereleases/sage-5.9.rc0.system-gcc/spkg/build/p_group_cohomology-2.1.4/src/bin'
make: *** [all] Fehler 2
Error building pGroupCohomology.
You are using gcc 4.4.5
If this is older than gcc 4.6, then please consider upgrading your system-wide gcc,
or install Sage with its gcc spkg.
If your gcc version is more recent, then please inform the author.

real    0m14.620s
user    0m12.601s
sys     0m1.112s
************************************************************************
Error installing package p_group_cohomology-2.1.4
************************************************************************
...

But it installs fine on a system with gcc 4.6.

If you think that we can include this last minute change, then please review it. Otherwise, please tell me to put back the previous spkg.

@simon-king-jena
Copy link
Member Author

comment:86

Sorry, one small file is still missing.

@simon-king-jena
Copy link
Member Author

comment:87

OK, the spkg is updated. I verified that it does build on two systems with gcc 4.6 resp. 4.7.2, but correctly refuses to build with gcc 4.4.5, reporting a segmentation fault in makeNontips, namely

Testing makeNontips
/mnt/local/king/SAGE/prereleases/sage-5.9.rc0.system-gcc/spkg/build/p_group_cohomology-2.1.4/src/bin/maketab 2
MAKETAB Revision 1.2 (1997/09/11)
Writing tables to p002.zzz
makeNontips -ORLL 2 /mnt/local/king/SAGE/prereleases/sage-5.9.rc0.system-gcc/spkg/build/p_group_cohomology-2.1.4/src/present/src/test
make[1]: *** [makeNontips] Speicherzugriffsfehler
make[1]: *** Datei »makeNontips« wird gelöscht
make[1]: Leaving directory `/mnt/local/king/SAGE/prereleases/sage-5.9.rc0.system-gcc/spkg/build/p_group_cohomology-2.1.4/src/bin'
make: *** [all] Fehler 2
Error building pGroupCohomology.
You are using gcc 4.4.5
If this is older than gcc 4.6, then please consider upgrading your system-wide gcc,
or install Sage with its gcc spkg.
If your gcc version is more recent, then please inform the author.

The difference to the previous test is this: The test is now creating the previously missing data file p002.zzz before calling makeNontips.

@jdemeyer
Copy link

Changed author from SimonKing to Simon King

@jdemeyer
Copy link

comment:89

It doesn't seem to work, due to the file makeNontips being missing:

echo "Testing makeNontips"
Testing makeNontips
/mazur/release/merger/sage-5.10.beta0/spkg/build/p_group_cohomology-2.1.4/src/bin/maketab 2
MAKETAB Revision 1.2 (1997/09/11)
Writing tables to p002.zzz
makeNontips -ORLL 2 /mazur/release/merger/sage-5.10.beta0/spkg/build/p_group_cohomology-2.1.4/src/present/src/test
make[1]: makeNontips: Command not found
make[1]: *** [makeNontips] Error 127
make[1]: Leaving directory `/mazur/release/merger/sage-5.10.beta0/spkg/build/p_group_cohomology-2.1.4/src/bin'
make: *** [all] Error 2
Error building pGroupCohomology.
You are using gcc 4.8.0
If this is older than gcc 4.6, then please consider upgrading your system-wide gcc,
or install Sage with its gcc spkg.
If your gcc version is more recent, then please inform the author.

@jdemeyer
Copy link

comment:90

Perhaps you meant

./makeNontips

instead of

makeNontips

@simon-king-jena
Copy link
Member Author

comment:91

Replying to @jdemeyer:

Perhaps you meant

./makeNontips

instead of

makeNontips

I have updated my spkg accordingly.

Could you try it again? I guess the problem on my machine has been that there was a makeNontips in the path (either broken or working, hence, the Makefile correctly detected the problem, but based on a previous installation).

@jdemeyer
Copy link

comment:93

Seems to work now.

@haraldschilly
Copy link
Member

comment:94

i've put the spkg on the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants