Phil Carmody on Fri, 26 Jan 2007 03:27:01 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: GMP build on OSX


--- Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr> wrote:
> * Phil Carmody [2007-01-25 01:40]:
> > I'm an OSX newb, so when even GMP 4.2.1 failed the same way I 
> > offloaded the task onto the guy who always seems to ends up 
> > doing my G5 builds for me:
> [...]
> >> I have to rebuild PARI.  It didn't build with GMP extensions and as  
> >> soon as I tried, it failed.  I had to modify get_cc to set the -m64  
> >> compiler flag.  I also had to modify get_gmp so that it would link  
> >> correctly.
> 
> 1) Does
> 
>   env CC="gcc -m64" ./Configure --with-gmp
> 
> do the trick ?
> 
> 2) If so, gcc apparently defaults to 32bit builds on this machine but
> libgmp was compiled with gcc -m64 ?
> 
> (Have no experience with G5's yet...).

I'm using a binary built by someone else now, and will work through his
instructions to reproduce the build on my machine. Certainly, he needed to
diddle with the -m64 flag, and by the looks of it a couple of others too.
I'll report back when I've built my own from scratch.

One thing that's seriously worrying me is the fact that I'm spending huge
proportions of my CPU time in the kernel:

top:
<<<
Processes:  51 total, 4 running, 47 sleeping... 125 threads            03:46:51
Load Avg:  2.15, 2.11, 2.08     CPU usage:  50.7% user, 48.8% sys, 0.5% idle
>>>

vm_stat:
<<<
geespaz:/Users/phil pcplus$ vm_stat 2   15   165   106M+ 2.38M   106M+  266M+ 
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 61%)
  free active inac wire   faults     copy zerofill reactive  pageins  pageout
 35297  43753 38475 13547   130005        0   130005        0        0        0
 38331  43753 35442 13547   111176        0   111176        0        0        0
>>>

Basically the CPUs are spending 30-50% of the time setting pages to zero.

Which means that if it didn't do that, my script (basically a huge LLL with
25kdigit coefficients - a Coppersmith-Howgrave-Graham Lattice-Reduction
primality proof) would be 1.5x-2x as fast.

Does anyone have any idea what might be causing all the zero-initialised page
requests? Is it pari itself, or would it be GMP that's doing it? The GMP (with
Mark Rodenkirch's tweaks) build is 7 times faster than the non-GMP build, so
I'm not going to revert to non-GMP.

As each LLL takes between a day and potentially weeks, and I have dozens to do,
I really would like to get maximum performance. Blanking petabytes of memory
really does seem such a waste.

Phil


()  ASCII ribbon campaign      ()    Hopeless ribbon campaign
/\    against HTML mail        /\  against gratuitous bloodshed

[stolen with permission from Daniel B. Cristofani]


 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited