473,748 Members | 10,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

gmpy 1.01 rc near... anybody wanna test>

I have fixed almost all of the outstanding bugreports and feature
request for gmpy: divm doesn't leak memory any more, truediv and
floordiv are implemented for all types, etc -- in the current CVS
version (one thing I must still look at is divm's behavior when its args
are not mutually prime). It currently compiles w/o warnings, and passes
all of its 1040+ tests, w/the current release of GMP (4.1.4), Python
(2.4.2), MacOSX (10.4.3), XCode (2.1), gcc (4.0).\\

gmpy users able to download and build from sourceforge's cvs are
encouraged to test the current CVS version. This is a great time to
send me any bug reports or (minor;-) feature requests, since I hope to
release a "1.01 release candidate" of gmpy ASAP. I'm currently unable
to build any Windows version -- any volunteer for THAT task is doubly
welcome;-).
Thanks,

Alex
Nov 7 '05
22 1956

Alex Martelli wrote:
<ca****@comcast .net> wrote:
Everything works fine with v1.16. I'm sure I was doing something wrong.
I shouldn't be testing that late at night. ;-)

It looks like the warning about "tp_compare " has been fixed.


I didn't touch tp_compare specifically, so the fix must have been a side
effect (?).

I will try to build a version for Windows, but that may take me a day
or two.


Great, pls let me know when you do (particularly if you're willing to
make your build available to others -- if you send it to me I can make
it downloadable from sourceforge).

Thanks for the updates to gmpy!


You're welcome, and thank YOU for the feedback &c.
Alex

I made a successful installer for Windows using Mingw32 and Python 2.4.
I needed to edit setup.py to list gmp as a required library.

if sys.version.fin d('MSC')==-1:
gmpy_ext = Extension('gmpy ', sources=['src/gmpy.c'],
# library_dirs=['/usr/local/lib'],
libraries=['gmp'])
else:
gmpy_ext = Extension('gmpy ', sources=['src/gmpy.c'],
include_dirs=['./src'],
libraries=['gmp']) # I added libraries!

Will you be updating the information in setup.py file?

Tomorrow, I'll recreate my build process on another computer. I am
willing to create Windows installers.

Which versions of Python do you want to support?

Do you want versions that include GMP tailored for specific processors?
With GMP 4.1.4 compiled for pentium3, and running on a 1.8Ghz Pentium
M, I'm able to calculate the decimal form of 2^25964951 (the 43rd
Mersenne prime) in 10 seconds. The prior gmpy release takes just over
14 seconds. Without gmpy, Python takes 25.4 seconds. On an Athlon
MP2800+ (2.133Ghz) with GMP compiled for that processor, I can do it in
6.6 seconds using gmpy and 22.4 seconds without gmpy. I'm working with
blocks of 1000 digits and using a combination of Toom-Cook and
Nussbaumer convolution to perform the multiplies and squares.

I did very that the tp_compare errors are fixed. I removed the warnings
filter in my code and the warning did occur with the old gmpy but did
not occur with my version.

Case

Nov 9 '05 #11
<ca****@comcast .net> wrote:
...
I made a successful installer for Windows using Mingw32 and Python 2.4.
Great, thanks.
I needed to edit setup.py to list gmp as a required library.

if sys.version.fin d('MSC')==-1:
gmpy_ext = Extension('gmpy ', sources=['src/gmpy.c'],
# library_dirs=['/usr/local/lib'],
libraries=['gmp'])
else:
gmpy_ext = Extension('gmpy ', sources=['src/gmpy.c'],
include_dirs=['./src'],
libraries=['gmp']) # I added libraries!

Will you be updating the information in setup.py file?
Done, in the current CVS version.
Tomorrow, I'll recreate my build process on another computer. I am
willing to create Windows installers.
Wonderful!
Which versions of Python do you want to support?
I have tested gmpy with 2.3 and 2.4 on Mac, and those two and also 2.2
on Linux. I think supporting 2.2 with a Windows download is probably
unneeded, but 2.4 is a must and I suspect 2.3 would be nice...
Do you want versions that include GMP tailored for specific processors?
My gut reaction here is that people with special processors, Windows,
and demanding performance needs should probably get their own
development environments and build GMP and gmpy accordingly.

