Re: [sage-support] Re: after upgrade to 9.3, SignalError: Illegal instruction

2021-08-25 Thread Matthias Koeppe
I've opened https://trac.sagemath.org/ticket/32424 for this issue with Sage 
9.4.


On Wednesday, August 25, 2021 at 8:15:02 PM UTC-7 wst...@gmail.com wrote:

> Hi,
>
> I release cocalc-docker ([1], [2]) a few days ago with sage-9.4, and had 
> people reporting back "illegal instruction" issues.  Sage is built there 
> with SAGE_FAT_BINARY="yes", using this script [3].  One person who reported 
> a problem had a "Dell PowerEdge R710." and I built on an intel Dell 
> PowerEdge R630, for what it is worth.  They got the error "An illegal 
> instructor occurred" when computing "5+2" in Sage. 
>
> My solution for now is to keep cocalc-docker at sage-9.3 for the time 
> being, and suggest that people build sage from source on their own machine 
> if necessary.   I'll let you know if I have any further information, but I 
> just wanted to add this data point.
>
> [1] https://github.com/sagemathinc/cocalc-docker
> [2] https://hub.docker.com/r/sagemathinc/cocalc
> [3] 
> https://github.com/sagemathinc/cocalc-docker/blob/master/scripts/install_sage.sh
>
> On Wednesday, August 25, 2021 at 8:57:44 AM UTC-7 Marco Streng wrote:
>
>> In the end I build 9.4 from source and that worked perfectly. And it 
>> turned out that the Ubuntu 18.04 binaries of 9.2 also work on this 
>> particular machine (though we went for 9.4 in the end). Thanks again for 
>> the help.
>>
>> Op dinsdag 24 augustus 2021 om 18:03:01 UTC+2 schreef slelievre:
>>
>>> 2021-08-24 05:48 UTC, Dima Pasechnik: 
>>> > 
>>> > These "illegal instruction" errors are an indication 
>>> > that the binary was built for a more advanced CPU 
>>> > than yours - which does not support certain CPU 
>>> > commands. It's a bug in "fat binary" build process 
>>> > we see for some time. 
>>> > 
>>> > Build Sage yourself, or use Conda. 
>>>
>>> I opened a ticket at binary-pkg for that: 
>>> https://github.com/sagemath/binary-pkg/issues/31 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/5f3adbcd-2354-4e5e-b110-0a98622cde7dn%40googlegroups.com.


Re: [sage-support] List all shortest paths between two vertices in a graph

2021-08-25 Thread Beth Claire
Thanks, that does exactly what I needed!  It is significantly faster and 
uses significantly less memory.
--Beth

On Wednesday, August 25, 2021 at 6:33:36 AM UTC-5 Jean-Florent Raymond 
wrote:

> Hello,
>
> The function shortest_simple_paths returns an iterator with paths sorted
> by increasing length. Therefore if you only want paths of minimum
> length, you can iterate over the result of shortest_simple_paths and
> stop as soon as you encounter a longer path. That way you do not iterate
> over all the (possibly many) irrelevant longer paths and, depending on
> how shortest_simple_paths is implemented, you might even avoid to
> compute them.
>
> Something like that:
>
> def shortest_paths_really(G, u, v):
> """Return all the shortest simple paths between u and v"""
>
> uv_paths = G.shortest_simple_paths(u, v)
> first_path = next(uv_paths) # a shortest path
> dist = len(first_path)
> yield first_path
> for path in uv_paths:
> if len(path) > dist:
> # no need to go further: paths are too long for now on
> return
> yield path
>
> It is not obvious that doing so is much faster than your solution: it
> depends on the implementation of shortest_simple_paths, which I did not
> look.
> You can convince yourself that it saves some time at least by looking at
> a graph where two vertices have few shortest paths and many longer paths
> connecting them. For instance in graphs.CircularLadderGraph(n) there are
> only two shortest paths connecting vertices 1 and n but exponentially
> many of longer length.
>
> sage: n = 10
> sage: G = graphs.CircularLadderGraph(n)
> sage: u, v = 1, n
> sage: %timeit list(shortest_paths_really(G, u, v))
> 35.9 µs ± 159 ns per loop (mean ± std. dev. of 7 runs, 1 loops each)
> sage: %timeit list(filter(lambda x: len(x) == 1+G.distance(u, v),
> G.shortest_simple_paths(u, v)))
> 66.6 ms ± 180 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
>
>
> Jean-Florent.
>
> Le 24/08/2021 à 01:39, Beth Claire a écrit :
> > Hi,
> > Given an undirected graph G, and two vertices u and v of G, I want to 
> list 
> > all paths from u to v with a length of d_G(u,v). The built-in function 
> > shortest_simple_paths 
> > <
> https://doc.sagemath.org/html/en/reference/graphs/sage/graphs/generic_graph.html#sage.graphs.generic_graph.GenericGraph.shortest_simple_paths>,
>  
>
> > despite its name, seems to list *all* simple paths from u to v. One 
> option 
> > is to filter the output of shortest_simple_paths by length, e.g.
> > list(filter(lambda x: len(x)== 
> > 1+G.distance(u,v)),G.shortest_simple_paths(u,v)))
> > 
> > However, this is extremely inefficient, since it tells sage to generate 
> all 
> > simple paths and then discards most of them. Is there a better way to 
> get 
> > this information?
> > 
> > Thanks,
> > Beth
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/7f9051af-9100-496d-937a-100e3ddf3c19n%40googlegroups.com.


Re: [sage-support] Re: after upgrade to 9.3, SignalError: Illegal instruction

2021-08-25 Thread William Stein
Hi,

