Does Pyrex take advantage of multiple cores?
On Wed, 15 Nov 2006, William Stein wrote: > > Hi, > If anybody wants to write a Pyrex (SageX) version of > Jim's short point-counting program, that would be > appreciated; let me know. See below. > ------- Forwarded message ------- > From: "James Carlson" <[EMAIL PROTECTED]> > To: "William Stein" <[EMAIL PROTECTED]> > Cc: > Subject: SAGE question > Date: Sun, 12 Nov 2006 08:59:05 -0800 > Hola, > I will indeed be able to make good use of the faster finite > field library. Attached is some code that computes by > brute force counting the number of points on a surface in P^3 > over GF(p^k) for a range of k. I have one question on this > code which relates to binding order. (See below) > I'm running this on a dual-dual PPC mac with 2.5 GHz > cores and 8 Gb of RAM. I notice that SAGE seems to > mostly use one core. This is good in some respects, > bad in others. Hmmmmm. > I'm totally sold on SAGE after less than 24 hours of part-time > use. > Jim > #################################################### > # Question. I'd like to have "f" as an argument to "count2". > # But the ring R and its indeterminates are not defined > # when f is called. Is there a way around this? > # Brute force SAGE code to count the number of > # points on a surface in P^3(GF(q)) > def count2(p, nn): > # Count solutions of f(x,y,z,w) = 0 > # in P^3(GF(p^k)) as k ranges ovr > # nn, e.g., nn = range(1,7) > for j in nn: > # Set up fields, rings, variables > K = GF(p^j) > R = MPolynomialRing(K, 4, 'xyzw') > x,y,z,w = R.gens() > f = x^3 + y^3 + z^3 + w^3 > print p, j, count( f, K ) > def count( f, K ): > # list of points in the various affine cells of P^3(K) > a0 = (1,0,0,0) > a1 = ((x,1,0,0) for x in K) > a2 = ((x,y,1,0) for x in K for y in K) > a3 = ((x,y,z,1) for x in K for y in K for z in K) > # initialize the count: > count = 0 > # count solutions in a0: > if f(1,0,0,0) == 0: > count = count + 1 > # count solutions in a1: > for point in a1: > if f(point) == 0: > count = count + 1 > # count solutions in a2: > for point in a2: > if f(point) == 0: > count = count + 1 > # count solutions in a3: > for point in a3: > if f(point) == 0: > count = count + 1 > # display the result: > return count > ##################################################### > On Nov 11, 2006, at 8:35 PM, William Stein wrote: >> On Sat, 11 Nov 2006 14:12:39 -0800, James Carlson <[EMAIL PROTECTED]> >> wrote: >> >>> Dear William, >>> >>> Thanks! First for the quick reply and second to pointing >>> me to SAGE, which I had not looked at. However, I now >>> have it running on both an Intel and a PPC Mac. I think >>> it is the answer to getting my current little experiment, >>> which requires some computations in GF(p^k) for k > 1. >>> >>> I am having a lot of fun using SAGE already. >> >> Let me know if you have any questions or need something to be >> faster. SAGE has a new faster finite field library (called >> Givaro) that we are rolling out in hopefully less than a week, >> which is highly optimized for GF(p^k) for p^k < 2^16. Also, >> there are numerous optimizations tricks that we've been >> developing lately. >> >> William > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