Any opinions from the public on this one...?
With GMP 4.1.4 compiled for pentium3, and running on a 1.8Ghz Pentium
M, I'm able to calculate the decimal form of 2^25964951 (the 43rd
Mersenne prime) in 10 seconds. The prior gmpy release takes just over
14 seconds. Without gmpy, Python takes 25.4 seconds. On an Athlon
MP2800+ (2.133Ghz) with GMP compiled for that processor, I can do it in
6.6 seconds using gmpy and 22.4 seconds without gmpy. I'm working with
blocks of 1000 digits and using a combination of Toom-Cook and
Nussbaumer convolution to perform the multiplies and squares.
Sounds quite decent -- about a 2.5 to 3+ times speedup wrt Python, and
some speedup wrt gmpy 1.0 (all GMP's merit -- I didn't address
performance aspects at all in this delta). Just out of curiosity: what
performance do you get on the Athlon with a pentium3-compiled GMP?

I did very that the tp_compare errors are fixed. I removed the warnings
filter in my code and the warning did occur with the old gmpy but did
not occur with my version.


Excellent. Sounds like an "all systems go"...!-)
Thanks,

Alex
Nov 10 '05 #12
> > Will you be updating the information in setup.py file?

Done, in the current CVS version.
I will grab the CVS version and create installers.
Which versions of Python do you want to support?


I have tested gmpy with 2.3 and 2.4 on Mac, and those two and also 2.2
on Linux. I think supporting 2.2 with a Windows download is probably
unneeded, but 2.4 is a must and I suspect 2.3 would be nice...


I will definately build for 2.3 and 2.4.
Do you want versions that include GMP tailored for specific processors?
My gut reaction here is that people with special processors, Windows,
and demanding performance needs should probably get their own
development environments and build GMP and gmpy accordingly.

Any opinions from the public on this one...?


Unless there is a demand for compatibilty with older processors
(Pentium, Pentium Pro, Pentium II), I will build for Pentium 3.
With GMP 4.1.4 compiled for pentium3, and running on a 1.8Ghz Pentium
M, I'm able to calculate the decimal form of 2^25964951 (the 43rd
Mersenne prime) in 10 seconds. The prior gmpy release takes just over
14 seconds. Without gmpy, Python takes 25.4 seconds. On an Athlon
MP2800+ (2.133Ghz) with GMP compiled for that processor, I can do it in
6.6 seconds using gmpy and 22.4 seconds without gmpy. I'm working with
blocks of 1000 digits and using a combination of Toom-Cook and
Nussbaumer convolution to perform the multiplies and squares.
Sounds quite decent -- about a 2.5 to 3+ times speedup wrt Python, and
some speedup wrt gmpy 1.0 (all GMP's merit -- I didn't address
performance aspects at all in this delta). Just out of curiosity: what
performance do you get on the Athlon with a pentium3-compiled GMP?

I'll try to find out. Unfortunately, my Athlon box won't run Windows.
;-)
Thanks,

Alex


You're welcome,

Case

Nov 10 '05 #13
I tested gmpy cvs as of now on Debian/testing/x86 with python2.3. It
compiled perfectly, ran all of its unit tests and also all my test
programs - Well done!

My test program seemed to run at the same speed with both versions
(not suprising really since both are using the same libgmp.so on the
system).

Thanks and look forward to the release

Nick
--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Nov 10 '05 #14
Nick Craig-Wood <ni**@craig-wood.com> wrote:
I tested gmpy cvs as of now on Debian/testing/x86 with python2.3. It
compiled perfectly, ran all of its unit tests and also all my test
programs - Well done!
Thanks!
My test program seemed to run at the same speed with both versions
(not suprising really since both are using the same libgmp.so on the
system).
Yep, as I said any speed differences should be due to the underlying
GMP, since gmpy.c itself has not undergone any speed-related change.

Thanks and look forward to the release


Thank YOU for the feedback!
Alex
Nov 10 '05 #15
I've created Windows binaries for Python 2.3 and 2.4. It should be
compatible with PentiumPro or later processors.

They can be found at http://home.comcast.net/~casevh/