I release cocalc-docker ([1], [2]) a few days ago with sage-9.4, and had 
people reporting back "illegal instruction" issues.  Sage is built there 
with SAGE_FAT_BINARY="yes", using this script [3].  One person who reported 
a problem had a "Dell PowerEdge R710." and I built on an intel Dell 
PowerEdge R630, for what it is worth.  They got the error "An illegal 
instructor occurred" when computing "5+2" in Sage. 

My solution for now is to keep cocalc-docker at sage-9.3 for the time 
being, and suggest that people build sage from source on their own machine 
if necessary.   I'll let you know if I have any further information, but I 
just wanted to add this data point.

[1] https://github.com/sagemathinc/cocalc-docker
[2] https://hub.docker.com/r/sagemathinc/cocalc
[3] 
https://github.com/sagemathinc/cocalc-docker/blob/master/scripts/install_sage.sh

On Wednesday, August 25, 2021 at 8:57:44 AM UTC-7 Marco Streng wrote:

> In the end I build 9.4 from source and that worked perfectly. And it 
> turned out that the Ubuntu 18.04 binaries of 9.2 also work on this 
> particular machine (though we went for 9.4 in the end). Thanks again for 
> the help.
>
> Op dinsdag 24 augustus 2021 om 18:03:01 UTC+2 schreef slelievre:
>
>> 2021-08-24 05:48 UTC, Dima Pasechnik:
>> >
>> > These "illegal instruction" errors are an indication
>> > that the binary was built for a more advanced CPU
>> > than yours - which does not support certain CPU
>> > commands. It's a bug in "fat binary" build process
>> > we see for some time.
>> >
>> > Build Sage yourself, or use Conda.
>>
>> I opened a ticket at binary-pkg for that:
>> https://github.com/sagemath/binary-pkg/issues/31
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b7d09d6d-c42f-49d4-8b75-2526b9f31020n%40googlegroups.com.


Re: [sage-support] Other mailing lists

2021-08-25 Thread David Lowry-Duda
> I believe that most of the traffic these days is on sage-support and 
> sage-devel, rather than the more specialized groups. Feel free to post 
> questions about Sage's algebra capabilities here.

There is some activity on sage-nt too, but sage-support and sage-devel 
are much more consistently active.

There is also a zulip chat with sporadic activity (much more activity 
around sagedays events): https://www.sagemath.org/help-zulip.html

- DLD

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/YSaO71oolPJq5cIO%40icerm-dld.


Re: [sage-support] Re: after upgrade to 9.3, SignalError: Illegal instruction

2021-08-25 Thread Marco Streng
In the end I build 9.4 from source and that worked perfectly. And it turned 
out that the Ubuntu 18.04 binaries of 9.2 also work on this particular 
machine (though we went for 9.4 in the end). Thanks again for the help.

Op dinsdag 24 augustus 2021 om 18:03:01 UTC+2 schreef slelievre:

> 2021-08-24 05:48 UTC, Dima Pasechnik:
> >
> > These "illegal instruction" errors are an indication
> > that the binary was built for a more advanced CPU
> > than yours - which does not support certain CPU
> > commands. It's a bug in "fat binary" build process
> > we see for some time.
> >
> > Build Sage yourself, or use Conda.
>
> I opened a ticket at binary-pkg for that:
> https://github.com/sagemath/binary-pkg/issues/31
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/076e95bf-63c9-4e9e-b47e-cce9d2d0a94en%40googlegroups.com.


Re: [sage-support] List all shortest paths between two vertices in a graph

2021-08-25 Thread Jean-Florent Raymond
Hello,

The function shortest_simple_paths returns an iterator with paths sorted
by increasing length. Therefore if you only want paths of minimum
length, you can iterate over the result of shortest_simple_paths and
stop as soon as you encounter a longer path. That way you do not iterate
over all the (possibly many) irrelevant longer paths and, depending on
how shortest_simple_paths is implemented, you might even avoid to
compute them.

Something like that:

def shortest_paths_really(G, u, v):
"""Return all the shortest simple paths between u and v"""

uv_paths = G.shortest_simple_paths(u, v)
first_path = next(uv_paths) # a shortest path
dist = len(first_path)
yield first_path
for path in uv_paths:
if len(path) > dist:
# no need to go further: paths are too long for now on
return
yield path

It is not obvious that doing so is much faster than your solution: it
depends on the implementation of shortest_simple_paths, which I did not
look.
You can convince yourself that it saves some time at least by looking at
a graph where two vertices have few shortest paths and many longer paths
connecting them. For instance in graphs.CircularLadderGraph(n) there are
only two shortest paths connecting vertices 1 and n but exponentially
many of longer length.

sage: n = 10
sage: G = graphs.CircularLadderGraph(n)
sage: u, v = 1, n
sage: %timeit list(shortest_paths_really(G, u, v))
35.9 µs ± 159 ns per loop (mean ± std. dev. of 7 runs, 1 loops each)
sage: %timeit list(filter(lambda x: len(x) ==  1+G.distance(u, v),
G.shortest_simple_paths(u, v)))
66.6 ms ± 180 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)


Jean-Florent.

Le 24/08/2021 à 01:39, Beth Claire a écrit :
> Hi,
> Given an undirected graph G, and two vertices u and v of G, I want to list 
> all paths from u to v with a length of d_G(u,v).  The built-in function 
> shortest_simple_paths 
> ,
>  
> despite its name, seems to list *all* simple paths from u to v.  One option 
> is to filter the output of shortest_simple_paths by length, e.g.
> list(filter(lambda x: len(x)== 
> 1+G.distance(u,v)),G.shortest_simple_paths(u,v)))
> 
> However, this is extremely inefficient, since it tells sage to generate all 
> simple paths and then discards most of them.  Is there a better way to get 
> this information?
> 
> Thanks,
> Beth
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/d0df352f-a07b-c854-ea78-0234b2006ae9%40uca.fr.