Case

Nov 11 '05 #16
<ca****@comcast .net> wrote:
I've created Windows binaries for Python 2.3 and 2.4. It should be
compatible with PentiumPro or later processors.


Thanks! I hope to package up a release early next week, and to include
these.
Alex
Nov 11 '05 #17
Alex Martelli wrote:
<ca****@comcast .net> wrote:
I've created Windows binaries for Python 2.3 and 2.4. It should be
compatible with PentiumPro or later processors.


Thanks! I hope to package up a release early next week, and to include
these.
Alex


I downloaded the binaries and ran some Big Arithmetic tests:
First, I wanted to see how version 1.0 handled the test which
is a typical problem for which I use gmpy. A Type [1,2] Mersenne
Hailstone is an object I encounter in my Collatz Conjecture
research. There are an infinite number of them. Every 9th (starting
from the 5th) generation 1 hailstone is a generation 2 hailstone.
Every 9th (starting from the 5th) generation 2 hailstone is a
generation 3 hailstone, etc.

In this case, a closed form equation can be used to directly find
the ith member of the kth generation. But not all hailstone types
have closed form equations. For those, I use a recursive function
that uses divm().

The test makes three passes. The first is a brute force search
through every Mesenne Number from 1 to 177150 bits. A test
determines what generation each is (most are not Type [1,2] and
evaluate to generation 0). The test prints the first occurrence of
each generation.

The second pass uses the closed form equation to directly
calculate the 1st member of each generation. These results must
match those found in the brute force search.

Finally, the third pass takes each hailstone found in the second
pass, calculates it's absolute offset from the first general
Type [1,2] hailstone of the corresponding generation, and calls
the recursive function to see if it calculates the same hailstone
found in pass 2 and pass 1.

=============== =============== ============

gmpy.version: 1.0 (with divm() replaced by invert())

Brute force search: gclass(2**i-1,xyz)
Find 1st Generation k Type [1,2] Mersenne Hailstone

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5

7.031 seconds

Closed form: Type12MH(k,i)
Find ith, kth Generation Type [1,2] Mersenne Hailstone
using the closed form equation

2**(6*((i-1)*9**(k-1)+(9**(k-1)-1)/2+1)-1)-1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7

0.657 seconds

Verify Type12MH Hailstones:
Find ith, kth Generation Type (xyz) Hailstone
using the recursive equation

(gmpy.divm(y**( k-1)-prev_gen[2],y-x,y**(k-1))/y**(k-2))*y**(k-1)+prev_gen[3]

where i=((hailstone-geni(k,1,xyz))/(y**k))+1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7

0.078 seconds

=============== =============== ============
NOTE: Brute force search could not reach generation 6 without
locking up

Switching to gmpy version 1.01
=============== =============== ============

gmpy.version: 1.01 (now using divm())

Brute force search: gclass(2**i-1,xyz)
Find 1st Generation k Type [1,2] Mersenne Hailstone

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5

0.579 seconds

Closed form: Type12MH(k,i)
Find ith, kth Generation Type [1,2] Mersenne Hailstone
using the closed form equation

2**(6*((i-1)*9**(k-1)+(9**(k-1)-1)/2+1)-1)-1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7

0 seconds

Verify Type12MH Hailstones:
Find ith, kth Generation Type (xyz) Hailstone
using the recursive equation

(gmpy.divm(y**( k-1)-prev_gen[2],y-x,y**(k-1))/y**(k-2))*y**(k-1)+prev_gen[3]

where i=((hailstone-geni(k,1,xyz))/(y**k))+1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7

0.015 seconds

=============== =============== ============
NOTE: Wow, what an improvement!
How far can I go now?
=============== =============== ============

gmpy.version: 1.01

Brute force search: gclass(2**i-1,xyz)
Find 1st Generation k Type [1,2] Mersenne Hailstone

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6

31.92 seconds

Closed form: Type12MH(k,i)
Find ith, kth Generation Type [1,2] Mersenne Hailstone
using the closed form equation

2**(6*((i-1)*9**(k-1)+(9**(k-1)-1)/2+1)-1)-1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7
2**14348909-1 generation: 8
2**129140165-1 generation: 9

0.234 seconds

Verify Type12MH Hailstones:
Find ith, kth Generation Type (xyz) Hailstone
using the recursive equation

(gmpy.divm(y**( k-1)-prev_gen[2],y-x,y**(k-1))/y**(k-2))*y**(k-1)+prev_gen[3]

where i=((hailstone-geni(k,1,xyz))/(y**k))+1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7
2**14348909-1 generation: 8
2**129140165-1 generation: 9

8.766 seconds

=============== =============== ============
NOTE: Brute force can now reach generation 6, but won't try
anything higher.
Generation 9 is a 129 million bit number!
Can we get to generation 10?
=============== =============== ============

gmpy.version: 1.01

Brute force search: gclass(2**i-1,xyz)
Find 1st Generation k Type [1,2] Mersenne Hailstone

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6

32.14 seconds

Closed form: Type12MH(k,i)
Find ith, kth Generation Type [1,2] Mersenne Hailstone
using the closed form equation

2**(6*((i-1)*9**(k-1)+(9**(k-1)-1)/2+1)-1)-1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7
2**14348909-1 generation: 8
2**129140165-1 generation: 9
2**1162261469-1 generation:10

51.83 seconds

Verify Type12MH Hailstones:
Find ith, kth Generation Type (xyz) Hailstone
using the recursive equation

(gmpy.divm(y**( k-1)-prev_gen[2],y-x,y**(k-1))/y**(k-2))*y**(k-1)+prev_gen[3]

where i=((hailstone-geni(k,1,xyz))/(y**k))+1

2**5-1 generation: 1
2**29-1 generation: 2
2**245-1 generation: 3
2**2189-1 generation: 4
2**19685-1 generation: 5
2**177149-1 generation: 6
2**1594325-1 generation: 7
2**14348909-1 generation: 8
2**129140165-1 generation: 9
Traceback (most recent call last):
File "C:\Python23\us er\gmpy ver 1.01\MHtest.py" , line 64, in ?
i = (h-a0)/(xyz[1]**g)

=============== =============== ============
NOTE: No, ran out of virtual memory. Probably due to the
recursion and having to store the pass 2 numbers.

I used to have a sign in my lab saying
"Test to Destruction"
But the paranoid schizophrenic field engineer
got freaked out by it and the boss made me
take it down.
=============== =============== ============
Excellent work guys!

Not only is the divm() bug fixed but it looks like we got a
significant performance increase.

Nov 22 '05 #18
What processor are you running?

I only have Windows running on an old Pentium 3. It is easy for me to
build a version that will running on almost any recent processor. I'm
willing to try and override the CPU detection and make a processor
specific build for you. I won't be able to test it, though.

Thanks for the testing!

Case

Nov 22 '05 #19
David Gutierrez <da*****@hotmai l.com> wrote:
Include me in your list, please.


Uh, what list? If you mean gmpy-commits, you subscribe to it on
gmpy.sf.net -- if you mean the general Python list, on www.python.org.
Alex
Nov 22 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6827
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
0
1093
by: vdex42 | last post by:
Apologies if this has been asked before, but I haven't been able to find the answer to this yet: My problem is that .NET will not allow me to insert escaped '>' characters (i.e. &gt;) within the text property of asp buttons, it seems to strip out only those type of characters, because other escape codes DO work (eg. &quote;) For example <asp:button Runat=server text="test &gt;" ID=txtTest></asp:button>
11
2237
by: Holger | last post by:
Hi I have not been able to figure out how to do compound statement from C - "<test>?<true-val>:<false-val>" But something similar must exist...?! I would like to do the equivalent if python of the C line: printf("I saw %d car%s\n", n, n != 1 ? "s" : "")
21
2022
by: py_genetic | last post by:
Hello, I'm importing large text files of data using csv. I would like to add some more auto sensing abilities. I'm considing sampling the data file and doing some fuzzy logic scoring on the attributes (colls in a data base/ csv file, eg. height weight income etc.) to determine the most efficient 'type' to convert the attribute coll into for further processing and efficient storage... Example row from sampled file data: , ....]
2
1278
by: defn noob | last post by:
What does >and << do? Googling on them and they are just ignored...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.